import pandas as pd import tensorflow as tf from sklearn.model_selection import train_test_split
dataset = pd.read_csv('cancer.csv')
x = dataset.drop(columns=['diagnosis(1=m, 0=b)']) y = dataset['diagnosis(1=m, 0=b)']
x_train, x_test, y_train, y_test = train_test_split(x, y, test_size=0.2)
model = tf.keras.models.Sequential([ tf.keras.layers.Dense(256, input_shape=(30,), activation='sigmoid'), tf.keras.layers.Dense(256, activation='sigmoid'), tf.keras.layers.Dense(1, activation='sigmoid') ])
model.compile(optimizer='adam', loss='binary_crossentropy', metrics=['accuracy'])
model.fit(x_train, y_train, epochs=1000)
loss, accuracy = model.evaluate(x_test, y_test) print(f'Test Loss: {loss:.4f}') print(f'Test Accuracy: {accuracy:.4f}')