Big difference between val-acc and prediction accuracy in Keras Neural Network

前端 未结 2 399
天命终不由人
天命终不由人 2021-01-28 07:14

I have a dataset that I used for making NN model in Keras, i took 2000 rows from that dataset to have them as validation data, those 2000 rows should be added in .predict<

2条回答
  •  没有蜡笔的小新
    2021-01-28 07:46

    The training data you posted gives high validation accuracy, so I'm a bit confused as to where you get that 65% from, but in general when your model performs much better on training data than on unseen data, that means you're over fitting. This is a big and recurring problem in machine learning, and there is no method guaranteed to prevent this, but there are a couple of things you can try:

    • regularizing the weights of your network, e.g. using l2 regularization
    • using stochastic regularization techniques such as drop-out during training
    • early stopping
    • reducing model complexity (but you say you've already tried this)

提交回复
热议问题