-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Description This PR: - Adds ndcg value expecations to the tests, not just counts - Changes convert_non_numeric=True to be used for string columns (integers, floats in scores and bools should use the default convert_non_numeric=False ) - adds score_column support: when a score is available, like in [this example](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.ndcg_score.html), one should use score_column and target_column , and not prediction_column (see 2 last tests on the sklearn examples) - Changes the logic to generate target column values to make it compatible with all scenarios - Fixes prediction and ideal relevance calculation for non numeric case - Handles DivisionbyZero edge case when idcg=0 (ndcg set to 1 if no relevant documents exist) - If K is not passed, metrics will be calculated according to predictions cols's length (and metrics named accordingly - k is no longer omitted in the names when k is None) For the Numeric case: - If predictions+target or scores+target columns are both provided, they need to be of same length. - If prediction_column is provided with target column, prediction col contains the rank of suggested items, starting with 1 - If only prediction column is provided, it is assumed that the order encodes the ranks of recommendations: first item in the list is the first recommendation. The value in the list encodes the relevance score - [x] I have reviewed the [Guidelines for Contributing](CONTRIBUTING.md) and the [Code of Conduct](CODE_OF_CONDUCT.md). --------- Co-authored-by: felipe207 <felipe@whylabs.ai>
- Loading branch information
1 parent
0c72856
commit 164985c
Showing
2 changed files
with
88 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters