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
EasyEnsemble should be a meta-estimator #252
Comments
A stupid implementation of the general scheme is this: from sklearn.base import clone
def make_resampled_ensemble(estimator, n_estimators=100):
estimators = []
for i in range(n_estimators):
est = clone(estimator)
if hasattr(est, "random_state"):
est.random_state = i
pipe = make_imb_pipeline(RandomUnderSampler(random_state=i, replacement=True),
est)
estimators.append(("est_i".format(i), pipe))
return VotingClassifier(estimators, voting="soft") Clearly you could do that more elegantly by actually writing a meta-estimator class... |
You are right. I think that this is also the solution at #149. |
@amueller is right. On the other hand we could preserve functionality by rename this class as |
Yep exactly. We need to deprecate the class as well. I let you on this one. We should do the same for BalanceCascade G
|
fwiw I don't have a strong opinion on also keeping the current version or not - people might rely on it. |
@chkoar I was thinking for that matter. I think that the resampling strategy should take any under-sampling methods and that the classifier could be any classifier as well. You should probably keep this in mind while designing the meta-estimators. |
I'm not entirely sure how EasyEnsemble should be used, but I feel like it might be easier if it was a meta-estimator.
Let's say I want to implement a random forest using EasyEnsemble as an estimator. I have no idea how to do that easily. If it was a meta-estimator, I could just do
EasyEnsemble(DecisionTreeClassifier(max_features="auto"))
, which would be nice. Ideally this would set the random seeds, too.I ended up with this solution, which works, but is verbose and probably inefficient:
[Though it is kinda neat that I can write it down like that ;]
The text was updated successfully, but these errors were encountered: