Syntax for fit() function: reg.fit(input_variable[:split], output_variable[:split])

Course Name: Trading with Machine Learning: Regression, Section No: 3, Unit No: 22, Unit type: Exercise

Hi! 

I am having hard time understanding why we are passing split variable X and yU under fit function. 

Thanks! 

 

Hi Amit,



We are passing split because we want to train our model (using the fit function) only on a part of the dataset so that we can keep the other part for testing. You can see from the syntax (split = int(t*len(Df))) that split is an integer that is equal to 80% of the total length of the dataset. The remaining 20% is kept for testing.



Hope this helps!



Thanks,

Akshay