I was wondering if somebody would be able to shine a light on accuracy converging to 1 relatively quickly during training.

I am working on some new data and this is the first time i have seen this. I have attached the imaged of accuracy and loss (actual and validation set).

I am running a multi-label network where the data fits in to either class one, two or three. The code I am using is as follows:

model= tf.keras.models.Sequential()
model.add(tf.keras.layers.Dense(units=416, input_dim=20539, activation="relu"))
model.add(tf.keras.layers.Dense(units=288, activation="relu"))
model.add(tf.keras.layers.Dense(units=576, activation="relu"))
model.add(tf.keras.layers.Dense(units=3, activation="softmax"))

model.compile(loss="categorical_crossentropy", optimizer="SGD", metrics=['accuracy'])

history=model.fit(X_trainERSC.values, y_trainERSC,
          callbacks=[EarlyStopping(monitor='val_loss', patience=5)],shuffle=True)

Now the network trains fine and everything seems ot be ok and in a similar trend to data i have worked with previously. However, unlike the previous data which converges to about 97% for accuracy, the accuracy in this data converges to 1. I was wondering if this is normal? I know this seems vague, but i am not sure what to make of this and if for, accuracy and loss, extremely low loss as well as convergence to 1 is normal?

Many thanks!!

enter image description here enter image description here


Perfect accuracy on training data doesn't mean much, but you seem to have admirable accuracy out-of-sample, too (~90%). Accuracy isn't always the best measure of performance (imagine if you have 99% of your observations belonging to one category), but that looks good to me.

Converging to exactly 1 means that you've fit to some of the noise. That is pretty much always going to happen, and we validate on out-of-sample data to make sure that the overfitting isn't too severe. Again, your out-of-sample accuracy is pretty high, so in-sample data having a perfect accuracy score would not concern me.

(I'm assuming that 90% validation accuracy is high performance for your task. It might not be, for instance, if you're doing an MNIST classifier.)

| cite | improve this answer | |
  • $\begingroup$ Thank you so much for the quick response and for clarifying this! yes that is a good point. I will bare this in mind. 'Converging to exactly 1 means that you've fit to some of the noise. That is pretty much always going to happen' thank you for clarifying this... i actually have never seen this in any network i have built so wasnt sure if this was expected?.. 90% is very good considering my task! :) its not the MNIST dataset haha! thanks again! $\endgroup$ – user9317212 Oct 21 '19 at 15:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.