feature-selector icon indicating copy to clipboard operation
feature-selector copied to clipboard

y contains previously unseen labels: "value"

Open clappis opened this issue 5 years ago • 2 comments

I have a multi-class problem where some of class values only appears in a few register, so when i run this module i got this error.

fs = FeatureSelector(data = data, labels = labels)

fs.identify_all(selection_params = {'missing_threshold': 0.9, 'correlation_threshold': 0.99, 'task': 'classification', 'eval_metric': 'multiclass', 'cumulative_importance': 1})

ValueError: y contains previously unseen labels: 'myClassValue'

clappis avatar Apr 06 '19 22:04 clappis

seems it only happens when early stopping is activated

clappis avatar Apr 06 '19 23:04 clappis

maybe a workaround is change line 306 of feature_selector to

train_features, valid_features, train_labels, valid_labels = train_test_split(features, labels, test_size = 0.15, stratify=labels)

clappis avatar Apr 07 '19 01:04 clappis