what is the Use of X.shape[0] here?
please help
Use of X.shape[0] here?
Yes Prashant, I didn’t get that
so ,
X is actually a numpy array , means it will be having some shape
a shape (n,m)
represents
n = number of records
m = number of columns
so as we need to split in 80:20 ratio , means 80*n:20*n
So , just doing x.shape[0] , will work something like (n,m)[0]
, returning only n
.
in this way we can use this value to create the splits in the data ( by getting the actual proportion )
I hope this helps.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.