0
votes

In the context of a binary classification, I use a neural network with 1 hidden layer using a tanh activation function. The input is coming from a word2vect model and is normalized.

The classifier accuracy is between 49%-54%.

I used a confusion matrix to have a better understanding on what’s going on. I study the impact of feature number in input layer and the number of neurons in the hidden layer on the accuracy.

What I can observe from the confusion matrix is the fact that the model predict based on the parameters sometimes most of the lines as positives and sometimes most of the times as negatives.

Any suggestion why this issue happens? And which other points (other than input size and hidden layer size) might impact the accuracy of the classification?

Thanks

2
That's no better than a coin flip. You should put the neural network aside and understand your data better before you do anything else. I'd also recommend trying a logistic regression. - duffymo

2 Answers

0
votes

It's a bit hard to guess given the information you provide. Are the labels balanced (50% positives, 50% negatives)? So this would mean your network is not training at all as your performance corresponds to the random performance, roughly. Is there maybe a bug in the preprocessing? Or is the task too difficult? What is the training set size?

I don't believe that the number of neurons is the issue, as long as it's reasonable, i.e. hundreds or a few thousand.

Alternatively, you can try another loss function, namely cross entropy, which is standard for multi-class classification and can also be used for binary classification: https://www.tensorflow.org/api_docs/python/nn/classification#softmax_cross_entropy_with_logits

Hope this helps.

-2
votes

The data set is well balanced, 50% positive and negative.

The training set shape is (411426,X)

The training set shape is (68572,X)

X is the number of the feature coming from word2vec and I try with the values between [100,300]

I have 1 hidden layer, and the number of neurons that I test varied between [100,300]

I also test with mush smaller features/neurons size: 2-20 features and 10 neurons on the hidden layer. I use also the cross entropy as cost fonction.