@@ -6,16 +6,17 @@ A toolkit of metrics and visualizations for model performance in data-driven mat
6
6
7
7
[ ![ Tests] ( https://github.com/janosh/ml-matrics/workflows/Tests/badge.svg )] ( https://github.com/janosh/ml-matrics/actions )
8
8
[ ![ pre-commit.ci status] ( https://results.pre-commit.ci/badge/github/janosh/ml-matrics/main.svg )] ( https://results.pre-commit.ci/latest/github/janosh/ml-matrics/main )
9
+ [ ![ PyPI] ( https://img.shields.io/pypi/v/ml-matrics )] ( https://pypi.org/project/ml-matrics )
10
+ [ ![ This project supports Python 3.8+] ( https://img.shields.io/badge/Python-3.8+-blue.svg )] ( https://python.org/downloads )
9
11
[ ![ License] ( https://img.shields.io/github/license/janosh/ml-matrics?label=License )] ( /license )
10
12
[ ![ GitHub Repo Size] ( https://img.shields.io/github/repo-size/janosh/ml-matrics?label=Repo+Size )] ( https://github.com/janosh/ml-matrics/graphs/contributors )
11
- [ ![ This project supports Python 3.8+] ( https://img.shields.io/badge/Python-3.8+-blue.svg )] ( https://python.org/downloads )
12
13
13
14
</h4 >
14
15
15
16
## Installation
16
17
17
18
``` sh
18
- pip install -U git+https://github.com/janosh/ ml-matrics
19
+ pip install ml-matrics
19
20
```
20
21
21
22
For a locally editable install, use
@@ -24,94 +25,79 @@ For a locally editable install, use
24
25
git clone https://github.com/janosh/ml-matrics && pip install -e ml-matrics
25
26
```
26
27
27
- To specify a dependence on this package in ` requirements.txt ` , use
28
-
29
- ``` txt
30
- pandas==1.1.2
31
- numpy==1.20.1
32
- git+git://github.com/janosh/ml-matrics
33
- ```
34
-
35
- To specify a specific branch or commit, append its name or hash, e.g.
36
-
37
- ``` txt
38
- git+git://github.com/janosh/ml-matrics@main # default
39
- git+git://github.com/janosh/ml-matrics@41b95ec
40
- ```
41
-
42
28
## Parity Plots
43
29
44
30
See [ ` ml_matrics/parity.py ` ] ( ml_matrics/parity.py ) .
45
31
46
- | [ ` density_scatter(xs, ys, ...) ` ] ( ml_matrics/parity.py ) | [ ` density_scatter_with_hist(xs, ys, ...) ` ] ( ml_matrics/parity.py ) |
47
- | :---------------------------------------------------------------: | :----------------------------------------------------------------: |
48
- | ![ density_scatter] ( assets/density_scatter.svg ) | ![ density_scatter_with_hist] ( assets/density_scatter_with_hist.svg ) |
49
- | [ ` density_hexbin(xs, ys, ...) ` ] ( ml_matrics/parity.py ) | [ ` density_hexbin_with_hist(xs, ys, ...) ` ] ( ml_matrics/parity.py ) |
50
- | ![ density_hexbin] ( assets/density_hexbin.svg ) | ![ density_hexbin_with_hist] ( assets/density_hexbin_with_hist.svg ) |
51
- | [ ` scatter_with_err_bar(xs, ys, yerr, ...) ` ] ( ml_matrics/parity.py ) | [ ` residual_vs_actual(y_true, y_pred, ...) ` ] ( ml_matrics/parity.py ) |
52
- | ![ scatter_with_err_bar] ( assets/scatter_with_err_bar.svg ) | ![ residual_vs_actual] ( assets/residual_vs_actual.svg ) |
32
+ | [ ` density_scatter(xs, ys, ...) ` ] ( ml_matrics/parity.py ) | [ ` density_scatter_with_hist(xs, ys, ...) ` ] ( ml_matrics/parity.py ) |
33
+ | :--------------------------------------------------------------------------------------------------------------- : | :--------------------------------------------------------- ----------------------------------------------------------------: |
34
+ | ![ density_scatter] ( https://raw.githubusercontent.com/janosh/ml-matrics/main/ assets/density_scatter.svg) | ![ density_scatter_with_hist] ( https://raw.githubusercontent.com/janosh/ml-matrics/main/ assets/density_scatter_with_hist.svg) |
35
+ | [ ` density_hexbin(xs, ys, ...) ` ] ( ml_matrics/parity.py ) | [ ` density_hexbin_with_hist(xs, ys, ...) ` ] ( ml_matrics/parity.py ) |
36
+ | ![ density_hexbin] ( https://raw.githubusercontent.com/janosh/ml-matrics/main/ assets/density_hexbin.svg) | ![ density_hexbin_with_hist] ( https://raw.githubusercontent.com/janosh/ml-matrics/main/ assets/density_hexbin_with_hist.svg) |
37
+ | [ ` scatter_with_err_bar(xs, ys, yerr, ...) ` ] ( ml_matrics/parity.py ) | [ ` residual_vs_actual(y_true, y_pred, ...) ` ] ( ml_matrics/parity.py ) |
38
+ | ![ scatter_with_err_bar] ( https://raw.githubusercontent.com/janosh/ml-matrics/main/ assets/scatter_with_err_bar.svg) | ![ residual_vs_actual] ( https://raw.githubusercontent.com/janosh/ml-matrics/main/ assets/residual_vs_actual.svg) |
53
39
54
40
## Elements
55
41
56
42
See [ ` ml_matrics/elements.py ` ] ( ml_matrics/elements.py ) .
57
43
58
- | [ ` ptable_elemental_prevalence(compositions) ` ] ( ml_matrics/elements.py ) | [ ` ptable_elemental_prevalence(compositions, log=True) ` ] ( ml_matrics/elements.py ) |
59
- | :--------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------: |
60
- | ![ ptable_elemental_prevalence] ( assets/ptable_elemental_prevalence.svg ) | ![ ptable_elemental_prevalence_log] ( assets/ptable_elemental_prevalence_log.svg ) |
61
- | [ ` hist_elemental_prevalence(compositions) ` ] ( ml_matrics/elements.py ) | [ ` hist_elemental_prevalence(compositions, log=True, bar_values='count') ` ] ( ml_matrics/elements.py ) |
62
- | ![ hist_elemental_prevalence] ( assets/hist_elemental_prevalence.svg ) | ![ hist_elemental_prevalence_log_count] ( assets/hist_elemental_prevalence_log_count.svg ) |
63
- | [ ` ptable_elemental_ratio(comps_a, comps_b) ` ] ( ml_matrics/elements.py ) | [ ` ptable_elemental_ratio(comps_b, comps_a, log=True) ` ] ( ml_matrics/elements.py ) |
64
- | ![ ptable_elemental_ratio] ( assets/ptable_elemental_ratio.svg ) | ![ ptable_elemental_ratio_log] ( assets/ptable_elemental_ratio_log.svg ) |
44
+ | [ ` ptable_elemental_prevalence(compositions) ` ] ( ml_matrics/elements.py ) | [ ` ptable_elemental_prevalence(compositions, log=True) ` ] ( ml_matrics/elements.py ) |
45
+ | :----------------------------------------------------------------------------------------------------------------------------- : | :---------------------------------------------- -----------------------------------------------------------------------------------------------: |
46
+ | ![ ptable_elemental_prevalence] ( https://raw.githubusercontent.com/janosh/ml-matrics/main/ assets/ptable_elemental_prevalence.svg) | ![ ptable_elemental_prevalence_log] ( https://raw.githubusercontent.com/janosh/ml-matrics/main/ assets/ptable_elemental_prevalence_log.svg) |
47
+ | [ ` hist_elemental_prevalence(compositions) ` ] ( ml_matrics/elements.py ) | [ ` hist_elemental_prevalence(compositions, log=True, bar_values='count') ` ] ( ml_matrics/elements.py ) |
48
+ | ![ hist_elemental_prevalence] ( https://raw.githubusercontent.com/janosh/ml-matrics/main/ assets/hist_elemental_prevalence.svg) | ![ hist_elemental_prevalence_log_count] ( https://raw.githubusercontent.com/janosh/ml-matrics/main/ assets/hist_elemental_prevalence_log_count.svg) |
49
+ | [ ` ptable_elemental_ratio(comps_a, comps_b) ` ] ( ml_matrics/elements.py ) | [ ` ptable_elemental_ratio(comps_b, comps_a, log=True) ` ] ( ml_matrics/elements.py ) |
50
+ | ![ ptable_elemental_ratio] ( https://raw.githubusercontent.com/janosh/ml-matrics/main/ assets/ptable_elemental_ratio.svg) | ![ ptable_elemental_ratio_log] ( https://raw.githubusercontent.com/janosh/ml-matrics/main/ assets/ptable_elemental_ratio_log.svg) |
65
51
66
52
## Uncertainty Calibration
67
53
68
54
See [ ` ml_matrics/quantile.py ` ] ( ml_matrics/quantile.py ) .
69
55
70
- | [ ` qq_gaussian(y_true, y_pred, y_std) ` ] ( ml_matrics/quantile.py ) | [ ` qq_gaussian(y_true, y_pred, y_std: dict) ` ] ( ml_matrics/quantile.py ) |
71
- | :------------------------------------------------------------: | :------------------------------------------------------------------: |
72
- | ![ normal_prob_plot] ( assets/normal_prob_plot.svg ) | ![ normal_prob_plot_multiple] ( assets/normal_prob_plot_multiple.svg ) |
56
+ | [ ` qq_gaussian(y_true, y_pred, y_std) ` ] ( ml_matrics/quantile.py ) | [ ` qq_gaussian(y_true, y_pred, y_std: dict) ` ] ( ml_matrics/quantile.py ) |
57
+ | :------------------------------------------------------------------------------------------------------- : | :------------------------------------------------------- ------------------------------------------------------------------: |
58
+ | ![ normal_prob_plot] ( https://raw.githubusercontent.com/janosh/ml-matrics/main/ assets/normal_prob_plot.svg) | ![ normal_prob_plot_multiple] ( https://raw.githubusercontent.com/janosh/ml-matrics/main/ assets/normal_prob_plot_multiple.svg) |
73
59
74
60
## Ranking
75
61
76
62
See [ ` ml_matrics/ranking.py ` ] ( ml_matrics/ranking.py ) .
77
63
78
- | [ ` err_decay(y_true, y_pred, y_std) ` ] ( ml_matrics/ranking.py ) | [ ` err_decay(y_true, y_pred, y_std: dict) ` ] ( ml_matrics/ranking.py ) |
79
- | :---------------------------------------------------------: | :---------------------------------------------------------------: |
80
- | ![ err_decay] ( assets/err_decay.svg ) | ![ err_decay_multiple] ( assets/err_decay_multiple.svg ) |
64
+ | [ ` err_decay(y_true, y_pred, y_std) ` ] ( ml_matrics/ranking.py ) | [ ` err_decay(y_true, y_pred, y_std: dict) ` ] ( ml_matrics/ranking.py ) |
65
+ | :----------------------------------------------------------------------------------------- : | :-------------------------------------------- ---------------------------------------------------------------: |
66
+ | ![ err_decay] ( https://raw.githubusercontent.com/janosh/ml-matrics/main/ assets/err_decay.svg) | ![ err_decay_multiple] ( https://raw.githubusercontent.com/janosh/ml-matrics/main/ assets/err_decay_multiple.svg) |
81
67
82
68
## Cumulative Error and Residual
83
69
84
70
See [ ` ml_matrics/cumulative.py ` ] ( ml_matrics/cumulative.py ) .
85
71
86
- | [ ` cum_err(preds, targets) ` ] ( ml_matrics/cumulative.py ) | [ ` cum_res(preds, targets) ` ] ( ml_matrics/cumulative.py ) |
87
- | :---------------------------------------------------: | :----------------------------------------------------: |
88
- | ![ cumulative_error] ( assets/cumulative_error.svg ) | ![ cumulative_residual] ( assets/cumulative_residual.svg ) |
72
+ | [ ` cum_err(preds, targets) ` ] ( ml_matrics/cumulative.py ) | [ ` cum_res(preds, targets) ` ] ( ml_matrics/cumulative.py ) |
73
+ | :------------------------------------------------------------------------------------------------------- : | :--------------------------------------------------------- ----------------------------------------------------: |
74
+ | ![ cumulative_error] ( https://raw.githubusercontent.com/janosh/ml-matrics/main/ assets/cumulative_error.svg) | ![ cumulative_residual] ( https://raw.githubusercontent.com/janosh/ml-matrics/main/ assets/cumulative_residual.svg) |
89
75
90
76
## Classification Metrics
91
77
92
78
See [ ` ml_matrics/relevance.py ` ] ( ml_matrics/relevance.py ) .
93
79
94
- | [ ` roc_curve(targets, proba_pos) ` ] ( ml_matrics/relevance.py ) | [ ` precision_recall_curve(targets, proba_pos) ` ] ( ml_matrics/relevance.py ) |
95
- | :--------------------------------------------------------: | :---------------------------------------------------------------------: |
96
- | ![ roc_curve] ( assets/roc_curve.svg ) | ![ precision_recall_curve] ( assets/precision_recall_curve.svg ) |
80
+ | [ ` roc_curve(targets, proba_pos) ` ] ( ml_matrics/relevance.py ) | [ ` precision_recall_curve(targets, proba_pos) ` ] ( ml_matrics/relevance.py ) |
81
+ | :----------------------------------------------------------------------------------------- : | :---------------------------------------------- ---------------------------------------------------------------------: |
82
+ | ![ roc_curve] ( https://raw.githubusercontent.com/janosh/ml-matrics/main/ assets/roc_curve.svg) | ![ precision_recall_curve] ( https://raw.githubusercontent.com/janosh/ml-matrics/main/ assets/precision_recall_curve.svg) |
97
83
98
84
## Correlation
99
85
100
86
See [ ` ml_matrics/correlation.py ` ] ( ml_matrics/correlation.py ) .
101
87
102
- | [ ` marchenko_pastur(corr_mat, gamma=ncols/nrows) ` ] ( ml_matrics/correlation.py ) | [ ` marchenko_pastur(corr_mat_significant_eval, gamma=ncols/nrows) ` ] ( ml_matrics/correlation.py ) |
103
- | :--------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------: |
104
- | ![ marchenko_pastur] ( assets/marchenko_pastur.svg ) | ![ marchenko_pastur_significant_eval] ( assets/marchenko_pastur_significant_eval.svg ) |
88
+ | [ ` marchenko_pastur(corr_mat, gamma=ncols/nrows) ` ] ( ml_matrics/correlation.py ) | [ ` marchenko_pastur(corr_mat_significant_eval, gamma=ncols/nrows) ` ] ( ml_matrics/correlation.py ) |
89
+ | :------------------------------------------------------------------------------------------------------- : | :---------------------------------------------- -------------------------------------------------------------------------------------------: |
90
+ | ![ marchenko_pastur] ( https://raw.githubusercontent.com/janosh/ml-matrics/main/ assets/marchenko_pastur.svg) | ![ marchenko_pastur_significant_eval] ( https://raw.githubusercontent.com/janosh/ml-matrics/main/ assets/marchenko_pastur_significant_eval.svg) |
105
91
106
92
## Histograms
107
93
108
94
See [ ` ml_matrics/histograms.py ` ] ( ml_matrics/histograms.py ) .
109
95
110
- | [ ` residual_hist(y_true, y_pred) ` ] ( ml_matrics/histograms.py ) | [ ` true_pred_hist(y_true, y_pred, y_std) ` ] ( ml_matrics/histograms.py ) |
111
- | :-----------------------------------------------------------: | :-----------------------------------------------------------------: |
112
- | ![ residual_hist] ( assets/residual_hist.svg ) | ![ true_pred_hist] ( assets/true_pred_hist.svg ) |
113
- | [ ` spacegroup_hist(y_true, y_pred) ` ] ( ml_matrics/histograms.py ) | |
114
- | ![ spacegroup_hist] ( assets/spacegroup_hist.svg ) | |
96
+ | [ ` residual_hist(y_true, y_pred) ` ] ( ml_matrics/histograms.py ) | [ ` true_pred_hist(y_true, y_pred, y_std) ` ] ( ml_matrics/histograms.py ) |
97
+ | :----------------------------------------------------------------------------------------------------- : | :---------------------------------- -----------------------------------------------------------------: |
98
+ | ![ residual_hist] ( https://raw.githubusercontent.com/janosh/ml-matrics/main/ assets/residual_hist.svg) | ![ true_pred_hist] ( https://raw.githubusercontent.com/janosh/ml-matrics/main/ assets/true_pred_hist.svg) |
99
+ | [ ` spacegroup_hist(y_true, y_pred) ` ] ( ml_matrics/histograms.py ) | |
100
+ | ![ spacegroup_hist] ( https://raw.githubusercontent.com/janosh/ml-matrics/main/ assets/spacegroup_hist.svg) | |
115
101
116
102
## Adding Assets
117
103
0 commit comments