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

GBReweighter KeyError: 'squared_error' ?? #74

Open
oozcelik opened this issue Jun 28, 2022 · 7 comments
Open

GBReweighter KeyError: 'squared_error' ?? #74

oozcelik opened this issue Jun 28, 2022 · 7 comments
Labels

Comments

@oozcelik
Copy link

Hello everyone,

I'm constantly getting an error of " squared_error" which actually does not help much to understand the issue.
I attach the full error log.
Screen Shot 2022-06-28 at 4 05 57 PM

and the piece of code where it complains is :

reweighter = reweight.GBReweighter(n_estimators=50, learning_rate=0.1, max_depth=3, min_samples_leaf=1000,
gb_args={'subsample': 0.1})
reweighter.fit(original=original, target=target, original_weight=original_weights, target_weight=target_weights)
#reweighter.fit(original, target)
weights = reweighter.predict_weights(original)
draw_distributions(original, target, weights, target_weights)

Does anybody have any idea about what is wrong? Many thanks!

@arogozhnikov
Copy link
Owner

See the deprecation message from sklearn documentation:

Deprecated since version 1.0: Criterion “mse” was deprecated in v1.0 and will be removed in version 1.2. Use criterion="squared_error" which is equivalent.

I guess you need to update sklearn.

@oozcelik
Copy link
Author

oozcelik commented Jun 29, 2022

thanks for the response, I updated sklearn "pip install -U scikit-learn" now the version is scikit-learn-1.1.1 but I still get the exact same error. Do you reckon that I need to update any other packages?

@arogozhnikov
Copy link
Owner

Can't think about any other issue. Make sure to restart kernel, and verify sklearn by

print(sklearn.__version__)

@caiovnd
Copy link

caiovnd commented Dec 19, 2022

Hi everyone,

I am having an issue similar to the one @oozcelik reported, as shown bellow. I tried to update sklearn, as suggested by @arogozhnikov but also got the same error message.

image

@oozcelik
Copy link
Author

hi, I managed to get it work after deleting some files in my CERN BOX which causes conflict.

@caiovnd
Copy link

caiovnd commented Dec 19, 2022

Hi @oozcelik, what do you mean when you say that some files were causing conflict? I am not sure about which files I have might be related to this problem.

@arogozhnikov
Copy link
Owner

ensure you do use the new version of sklearn (should be run within the same process/notebook as hep_ml): print(sklearn.__version__)

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

No branches or pull requests

3 participants