-
Notifications
You must be signed in to change notification settings - Fork 109
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
Bug? mlens.utils.check_instances
returns wrong pipeline orders
#122
Comments
mlens.utils.check_instances
returns a wrong pipeline ordermlens.utils.check_instances
returns wrong pipeline orders
Sorry the correct last line is |
|
Hey! Thanks for flagging this, definitely looks like a bug. It's reordering based on name, the offending line seems to be the I'll try to fix this some time this week, but feel free to make a PR. |
Hi @flennerhag , Thanks for the reply. And... I found another bug here. 😲 Codefrom mlens.utils import check_instances
from sklearn.preprocessing import (
StandardScaler as SS, FunctionTransformer as FT)
from xgboost import XGBClassifier
clf = XGBClassifier(n_estimators=10)
def f1(): return 1
def f2(): return 2
s = SS()
estimators = {
'key-1': [clone(clf)],
'key-2': [clone(clf)],
}
preprocessing = {
'key-1': [FT(f2), s, FT(f1)],
'key-2': [s, FT(f2), FT(f1)],
}
check_instances(estimators, preprocessing)[0] Result
The two standard scaler (singleton) are grouped together. |
If I understand it right,
check_instances
seems to tend to cluster transformers with same types without regard to the list order.So the results from
make_group
andBaseEnsemble
are also wrong.Reproduce - Case 1
Code
Result
Expected Behavior
The order should be
[FT(f1), SS(), FT(f2)]
rather thanFT(f1), FT(f2), SS()
Reproduce - Case 2
Code
Result
key1 should be [FT(f2), SS(), FT(f1)] rather than [FT(f2), FT(f1), SS()]
key2 should be [FT(f2), SS(), FT(f1)] rather than [FT(f2), FT(f1), SS()]
The text was updated successfully, but these errors were encountered: