I'm fairly new to machine learning and I am using the Linear SVM classifier to classify some text data and I was wondering what exactly does the fit_intercept parameter does and what would be a good reason to set it either True or False.

According to the scikit learn documentations what it does is:

Whether to calculate the intercept for this model. If set to false, no intercept will be used in calculations (i.e. data is expected to be already centered).

I know the intercept is the point where a function intercepts the y axis but I'm not sure how fitting it helps and why it could be needed. Would the hyperplane of the SVM be better positioned? Does it make the training faster? what does centering the data helps for and what does that exactly mean? Does it make sense to use it with a classification task or is it only useful with regression?

  • $\begingroup$ Check related thread: stats.stackexchange.com/questions/7948/… $\endgroup$ – Tim Sep 20 '17 at 13:56
  • $\begingroup$ as you said fitting the intercept will get you $y = x$ (adding a column of ones to the design matrix). by centering the data you are shifting the distribution so that it's mean is at zero. graphically (if looking at a 2d plot) this means your points will be shifted around the $y = x$ line. $\endgroup$ – atomsmasher Sep 20 '17 at 14:29
  • $\begingroup$ Thanks for the answers, now I have it more clear. Just another question, according to the link it doesn't make much sense to leave the intercept out unless it passes already through the origin. I tested different model configurations for classifying the text content of documents using GridSearchCV and the best results were with fit_intercept= False. Isn't that strange? or is there some explanation for it. $\endgroup$ – Atirag Sep 20 '17 at 15:11