我用 scikit learn 进行多项式回归并尝试解释系数。但不知何故 scikit 不会格式化输出。所以它看起来像这样:
[ 0.,0.95545289,0.,0.20682341,-0.,0.,-0.,-0.,0.,0.,0.,-0.,0.,-0.,-0.,]
如何将系数映射到创建的特征?我到目前为止的代码:
poly = PolynomialFeatures(interaction_only=True)
X_ = poly.fit_transform(X_train_minmax)
X_test1 = poly.fit_transform(X_test_minmax)
lasso_model = linear_model.LassoCV(cv = 10, copy_X = True, normalize = False)
lasso_fit = lasso_model.fit(X_, y_train)
lasso_path = lasso_model.score(X_, y_train)
y_pred= lasso_model.predict(X_test1)
lasso_model.coef_
谢谢!