# SVM is not fitted when tried to fit it into a model

I was trying to apply SVM into a dataset to find its accuracy. I also applied bagging and boosting on the same dataset and they worked properly. But when I tried to fit SVM into a model its not working. I couldn't understand whats the problem.

I'm providing the sample of my dataset

train_new.head()

# define X and y feature_cols = ['age','workclass','fnlwgt','education','education-num','marital-status','occupation','relationship','race','sex','capital-gain','capital-loss','hours-per-week','native-country']

# X is a matrix, hence we use [] to access the features we want in feature_cols X = train_new[feature_cols]

# y is a vector, hence we use dot to access 'label' y = train_new['label']

from sklearn import svm model = svm.SVC(kernel='linear', C=1, gamma=1)

and while trying to fit with model it's almost minutes passed and it's just look like,

What's the actual problem and could I solve it ?

• How big is your dataset? Can you post any error message as well? – vc_dim Jan 13 '18 at 13:21
• The dataset has 15 attributes with 30161 instances. And there are no error message but it looks like the posted last image. – IS2057 Jan 13 '18 at 13:47
• Test it first. SVC's generally take a large amount of time to run - and they also become more slower as more variables are added. Maybe try trimming down the variables and re-running. FYI: mins isn't a long time! – plumbus_bouquet Jan 14 '18 at 22:45
• Make sure to enable verbose, you may pick something up. At least you could show us the output. – Grzegorz Jan 15 '18 at 14:01