Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

3 watching

Forks

Latest commit

 

History

41 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Linear Models

Build status Coverage Status License

support-vector-machines

How to install it?

To install support vector machines, go to the Playground (Ctrl+OW) in your Pharo image and execute the following Metacello script (select it and press Do-it button or Ctrl+D):

Metacello new
  baseline: 'AISupportVectorMachines';
  repository: 'github://pharo-ai/support-vector-machines/src';
  load.

How to depend on it?

If you want to add a dependency on support vector machines to your project, include the following lines into your baseline method:

spec
  baseline: 'AISupportVectorMachines'
  with: [ spec repository: 'github://pharo-ai/support-vector-machines/src' ].

If you are new to baselines and Metacello, check out the Baselines tutorial on Pharo Wiki.

How to use it?

Here's an example of how to use soft margin SVM. For that, open a Playground (CMD+OW) in your Pharo image and execute this code (CMD+A) and then (CMD+PP)

inputMatrix :=#( #( 1 0 0 ) #( 1 1 1 ) #( 1 3 3 ) #( 1 4 4 ) ).
outputVector := #( 1 1 -1 -1 ).

model := AISupportVectorMachines new.
model regularizationStrenght: 10000.
model learningRate: 1e-6.
model maxEpochs: 5000.

model fitX: inputMatrix y: outputVector.

testInput := #( #( 1 -1 -1 ) #( 1 5 5 ) #( 1 6 6 ) #( 1 7 7 ) ).

model predict: testInput  "#(1 -1 -1 -1)"

To understand this example and the soft margin svm in general please refer to our Wiki.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages