0
How do I find the value that cuts the x-axis of a regression line as shown in the graph below
My dataframe has the following structure:
total_da_carga data_ordinal
21708 737061
24845 737062
22696 737063
16433 737066
18238 737067
The data_ordinal field corresponds to the displacement of days for a period of time.
I need to know at which date the value of the load will be equal to 0 by the trend of the linear regression curve.
IA_Carga_CDD = carga[['total_da_carga','data_ordinal']]
X = IA_Carga_CDD['total_da_carga']
y = IA_Carga_CDD['data_ordinal']
x_train, x_test, y_train, y_test = train_test_split(X, y, test_size = 0.3)
lm = LinearRegression()
lm.fit(x_train,y_train)
predictions = lm.predict(0)
Carga_zero = datetime.fromordinal(predictions)
I tried to do it the way above, but I did not succeed.