I have a data-set with 2 target classes. In training dataset, the ratio of the 2 classes are 1:93

With my neural network, the current accuracy is 63%. I tried undersampling, oversampling, equal sampling but not improvements.

  • $\begingroup$ try to change your architecture, also use F1 score for evaluation. $\endgroup$ Jan 29, 2018 at 15:47
  • $\begingroup$ change architecture? as in change the number of hidden layers or manipulating the data $\endgroup$ Jan 29, 2018 at 17:28
  • $\begingroup$ is F1 score for evaluation in keras available directly? $\endgroup$ Jan 29, 2018 at 17:29

1 Answer 1


You have not specified that what neural network you are using but as comments, you should try to fit your data first. You have to try to find a model that learns your training data. For this purpose you don't have to increase the number of data, at least not at this stage. You should try to find a good model which suits your data. For this purpose you have to change the hyper-parameters of your neural network, e.g. number of layers or number of neurons in layers. You can take a look at here and here which the former can help you and the latter helps you understand the features learned by CNNs in case you are using them.

For using F1 score in Keras I've not seen but you can implement it and pass it to compile method, take a look at here.

  • $\begingroup$ I am using a standard neural network of 4 layers(20,30,10,2). Isn't CNN used when with more layers we can detail out the features? $\endgroup$ Jan 29, 2018 at 17:47
  • $\begingroup$ I guess you are using MLP. We use CNNs usually in cases that the locality of the features, like images, are important. If you have image data I recommend you using CNNs. Moreover both links may help you. Also, welcome to our comunity. $\endgroup$ Jan 29, 2018 at 17:50
  • 1
    $\begingroup$ yes, i am using mlps. your links were really helpful $\endgroup$ Jan 29, 2018 at 17:51

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