2
$\begingroup$

As the title states, when I add another feature to the previous 200+ ones, the algorithm starts to train about 10 minutes, while earlier it trained only for a minute.

Can anybody please explain me why this can happen?

$\endgroup$
3
  • 1
    $\begingroup$ Which one of sklearn's linear regression classes are you using exactly? There are several in sklearn.linear_model, like LinearRegression, Ridge, Lasso,... $\endgroup$
    – stmax
    Apr 26 '16 at 10:28
  • $\begingroup$ Standart LinearRegression. $\endgroup$ Apr 26 '16 at 10:33
  • $\begingroup$ Could you be running out of memory? $\endgroup$
    – Emre
    Apr 26 '16 at 19:31
0
$\begingroup$

You can try to benchmarking the code. Python has robust benchmarking packages that track which parts of the code are taking the most time.

$\endgroup$
0
$\begingroup$

There is too few information to give a reasonable answer to this question, my thoughts is that the feature you are adding is a categorical variable presumably with a vast amount of different categories, what would increase the X matrix dimension (if using one hot encoding) thus increasing training time.

$\endgroup$

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.