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

Adds sample weights to accuracy_score #217

Merged
merged 4 commits into from Jun 25, 2018

Conversation

@jrbourbeau
Copy link
Member

@jrbourbeau jrbourbeau commented Jun 20, 2018

This PR adds implements sample weighting for accuracy_score

For compatibility with scikit-learn. This is currently not
supported.
sample_weight : 1d array-like, optional
Sample weights.

This comment has been minimized.

@TomAugspurger

TomAugspurger Jun 21, 2018
Member

Could you add a

    .. versionadded:: 0.7.0

directive below Sample weights.

We should start doing this for all new features / keywords.

@TomAugspurger
Copy link
Member

@TomAugspurger TomAugspurger commented Jun 21, 2018

Looks good overall.

Only thing might be how this behaves with dask < 0.18.0. If someone has dask 0.17, they'll get AttributeError: module 'dask.array' has no attribute 'average'. Maybe we could check the dask version and raise a nicer error message if it's too old?

@jrbourbeau
Copy link
Member Author

@jrbourbeau jrbourbeau commented Jun 21, 2018

Good point, I'll check the dask version number and raise a NotImplementedError accordingly

@jrbourbeau
Copy link
Member Author

@jrbourbeau jrbourbeau commented Jun 21, 2018

I thought checking the dask version might end up being useful elsewhere, so I added DASK_VERSION to dask_ml._compat (similar to the existing SK_VERSION).

@TomAugspurger
Copy link
Member

@TomAugspurger TomAugspurger commented Jun 25, 2018

Sorry, thought this was merged.

@TomAugspurger TomAugspurger merged commit 0cd9a03 into dask:master Jun 25, 2018
3 checks passed
3 checks passed
ci/circleci: py27 Your tests passed on CircleCI!
Details
ci/circleci: py36 Your tests passed on CircleCI!
Details
ci/circleci: sklearn_dev Your tests passed on CircleCI!
Details
@jrbourbeau
Copy link
Member Author

@jrbourbeau jrbourbeau commented Jun 25, 2018

No probs, thanks @TomAugspurger!

@jrbourbeau jrbourbeau deleted the jrbourbeau:accuracy_score_weights branch Jun 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants