Giter VIP home page Giter VIP logo

jsmlt's Introduction

JSMLT

npm npm GitHub stars

JSMLT

The JavaScript Machine Learning Toolkit, or JSMLT, is an open source JavaScript library for education in machine learning. It implements several well-known supervised learning algorithms in an understandable, modular and well-commented way. Furthermore, visualization examples are provided which allow you to explore the way different machine learning algorithms work. Ultimately, JSMLT is intended to provide students with a better learning experience when studying machine learning algorithms.

If you want to explore a visualization of the machine learning algorithms in JSMLT, check out visualml.io. It provides an interactive environment for using JSMLT's algorithms.

Getting started

This short guide will help you get started with JSMLT.

Installation

We're assuming you've got Node.js and npm installed. If you haven't, you should: download and install it from nodejs.org.

To install JSMLT into your npm project via npm, run

npm install @jsmlt/jsmlt

A simple example

In this small example, we're going to train an SVM on a small example dataset. The code example below starts with loading JSMLT, creating some dummy training and test data, and running an SVM classifier on it. It's pretty simple!

If you want to run this example without having to set up anything by yourself, check out the JSMLT examples repository. It includes the example below, and requires no further setup: it's ready to run!

// Import JSMLT library
var jsmlt = require('@jsmlt/jsmlt');

// Training data
train_X = [[-1,-1], [-1,1], [1,1], [1,-1]];
train_y = [0, 0, 1, 1];

// Testing data
test_X = [[1,2], [1,-2], [-1,-2], [-1,2]];

// Create and train classifier
var clf = new jsmlt.Supervised.SVM.SVM({
  kernel: new jsmlt.Kernel.Linear(),
});
clf.train(train_X, train_y);

// Make predictions on test data
console.log(clf.predict(test_X));

Running this simple example will output the classification result [1,1,0,0], meaning it classified the first two points as 0, and the second two points as 1.

API

The entire API documentation can be found here. You can also build the documentation locally by downloading and installing JSMLT and running npm run-script build-documentation: the documentation will then be available in the docs folder.

Supervised learning algorithms (classifiers)

Unsupervised learning algorithms (clustering)

Kernels

Preprocessing

Model selection

Datasets

Validation

Classification boundaries

Development

JSMLT is maintained by Jesper van Engelen, and is in active development. It is currently not ready to be used in any production environments.

jsmlt's People

Contributors

engelen avatar

Watchers

 avatar

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.