[Metrics] Sklearn metrics
See original GitHub issueDo 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:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

The AllenNLP also started with CPU-based metrics to move some of them to GPU later - PR 3851
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.