Replies: 1 comment
-
|
@DO891 考虑将代码改成: import abess
from abess import LinearRegression
model = LinearRegression()
## fit 方法中增加一个 `is_normal=True` 的选项
model.fit(x_train,y_train, is_normal=False) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
查询了x_train第三十个特征数据不是全部相同的,虽然删除该特征是可以的。但是我想不删除,有什么办法?
代码如下:
OverflowError Traceback (most recent call last) Cell In[56], line 5 2 from abess import LinearRegression 4 model = LinearRegression() ----> 5 model.fit(x_train,y_train) File ~\AppData\Local\Programs\Python\Python312\Lib\site-packages\abess\bess_base.py:610, in bess_base.fit(self, X, y, is_normal, sample_weight, cv_fold_id, sparse_matrix, beta_low, beta_high) 608 result = [np.zeros((p, M)), np.zeros(M), 0, 0, 0] 609 else: --> 610 result = pywrap_GLM( 611 X, y, sample_weight, n, p, normalize, algorithm_type_int, 612 model_type_int, 613 self.max_iter, self.exchange_num, path_type_int, 614 self.is_warm_start, eval_type_int, self.ic_coef, self.cv, 615 g_index, 616 support_sizes, alphas, cv_fold_id, new_s_min, new_s_max, 617 new_lambda_min, new_lambda_max, n_lambda, self.screening_size, 618 always_select_list, self.primary_model_fit_max_iter, 619 self.primary_model_fit_epsilon, early_stop, 620 self.approximate_Newton, self.thread, self.covariance_update, 621 sparse_matrix, self.splicing_type, self.important_search, 622 A_init_list, self.fit_intercept, beta_low, beta_high) 624 self.coef_ = result[0].squeeze() 625 self.intercept_ = result[1].squeeze()OverflowError: The variable 30 is constant. Please drop this variable or disable the normalization.
Beta Was this translation helpful? Give feedback.
All reactions