# I get different values when I use the train_test_split. Why is that?

Screen Link:

I used the scikit learn trains test split with a split of 0.5 and a random state of 1 (which should give the same solution as the provided solution). My results aren’t wild, but they are not exactly the same as the provided results, is it because of the manual index shuffling that we do for the solutions? The train_test_split is very handly for doing what we want and its part of the scikit learn

My Code:

What I expected to happen:
I expected to have this:

What actually happened:

my result

I would appreciate any help or insight into this. I am very curious.

Could be input order is different, library version is different, os is different. As long as you get repeatable results compared to yourself, no need to replicate others’ answers unless at ML researcher level.

Thanks Hanqi,

This puts my mind at ease. I thought I have to get the exact same thing. I think the way the tarin_test_split shuffles things may be a bit different. We probably get more similar results if we do monte carlo and then average.