npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@jsmlt/jsmlt

v0.1.18

Published

JavaScript Machine Learning

Readme

JSMLT

npm npm GitHub stars

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.