Skip to content

Instantly share code, notes, and snippets.

@amandeepmittal
Created December 16, 2018 12:20
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amandeepmittal/15b15efb8ae9ce1252c69017f61f9ad7 to your computer and use it in GitHub Desktop.
Save amandeepmittal/15b15efb8ae9ce1252c69017f61f9ad7 to your computer and use it in GitHub Desktop.

Top Node.js Libraries and Tools For Machine Learning

JavaScript is evolving with a rapid speed. It has several applications over different use in areas apart from web such as desktop applications, mobile applications, embedded systems and back-end development. If you are in web development as I do, you might be wondering, if you want to choose machine learning, do you have to wander over and spend time learning a new programming language and its steep curve?

Well, JavaScript isn't behind in the domain of machine learning. As a web developer, I think both are wel suited to each other. Rather than concentrating on learning a new language as a web developer, why don't you learn machine learning concepts and apply them with the knowledge you already have, that is, using JavaScript. The workaround you are learn in machine learning can be applied anywhere, regardless of the programming language. In this article, I am going to enlist some of the libraries that can help you get started.

ml.js

This library is a collection of tools developed by the mljs organization. It include a vast list of libraries under different categories such as unsupervised learning, supervised learning, artificial neural networks, regression, optimization, statistics, data processing and math utilities. Most of these libraries that are included in ml.js are tend ot be used in web browser but if you are looking to work with them in Node.js environment, you will find an npm package.

https://github.com/mljs/ml

Brain.js

A library written in JavaScript for neural networks that can be used with Node.js as well as in the browser. You can simply access it and start using it by installing it through npm. Since it is written in JavaScript, it has support for asynchronous to train network data using trainAsync() and support for streams as well.

https://github.com/BrainJS/brain.js

Synaptic

Synaptic is another JavaScript neural network for node.js. It has a few built-in architectures like multilayer perceptrons, multilayer long-short term memory networks (LSTM), liquid state machines or Hopfield networks, and a trainer capable of training different networks. It also works with browser. Check out the example below for predicting a next character in a stream of text based articles from Wikipedia using a long-short term memory.

http://caza.la/synaptic/#/wikipedia

Limdu.js

It is a machine learning framework for Node.js that supports Binary classification, multi-label classification, feature engineering, online learning and real-time classification. It is currently in alpha state and looking for contributors.

https://github.com/erelsgl/limdu

ConvNetJS

This JavaScript implementation of neural networks that is developed by a Stanford University PhD. It currently supports common neural network modules, SVM, regression, and the ability train convolutional networks to process images.

https://github.com/karpathy/convnetjs

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. It support in the form of different libraries such as linear regression, binary classification, and natural language processing.

https://github.com/stdlib-js/stdlib

TensorFlow.js

TensorFlow.js is an open-source hardware-accelerated JavaScript library for training and deploying machine learning models. It is one of the most popular library out there. You can use flexible and easy to pick APIs to build models from scratch using the low-level JavaScript linear algebra library or the high-level layers API. It has vast variety of tutorials and guides listed officially on its website here to get you started. It also provide model converters to run pre-existing TensorFlow models right in the browser or under Node.js.

https://github.com/tensorflow/tfjs

KerasJS

It is similar to Tensorflow.js in many ways. One of the similarities is that Keras has support for high-level APIs that take care of abstraction provided by backend frameworks. Using Keras, models can be trained in any backend and you can even hook Tensorflow for that. To Keras with Node.js, there is one limitation you will have to take care. With Node.js, the models only run in CPU mode.

https://github.com/transcranial/keras-js

NeuroJS

NeuroJS is a JavaScript framework for deep learning. It mainly focuses on reinforcement learning, but can be used for any neural network based task. It contains neat demos to visualize these capabilities, for instance a 2D self-driving car. It also include support for Support for deep-q-networks and actor-critic models.

https://github.com/janhuenermann/neurojs

Mind

Another flexible neural network library for Node.js, it uses matrix implementation to process training data. It does allow you to configure the network topology and use community made plugins. These plugins generally provide a way to configure pre-trained networks that can go straight to making predictions.

https://github.com/stevenmiller888/mind

Natural

Natural is a library that provides tokenzing, stemming, classification, phonetics, tf-idf, WordNet, and string similarity. In other words, this library provide language facilities that you can use a module in Node.js. This is an interesting project with a variety of use cases.

https://github.com/NaturalNode/natural

Compromise

Another natural language processing that is only 230kb minified when used in the browser. This library provides lot of utilities that are basic and effortless, as well as support community made plugins to extend and use pre-configuration that allow adding vocabulary, fixing errors, and setting context quickly.

https://github.com/spencermountain/compromise

Conclusion

JavaScript might be not a go-to programming language for machine learning, but the above article proves that it is not getting behind in the context. I hope, this post prove useful to you as well for learning and using different libraries mentioned in your Node.js application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment