DeepLearning model classify everything as the same class

User 5157 | 5/10/2016, 4:02:58 PM

Hi, I have a dataset of 11120 examples, each has a classification- 1 or 2. 5560 examples for each class. I've tried working with deep learning but couldn't get good results. I create and train the model using this code:

shfld_data = gl.cross_validation.shuffle(data_set)
net = gl.deeplearning.create(shfld_data, 'label')
self.network_model = gl.neuralnet_classifier.create(shfld_data, 'label', network=net)

Then I test the model on other examples (the test examples) using this code:

shfld_data = gl.cross_validation.shuffle(test_data)
pred = self.network_model.classify(shfld_data)
results = self.network_model.evaluate(shfld_data)
print results

Unfortunately the results are:

+-----------+--------------+------+ | targetlabel | predictedlabel | count | +-----------+--------------+------+ |------1-----|-------1--------|-1113-| |------2-----|-------1--------|-1112-| +-----------+--------------+------+ [2 rows x 3 columns] , 'accuracy': 0.5002247095108032}

I don’t understand why it does not predict any example as class 2. Any help would be greatly appreciated!

No Comments