Confused about regression - Machine Learning

by: Xsaber, 7 years ago


Hi, I've finished the tutorial named "Regression - Features and Labels" and unfortunately I didn't understand this line:
forecast_out = int(math.ceil(0.01 * len(df)))

Any explanations would be appreciated.



You must be logged in to post. Please login or register an account.



We wanted to get the # of days to forecast out. We decided we want to forecast out 10% of our data. So if we have 1 month  (30 days) of data, we want to forecast out 3 days...etc.

To get this variable, we're saying saying 10% of the length of the dataframe, rounded up, to the nearest whole number.

-Harrison 7 years ago

You must be logged in to post. Please login or register an account.

Lets say the data frame containing 1000 rows of data.
If we have to do with all the stuff in our current data frame, it will be represented by 100% of the data frame, coz we are using all of the data in it.
if we want to use 10% of it, we gonna deal with 100 rows of data from the data frame.
In your code,(i think you took it from sentdex tutorial) he is using only 0.01% of data, which means 10 rows of data only(in our case). That's it.
PS: if any detail i dropped here is wrong, forgive me and correct it :)
Have a good day!

-Vigneshwaran 5 years ago

You must be logged in to post. Please login or register an account.