-
-
Notifications
You must be signed in to change notification settings - Fork 262
Annotate metrics #630
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
Annotate metrics #630
Conversation
Add blanklines again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Gave a quick pass through. Will look more later.
X: ArrayLike, Y: ArrayLike, precomputed: bool = False | ||
) -> Tuple[ArrayLike, ArrayLike]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know typing well enough, but I think there's a way to say that the Type[X]
will exactly match the type of the first element of the result tuple? So you know that if you put in a dask.Array you'll get back a dask.Array rather than an numpy.ndarray?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about this :/ .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK to punt on it for now.
y_true: ArrayLike, | ||
y_pred: ArrayLike, | ||
sample_weight: Optional[ArrayLike] = None, | ||
multioutput: Optional[str] = "uniform_average", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to check with scikit-learn what the actual supported types are. Can this be an array, which just isn't implemented yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://scikit-learn.org/stable/modules/generated/sklearn.metrics.mean_squared_error.html
multi_output
is a string
If you merge master then the unrelated CI issues should be fixed. |
@TomAugspurger , Request your review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking close, thanks!
Can you add And there are some linting issues there which aren't failing the build. https://dev.azure.com/dask-dev/dask/_build/results?buildId=818&view=logs&j=34469798-9dec-5482-c96c-ad1eda9ec58d&t=3856b5af-eaa9-56ed-b4cc-e7b6fad51231&l=12 Can you fix those? I'll figure out why CI isn't failing. |
Thanks @TomAugspurger . I am working on the changes. |
Can you merge master? There will be a merge conflict with |
I think it should have worked.
|
I think Or... perhaps add an Just FYI @rth @thomasjpfan. IIRC you're investigating type annotations for scikit-learn. I'm not sure if there's a way for us to share types, since we have different definitions of "ArrayLike", but we can coordinate in places where we overlap. |
Thanks :) |
@TomAugspurger , It's all good now :) |
Thanks, this looks good! |
@TomAugspurger As far as I know, in scikit-learn we won't type array like objects for now precisely because it's unclear what the type for "ArrayLike" input should be. So at least there shouldn't be an issue of types being over-constrained on the scikit-learn side. |
This is true of most things I think :) |
* Add annotations for metrics module
Changes made:
Partially fixes #607