df['Y_fit_no_intercept'] = model_no_intercept.y_fitted
offset = -1
df['Yoffset'] = df['Y'] - offset
model_with_offset = pd.ols(y=df['Yoffset'], x=df['X'], intercept=False)
df['Y_fit_offset'] = model_with_offset.y_fitted + offset
print(model_with_intercept)
print(model_no_intercept)
print(model_with_offset)
df.plot(x='X', y=['Y', 'Y_fit_with_intercept', 'Y_fit_no_intercept',
    'Y_fit_offset'])
plt.show()
Линейная регрессия - уменьшите степени свободы