<jupyter_start><jupyter_text>Brest Cancer Detection using Artificial Neural Network<jupyter_code># Importing Dataset

from sklearn.datasets import load_breast_cancer
Data = load_breast_cancer() ## Load the DataSet
print(Data.DESCR)
## load Features and target of the dataset
features = Data.data
target = Data.target
features
target
features.shape
target.shape
from sklearn.model_selection import train_test_split
X_train, X_test, Y_train, Y_test = train_test_split(features, target, test_size=0.2) ## Split modals into train and test
print(X_train.shape)
print(Y_train.shape)
print(X_test.shape)
print(Y_test.shape)
print(X_train)
print(Y_train)
print(X_test)
print(Y_test)
from keras.models import Sequential
from keras.layers import Dense
## Create Modal and Add layers to it
modal = Sequential()
modal.add(Dense(32, input_dim = 30, activation = 'relu')) ## Hidden Layer 1
modal.add(Dense(64, activation = 'relu')) ## Hidden Layer 2
modal.add(Dense(1, activation = 'sigmoid'))
modal.summary()
modal.compile(loss = 'binary_crossentropy', optimizer = 'adam', metrics = ['accuracy']) # Compile  Modal
modal.summary()
modal.fit(X_train, Y_train, epochs = 100) ## Train Modal
accuracy =  modal.evaluate(x_test, Y_test) ## Check Accuracy
accuracy
# Predict the values based on test data
prediction = modal.predict(X_test)
for pred in prediction :
  if pred >= 0.5 :
    print('Malignent')
  else :
    print('Benign')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10941828254847645, 'fraction_numerical': 0.0110803324099723, 'mean_word_length': 6.153465346534653, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '283549', 'license': 'Apache-2.0', 'n_tokens_mistral': 505, 'n_tokens_neox': 479, 'n_words': 134, 'path': 'Brest_Cancer_Detection_using_ANN.ipynb', 'repo_name': 'Kunal726/DeepLearning', 'size': '1444'}