I ran a script of ridge and lasso regression twice with and without pca. Both times i got an okay R^2. but when i changed the train_test_split test size from 20 to 30%. My model started to over fit. So i was wondering whether this is because of changing the test size or something else.

Thank you in advance,

| improve this question | | | | |

It's understandable that when you get less training data your model can overfit (i.e. less data means less requirements to satisfy for your objective function which results in easier fitting for the problem) but it is also interesting that your models are sensitive to that much change. I advise you to try cross-validation with 30 % test split size using RidgeCV and LassoCV classes.

| improve this answer | | | | |
  • $\begingroup$ Thank you for your answer. The change was drastic from 0.6 to 0.99. that is why i thought that there might be something else happening. Ill try the CVs! Thanks again $\endgroup$ – tsumaranaina Jan 11 '19 at 8:16
  • $\begingroup$ Unfortunately, i got the same results with RidgeCV.. $\endgroup$ – tsumaranaina Jan 11 '19 at 9:38

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.