# Does running the script of train_test_split several times with varying test size in sklearn cause data leakage?

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.

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.