0
$\begingroup$

I am using a very large ~700,000 sample training set and ~700,000 sample testing set and training an SVM with the training set. When I run the SVM (SciKit-Learn) on the testing set it outputs only 0's. I was wondering why this would be? Do I need to reduce the dimensionality by running PCA or some other feature reduction algorithm?

The data consists of 293 features made up of a mixture of binary and continuous features.

$\endgroup$
  • $\begingroup$ How many '1' do you have in the training set ? How many in the testing set ? $\endgroup$ – user83346 Jan 16 '16 at 8:44
1
$\begingroup$

I would need to know more about the data but this is probably because you have a rare event and heavily imbalanced classes. My recommended would be to toggle the weights so that 1's and 0's are weighted evenly.

Something like "class_weight" in http://scikit-learn.org/stable/modules/generated/sklearn.linear_model.SGDClassifier.html#sklearn.linear_model.SGDClassifier .

$\endgroup$
  • $\begingroup$ I added some information about the data $\endgroup$ – MichaelGofron Jan 16 '16 at 3:04

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.