Giter Site home page Giter Site logo

pharo-ai / metrics Goto Github PK

View Code? Open in Web Editor NEW
2.0 5.0 0.0 92 KB

Implementation of Machine Learning metrics for Pharo

License: MIT License

Smalltalk 88.88% StringTemplate 11.12%
pharo pharo-smalltalk machine-learning randindex adjusted-rand-index fowlkes-mallow jaccard

metrics's Introduction

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"

metrics's People

Contributors

ducasse avatar jecisc avatar jordanmontt avatar olekscode avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

metrics's Issues

Why Array defines sumMatrix

sumMatrix
"Answer an with the sum of all the receiver's vectors"

^ self sum sum

should not be in PMVector?

initializeWithClusterA: firstCluster clusterB: secondCluster assertion logic

initializeWithClusterA: firstCluster clusterB: secondCluster
	"Private - Initialize the receiver"

	super initializeWithClusterA: firstCluster clusterB: secondCluster.
	self assert: [ firstCluster size = secondCluster size ].

why not

initializeWithClusterA: firstCluster clusterB: secondCluster
	"Private - Initialize the receiver"

        self assert: [ firstCluster size = secondCluster size ].
	super initializeWithClusterA: firstCluster clusterB: secondCluster.

buildMatrix

buildMatrix: aCollection
	"Answer a <Collection> of points that are in the same vs different groups.
	Different groups are 1, same groups are 0"

	^ aCollection collect: [ :index | 
		(index - aCollection) abs 
			collect: [ :each | each min: 1 ] ]

I do not get this code what means index - aCollection ? this code totally confuses me.
So we should add a comment about this implementation

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.