Closed
Description
I am trying to use SMOTE along with Randomforest multiOutputClassifier.
Here is how I am using it,
forest = RandomForestClassifier(n_estimators= n_estimator, random_state=1)
multi_target_forest = MultiOutputClassifier(forest, n_jobs=-1)
sampler = SMOTE()
clf = make_pipeline(sampler, multi_target_forest)
model = clf.fit(vecs, vec_labels)
Is there a support for multOutputClassifier? Is this the correct way to use it?
I am encountering the value error in vec_labels.
length of vecs is 1631, vec_labels is [1631][241].
Please help.
Activity
chkoar commentedon Aug 29, 2017
I think that
scikit-learn
'sRandomForestClassifier
supports multi-output problems out of the box.Anyway, assuming that you import the
make_pipeline
from theimbalanced-learn
package, could you try the snippet below?glemaitre commentedon Aug 29, 2017
If the method of @chkoar (which should work) does not work, I don't think we should support mutli-target. In some way, the bottleneck will be for theoretical reason since the algorithms were not designed to work for multi-targets.
@chkoar WDYT?
aqibsaeed commentedon Sep 3, 2017
I also think this would be a very nice addition to support multi-class oversampling out of the box with imbalanced-learn.
glemaitre commentedon Sep 3, 2017
It is already supported.
glemaitre commentedon Sep 5, 2017
Closed if favor of #340 regarding support of multilabel/multiclass