Last answered:

15 Mar 2022

Posted on:

12 Feb 2022

0

Resolved: Are 0.2 split and 0.8 split same?

Here in the test_size attribute, when I mentioned 0.8 (as instructed in the video above) it splits the data as 20% train and 80% test.
Have a look:
image.png
But when I mentioned 0.2 it gives the desired output
image.png
What's the reason behind this?

1 answers ( 1 marked as helpful)
Instructor
Posted on:

15 Mar 2022

0

Hi Saransh!

Thanks for reaching out.

The reason for the discrepancy between your output and the one shown in the videos is that you have not run the cells just before the second code cell from the first image you have posted (although the same can be observed for the second image as well). In other words, I suppose you obtain a different answer because of the fact that you may have executed the cells in different order.
For simplicity, please restart the kernel and run all cells from top to bottom to ensure that the order corresponds to the one shown in the videos. In that case, I believe you will manage to obtain the desired split upon the execution of the relevant cell.

Hope this helps.
Best,
Martin

Submit an answer