i am new to the ml topic and tried some training today. I ran into several problems until i reached the position where i am now. Can anyone explane to me why the accurcy is not changing and why the loss function is so high? I used the wisconsin breast cancer data set.
Here is my code:
import pandas as pd
import tensorflow as tf
df = pd.read_csv('data.csv',)
df['diagnosis']=df['diagnosis'].replace(['M'], 1)
df['diagnosis']=df['diagnosis'].replace(['B'], 0)
df = df.iloc[: , :-1]
df.head
x = df.drop(columns=["diagnosis"])
y = df["diagnosis"]
from sklearn.model_selection import train_test_split
x_train, x_test, y_train, y_test = train_test_split(x, y, test_size=0.1)
model = tf.keras.models.Sequential()
model.add(tf.keras.layers.Dense(256, input_shape=(x_train.shape[1],), activation='sigmoid'))
model.add(tf.keras.layers.Dense(1, activation='sigmoid'))
model.summary()
model.compile(optimizer='adam', loss='binary_crossentropy', metrics=['accuracy'])
df.dtypes
model.fit(x_train, y_train, epochs=500)