I am new to NN. In order to study, I created a simple neural network model using Keras. On every rerun the accuracy is changing (+/-)10-30%, that means, sometimes I got 94%, but in the next execution it will decrease into 60%. I am using same data set for every run.
df = pd.read_csv("../Datasets/error_pred/mulclass.csv")
df.columns = ["var1","var2","result","outcome"]
scaled_train_samples = df[['var1', 'var2','result']].values
train_labels = df.outcome.values
model_m = Sequential([
Dense(units=8, input_shape=(3,), activation='relu'),
Dense(units=16, activation='relu'),
Dense(units=2, activation='softmax')
])
model_m.compile(optimizer=tf.keras.optimizers.Adam(learning_rate = 0.0001), loss = 'sparse_categorical_crossentropy', metrics = ['accuracy'])
model_m.fit(x=scaled_train_samples, y=train_labels, batch_size=10, epochs=100, validation_split=0.1, shuffle=True,verbose=2)
from numpy import loadtxt
test_dataset = loadtxt('../Datasets/error_pred/mulTest.csv', delimiter=',')
X_test = test_dataset[:,0:3]
y_test = test_dataset[:,3:]
_, accuracy = model_m.evaluate(X_test, y_test)
accuracy*100