AI

8 Machine Learning Javascript Frameworks to Explore

Javascript developers tend to look out for Javascript frameworks which can be used to train machine learning models based on different machine learning algorithms. The following are some of the machine learning algorithms using which models can be trained using different javascript frameworks listed in this article:

  • Simple linear regression
  • Multi-variate linrear regression
  • Logistic regression
  • Naive-bayesian
  • K-nearest neighbour (KNN)
  • K-means
  • Support vector machine (SVM)
  • Random forest
  • Decision tree
  • Feedforward neural network
  • Deep learning network

In this post, you will learn about different Javascsript framework for machine learning. They are some of the following:

DeepLearn.js

Deeplearn.js is an open-source machine learning Javascript library by Google which can be used for different purpose such as as training neural networks in browser, understanding ML models, for education purpose etc. You can run pre-trained models in inference mode. One can write the code in Typescript (ES6 Javascript) or ES5 Javascript. One can get started very quickly by including following code within head tag in HTML file and write JS programs for building the model.

<script src="https://cdn.jsdelivr.net/npm/deeplearn@latest"></script>
<!-- or -->
<script src="https://unpkg.com/deeplearn@latest"></script>

PropelJS

Propel, a Javascrupt library, provides a GPU-backed numpy-like infrastructure for scientific computing. It could be used for both, NodeJS app as well as in browser. The following is the setup code for browser:

<script src="https://unpkg.com/propel@3.1.0"></script>

The following code can be used for NodeJS app:

npm install propel
import { grad } from "propel";

Here is the documentation for PropelJS (Propel Doc). Here is the Github page for Propel

ML-JS

ML-JS provides machine learning tools for working with NodeJS and browser. The ML JS tool can be setup using following code:

<script src="https://www.lactame.com/lib/ml/2.2.0/ml.min.js"></script>

The following machine learning algorithms are supported:

ConvNetJS

ConvNetJS is a Javascript library for training Deep Learning models (Neural Networks) entirely in your browser. This library can also be used in NodeJS app.

In order to get started, get the minified version of ConvNetJS from this page, ConvNetJS minified library. This is a release page for ConvNetJS.

<script src="convnet-min.js"></script>

The following are some important pages:

KerasJS

With KerasJS, you can run Keras models in the browser, with GPU support using WebGL. Models can also be run in Node.js, but only in CPU mode. Here is the Github page on Keras. The following is the list of Keras models which can be run in the browser:

  • Basic Convnet for MNIST
  • Convolutional Variational Autoencoder, trained on MNIST
  • Auxiliary Classifier Generative Adversarial Networks (AC-GAN) on MNIST
  • 50-layer Residual Network, trained on ImageNet
  • Inception v3, trained on ImageNet
  • DenseNet-121, trained on ImageNet
  • SqueezeNet v1.1, trained on ImageNet
  • Bidirectional LSTM for IMDB sentiment classification

STDLib

STDLib is a Javascript library which can be used to build advanced statistical models and machine learning libraries. It can also be used for plotting and graphics functionality for data visualization and exploratory data analysis.

The following is a list of libraries in relation to ML:

  • Linear regression via Stochastic gradient descent (@stdlib/ml/online-sgd-regression)
  • Binary classification via Stochastic gradient descent (@stdlib/ml/online-binary-classification)
  • Natural language processing (@stdlib/nlp)

Limdu.js

Limdu.js is a machine-learning framework for Node.js. It supports some of the following:

  • Binary classification
  • Multi-label classification
  • Feature engineering
  • SVM

One can go about installing limdu.js using following command:

npm install limdu

Brain.js

Brain.js is a set of Javascript libraries for training neural networks and Naive-bayesian classifier. The following can be used to setup Brain.js:

npm install brain.js

One can also include the library in browser using the following code:

<script src="https://raw.githubusercontent.com/harthur-org/brain.js/master/browser.js"></script>

The following can be used to install Naive-bayesian classifier:

npm install classifier

Summary

In this post, you learned about different Javascript library which can be used for training machine learning models in Browser or Nodejs app. For articles on machine learning, we recommend you check out our machine learning archives.

Did you find this article useful? Do you have any questions or suggestions about this article in relation to Javascript frameworks for machine learning? Leave a comment and ask your questions and I shall do my best to address your queries.

Ajitesh Kumar

I have been recently working in the area of Data analytics including Data Science and Machine Learning / Deep Learning. I am also passionate about different technologies including programming languages such as Java/JEE, Javascript, Python, R, Julia, etc, and technologies such as Blockchain, mobile computing, cloud-native technologies, application security, cloud computing platforms, big data, etc. I would love to connect with you on Linkedin. Check out my latest book titled as First Principles Thinking: Building winning products using first principles thinking.

Recent Posts

Agentic Reasoning Design Patterns in AI: Examples

In recent years, artificial intelligence (AI) has evolved to include more sophisticated and capable agents,…

1 month ago

LLMs for Adaptive Learning & Personalized Education

Adaptive learning helps in tailoring learning experiences to fit the unique needs of each student.…

1 month ago

Sparse Mixture of Experts (MoE) Models: Examples

With the increasing demand for more powerful machine learning (ML) systems that can handle diverse…

2 months ago

Anxiety Disorder Detection & Machine Learning Techniques

Anxiety is a common mental health condition that affects millions of people around the world.…

2 months ago

Confounder Features & Machine Learning Models: Examples

In machine learning, confounder features or variables can significantly affect the accuracy and validity of…

2 months ago

Credit Card Fraud Detection & Machine Learning

Last updated: 26 Sept, 2024 Credit card fraud detection is a major concern for credit…

2 months ago