Machine Learning library for the web and Node.
Branch: master
Clone or download
Latest commit 98f00c3 Jan 28, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs chore: preprending options. to enum reflection.reference pattern Jan 14, 2019
src/lib chore: adding 2d matrix minmax scaling in index.repl.ts Jan 28, 2019
test chore: fixing the tests Jan 28, 2019
.appveyor.yml chore: removing no optional from yarn install in appveyor config Jan 5, 2019
.dockerignore Enhance/doc processor unit tests (#140) Nov 25, 2018
.gitignore feature: deployment strategy using release-it Jul 29, 2018
.npmignore Initial commit Apr 29, 2018
.prettierignore Initial commit Apr 29, 2018
.prettierrc feature/prettier-update: Jul 7, 2018 doc: udpating the release note for 2.0.2 Jan 28, 2019 refactor: contribution and docs config Jan 5, 2019
Dockerfile 🐳 Updating yarn inside docker by updating base image from node:8.9.4 … Oct 5, 2018
LICENSE refactor: few files in the root dir, kalimdor to machinelearn Jan 5, 2019 doc: adding the zenhub badge Jan 19, 2019 chore: updating ROADMAP's last updated date Jan 12, 2019
package.json Release 2.0.2 Jan 28, 2019
tdconfig.json Enhance/v2 sgd regressor classifier (#119) Oct 31, 2018
tsconfig.json Enhance/v2 sgd regressor classifier (#119) Oct 31, 2018
tsconfig.module.json feature: deployment strategy using release-it Jul 29, 2018
tslint.json chore: resetting tslint.json Jan 5, 2019
yarn.lock chore: removing tfjs-node and tfjs-node-gpu Jan 1, 2019


machinelearn.js is a Machine Learning library written in Typescript. It solves Machine Learning problems and teaches users how Machine Learning algorithms work.

Build status FOSSA Status Slack ZenHub

User Installation

Using yarn

$ yarn add machinelearn

Using NPM

$ npm install --save machinelearn


By default, machinelearning.js will use pure Javascript version of tfjs. To enable acceleration through C++ binding or GPU, you must import machinelearn-node for C++ or machinelearn-gpu for GPU.

  1. C++
  • installation
yarn add machinelearn-node
  • activation
import 'machinelearn-node';
  1. GPU
  • installation
yarn add machinelearn-gpu
  • activation
import 'machinelearn-gpu';


  • Machine Learning on the browser and Node.js
  • Learning APIs for users
  • Low entry barrier


We welcome new contributors of all level of experience. The development guide will be added to assist new contributors to easily join the project.

  • You want to participate in a Machine Learning project, which will boost your Machine Learning skills and knowledge
  • Looking to be part of a growing community
  • You want to learn Machine Learning
  • You like Typescript ❤️ Machine Learning


machinelearn.js provides a simple and consistent set of APIs to interact with the models and algorithms. For example, all models have follow APIs:

  • fit for training
  • predict for inferencing
  • toJSON for saving the model's state
  • fromJSON for loading the model from the checkpoint


Testing ensures you that you are currently using the most stable version of machinelearn.js

$ npm run test


Simply give us a 🌟 by clicking on


We simply follow "fork-and-pull" workflow of Github. Please read for more detail.

Further notice

Great references that helped building this project!


Thanks goes to these wonderful people (emoji key):

Jason Shin

📝 🐛 💻 📖 ⚠️


💬 🤔 📢

Oleg Stotsky

🐛 💻 📖 ⚠️


💬 🎨 📢 🐛 💻

Christoph Reinbothe

💻 🤔 🚇 👀

Adam King

💻 ⚠️ 📖