question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Metrics] Sklearn metrics

See original GitHub issue

Do we want to include metrics of sklearn?

The following constraints would apply if we had an sklearn metric interface:

  • All imports would be within the class space, so sklearn would only remain an optional dependency (due to it’s size)
  • All metrics will be provided by sklearn interface at first, but will be removed later on (once we got a native pytorch implementation)

The Advantages:

  • We have a pretty impressive set of metrics directly in the beginning
  • the maintenance effort is minimal
  • they’re well tested

The disadvantages

  • For every call to a metric, we need to convert tensors to numpy
  • We will have to synchronise GPU(s) whenever we call a metric with inputs lying on GPU, which may be a bottleneck the users aren’t aware of

My proposal

  • Add this layer in the beginning and try to replace as many of the metrics used there by our own 😃
  • Explicitly state the downfalls in docs (and maybe also raise a warning on that) to ensure users are aware of this problem.

Thoughts?

cc @Borda @williamFalcon @ethanwharris @PyTorchLightning/core-contributors

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
rzepinskipcommented, Mar 30, 2020

The AllenNLP also started with CPU-based metrics to move some of them to GPU later - PR 3851

0reactions
stale[bot]commented, May 29, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

3.3. Metrics and scoring: quantifying the quality of predictions
The sklearn.metrics module implements several loss, score, and utility functions to measure classification performance. Some metrics might require probability ...
Read more >
3.5. Model evaluation: quantifying the quality of predictions
The sklearn.metrics implements several losses, scores and utility functions to measure classification performance. Some metrics might require probability ...
Read more >
sklearn.metrics.accuracy_score
Accuracy classification score. In multilabel classification, this function computes subset accuracy: the set of labels predicted for a sample must exactly match ...
Read more >
sklearn.metrics.classification_report — scikit-learn 1.2.0 ...
Examples using sklearn.metrics.classification_report: Recognizing hand-written digits ... Build a text report showing the main classification metrics.
Read more >
API Reference — scikit-learn 1.2.0 documentation
The sklearn.metrics.cluster submodule contains evaluation metrics for cluster analysis results. There are two forms of evaluation: supervised, which uses a ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found