Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when attempting to use with a continuous target variable #41

Open
MichelFloyd opened this issue May 12, 2020 · 0 comments
Open

Error when attempting to use with a continuous target variable #41

MichelFloyd opened this issue May 12, 2020 · 0 comments

Comments

@MichelFloyd
Copy link

I'm attempting to use feature-selector in a case where the target variable is continuous. This causes a failure in lightgbm:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-56-844128e538ad> in <module>
      4     'eval_metric': 'rmse',
      5     'task': 'classification',
----> 6     'cumulative_importance': 0.95
      7 }) 

/opt/conda/lib/python3.6/site-packages/feature_selector/feature_selector.py in identify_all(self, selection_params)
    401         self.identify_single_unique()
    402         self.identify_collinear(selection_params['correlation_threshold'])
--> 403         self.identify_zero_importance(task = selection_params['task'], eval_metric = selection_params['eval_metric'])
    404         self.identify_low_importance(selection_params['cumulative_importance'])
    405 

/opt/conda/lib/python3.6/site-packages/feature_selector/feature_selector.py in identify_zero_importance(self, task, eval_metric, n_iterations, early_stopping)
    309                 model.fit(train_features, train_labels, eval_metric = eval_metric,
    310                           eval_set = [(valid_features, valid_labels)],
--> 311                           early_stopping_rounds = 100, verbose = -1)
    312 
    313                 # Clean up memory

/opt/conda/lib/python3.6/site-packages/lightgbm/sklearn.py in fit(self, X, y, sample_weight, init_score, eval_set, eval_names, eval_sample_weight, eval_class_weight, eval_init_score, eval_metric, early_stopping_rounds, verbose, feature_name, categorical_feature, callbacks)
    760         super(LGBMRanker, self).fit(X, y, sample_weight=sample_weight,
    761                                     init_score=init_score, group=group,
--> 762                                     eval_set=eval_set, eval_names=eval_names,
    763                                     eval_sample_weight=eval_sample_weight,
    764                                     eval_init_score=eval_init_score, eval_group=eval_group,

/opt/conda/lib/python3.6/site-packages/sklearn/utils/multiclass.py in check_classification_targets(y)
    167     y : array-like
    168     """
--> 169     y_type = type_of_target(y)
    170     if y_type not in ['binary', 'multiclass', 'multiclass-multioutput',
    171                       'multilabel-indicator', 'multilabel-sequences']:

ValueError: Unknown label type: 'continuous'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant