This package is part of the Pharo AI project: It contains implementations, tests and documentation of different metrics for Machine Learning models. The evaluation metrics allows to assess how a trained Machine Learning model has performed.
For more information please refer to the wiki: https://github.com/pharo-ai/wiki/blob/master/wiki/DataExploration/Metrics.md
There is explained with more detail the available metrics and how to use them.
EpMonitor disableDuring: [
Metacello new
baseline: 'AIMetrics';
repository: 'github://pharo-ai/metrics';
load ]
spec
baseline: 'AIMetrics'
with: [ spec repository: 'github://pharo-ai/metrics' ].
Types of metrics:
- Clustering metrics
- Regression metrics
- Classification metrics
| yTrue yPredicted metric |
metric := AIMeanSquaredError new.
yTrue := #( 3 -0.5 2 7 ).
yPredicted := #( 2.5 0.0 2 8 ).
metric computeForActual: yTrue predicted: yPredicted "0.375"
| yTrue yPredicted metric |
metric := AIAccuracyScore new.
yTrue := #( 0 1 2 3 ).
yPredicted := #( 0 2 1 3 ).
metric computeForActual: yTrue predicted: yPredicted "0.5"