<jupyter_start><jupyter_text><jupyter_code>import pandas as pd

from google.colab import files
files.upload()                                    # uploading csv files
xtrain = pd.read_csv('xtrain.csv', header=None)
ytrain = pd.read_csv('ytrain.csv', header=None)
xtest = pd.read_csv('xtest.csv', header=None)
ytest = pd.read_csv('ytest.csv', header=None)
# Now we build ANN model with Keras
from keras.models import Sequential
from keras.layers import Dense

classifier = Sequential()   # initializing the ANN

classifier.add(Dense(units=16, activation='relu', input_dim=30))
classifier.add(Dense(units=8, activation='relu'))
classifier.add(Dense(units=6, activation='relu'))
classifier.add(Dense(units=1, activation='sigmoid'))
# Now we have to spacify optimizer and loss function
classifier.compile(optimizer='rmsprop', loss='binary_crossentropy')
# Now we are going to train the Network
classifier.fit(xtrain, ytrain, batch_size=1, epochs=100)
ypred = classifier.predict(xtest)

ypred = pd.Series([1 if y>=0.5 else 0 for y in ypred])
print(type(ypred))
from sklearn.metrics import confusion_matrix 
conf_mat = confusion_matrix(ypred, ytest)
conf_mat = pd.DataFrame(conf_mat, index=['non_cancererous', 'cancererous'], columns=['non_cancererous', 'cancererous'])

import seaborn as sns
sns.heatmap(conf_mat, annot=True)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12518518518518518, 'fraction_numerical': 0.011111111111111112, 'mean_word_length': 6.148148148148148, '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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '423694', 'license': 'Apache-2.0', 'n_tokens_mistral': 478, 'n_tokens_neox': 460, 'n_words': 108, 'path': 'BrestCancer.ipynb', 'repo_name': 'mitunkantipaul/MachinLearning_mitun', 'size': '1350'}