ml-js
Machine Learning library for Node.js
Status : Under development
Installation
ml-js depends on FANN (Fast Artificial Neural Network Library) witch is a free, open source and high performence neural network library.
To build great app with it :
- Make sure you glib2 is installed :
sudo apt-get install glib2.0
- make sure pkg-config is installed :
sudo apt-get install pkg-config
- make sure cmake is installed :
sudo apt-get install cmake
- Install FANN :
- download here
- unzip
- goto to FANN directory
- run
cmake .
andsudo make install
- run
sudo ldconfig
Finally, you should be able to install all npm dependancies with npm install ml-js --save
Supported ML techniques
ml-js currently supports :
- Supervised learning :
- Reinforcement learning :
QLearning
, model-free reinforcement learning technique
- Exploration policies
BoltzmannExploration
Getting started
QLearning Example
Q-learning is a model-free reinforcement learning technique. Specifically, Q-learning can be used to find an optimal action-selection policy for any given MDP.
ml = require 'ml-js' myprocess = qValues = nb_featuresnb_actions options = learning_rate: 0.1 discount_factor: 0.9 exploration_policy: 0.2 # temperature agent = qValuesoptions myprocesson 'do_something' next_action = agentgetAction currentState myprocessdo next_action myprocesson 'feedback_received' agentlearn initStateactionnewStatereward
Availables QValues managers :
CSDAQValues
for Continuous States and Discrete Actions QValues. It uses neural networks to perform learning on continuous states.