Skip to content
This repository was archived by the owner on Feb 28, 2025. It is now read-only.

y_test, y_true args removed from roc constructor #135

Merged
merged 9 commits into from
Jan 12, 2023

Conversation

yafimvo
Copy link
Contributor

@yafimvo yafimvo commented Dec 25, 2022

Describe your changes

  1. y_test, y_true args removed from roc constructor
  2. Generates roc using fpr and tpr values
  3. ROC and ROCAdd implemented with AbstractPlot and AbstractComposedPlot
  4. Examples updated to roc.from_raw_data(y_true, y_score)
  5. Old API invokes roc.from_raw_data(y_true, y_score, ax=ax)

Issue ticket number and link

Closes #121

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have added thorough tests (when necessary).
  • I have added the right documentation (when needed). Product update? If yes, write one line about this update.

@coveralls
Copy link

coveralls commented Dec 25, 2022

Pull Request Test Coverage Report for Build 3902708281

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 96 of 97 (98.97%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.05%) to 94.629%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/sklearn_evaluation/plot/roc.py 95 96 98.96%
Totals Coverage Status
Change from base Build 3902679656: 0.05%
Covered Lines: 2643
Relevant Lines: 2793

💛 - Coveralls

@idomic idomic requested a review from edublancas December 26, 2022 02:08
@idomic
Copy link
Contributor

idomic commented Jan 5, 2023

@yafimvo please address

@yafimvo
Copy link
Contributor Author

yafimvo commented Jan 10, 2023

@idomic let's move this conversation here.

I don't think we need to combine issue #98 with this since this one has a lot of changes.

@yafimvo yafimvo requested review from edublancas and idomic January 10, 2023 22:59
idomic
idomic previously approved these changes Jan 11, 2023
Copy link
Contributor

@idomic idomic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

@idomic
Copy link
Contributor

idomic commented Jan 11, 2023

Is there documentation? That's the only thing I was missing.
Good test cases!

@edublancas if there's any comments now's the time.

@idomic
Copy link
Contributor

idomic commented Jan 11, 2023

@yafimvo I also don't see a changelog entry.

from sklearn_evaluation import __version__
import json
from pathlib import Path
from warnings import warn # noqa
from ..plot.plot import AbstractPlot, AbstractComposedPlot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we're no longer using relative imports, please change

Copy link
Contributor Author

@yafimvo yafimvo Jan 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example, if ``y_true = [2, 2, 1, 0, 0, 1, 2]``, then the
first column in y_score must contain the scores for class 0,
second column for class 1 and so on.

Examples
--------
.. plot:: ../examples/roc_new_api.py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's update this example so it shows how the new API works (using from_raw_data).

  • roc for binary classification
  • roc for multi-class
  • comparing two binary classifiers (plot1 + plot2)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already had these examples (except the multi-class).
I changed the names and added an example for multi-class.

please check if these examples are ok.

@idomic Does this multi-class example address #98 ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really, the issue there is the error message.

@idomic idomic merged commit f887dcf into ploomber:master Jan 12, 2023
yafimvo pushed a commit to yafimvo/sklearn-evaluation that referenced this pull request Jan 12, 2023
Replaced n_clusters to range_n_clusters in plot.elbow_curve  (ploomber#182)

* range_n_clusters added to elbow_curve signature

* reversed auto lint changes

* deprecation warning added to docs

* deprecation note fixed

Co-authored-by: yafim <[email protected]>

Updating ROC constructor, removed y_test, y_true args  (ploomber#135)

* y_test, y_true args removed from roc constructor

* AbstractPlot added to ROC

* roc_rates_n_classes removed

* tests added, code cleaned

* examples added, relative import fixed, changelog updated

Co-authored-by: yafim <[email protected]>
Co-authored-by: Ido M <[email protected]>

baseline image updated

changelog updated
idomic pushed a commit that referenced this pull request Jan 12, 2023
Replaced n_clusters to range_n_clusters in plot.elbow_curve  (#182)

* range_n_clusters added to elbow_curve signature

* reversed auto lint changes

* deprecation warning added to docs

* deprecation note fixed

Co-authored-by: yafim <[email protected]>

Updating ROC constructor, removed y_test, y_true args  (#135)

* y_test, y_true args removed from roc constructor

* AbstractPlot added to ROC

* roc_rates_n_classes removed

* tests added, code cleaned

* examples added, relative import fixed, changelog updated

Co-authored-by: yafim <[email protected]>
Co-authored-by: Ido M <[email protected]>

baseline image updated

changelog updated

Co-authored-by: yafim <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

minor fix to ROC
5 participants