import numpy as np
from sklearn.linear_model import Ridge
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import PolynomialFeatures
x = 10 * np.random.random(100)
y = -4 + 2 * x - 3 * x ** 2
model = make_pipeline(PolynomialFeatures(2), Ridge(alpha=1e-08,
    fit_intercept=False))
model.fit(x[:, (None)], y)
ridge = model.named_steps['ridge']
print(ridge.coef_)
Как извлечь уравнение из полиномиальной подгонки?