pharo-ai / metrics

Implementation of Machine Learning metrics for Pharo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build status Coverage Status Pharo version Pharo version Pharo version Pharo version License

Description

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.

How to install it

EpMonitor disableDuring: [ 
   Metacello new
      baseline: 'AIMetrics';
      repository: 'github://pharo-ai/metrics';
      load ]

How to depend on it

spec 
   baseline: 'AIMetrics' 
   with: [ spec repository: 'github://pharo-ai/metrics' ].

Types of metrics:

  • Clustering metrics
  • Regression metrics
  • Classification metrics

Example: Mean Squared Error (AIMeanSquaredError)

| 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"

Example: Accuracy Score (AIAccuracyScore)

| yTrue yPredicted metric |
metric := AIAccuracyScore new.
yTrue := #( 0 1 2 3 ).
yPredicted := #( 0 2 1 3 ).
metric computeForActual: yTrue predicted: yPredicted "0.5"

About

Implementation of Machine Learning metrics for Pharo

License:MIT License


Languages

Language:Smalltalk 88.9%Language:StringTemplate 11.1%