Let’s briefly define Machine Learning before we move on to the fun part. Machine Learning from now on referred to as ML) is a branch of Artificial Intelligence (AI) that’s based on the idea that systems can learn from data, analyze and establish patterns, and make decisions based on those findings without the need for or with minimal human intervention and interaction. To have a brief overview of the data science, consider reading DS: Bigger Picture on the blog.
Speaking of languages, ML is usually associated with Python and R.; first of all, because these languages are suitable for non-programmers and there are comprehensive ML libraries available, which make them easy to use. In other cases, ML algorithms are implemented in C, C++, Elixir, Java, .Net, Perl, Ruby, SAS, and Scala. However, since during the past couple of years JS popularity skyrocketed, more and more people have started using JS, creating some awesome JS ML libraries, enabling implementation of ML methods both in the browser and on the backend using Node.js.
Natural Language Processing
Natural is a general natural language facility for Node.js. It currently supports:
- Stemming and sentiment analysis (currently in eight languages)
- Calculation of strings distances and matching similar strings
- Classification (naive Bayes, logistic regression, and maximum entropy)
- Phonetics, tf-idf, WordNet, string similarity, and some inflections
nlp.js is an NLP library built-in node over Natural.
nlp.js is currently able to
- Guess the language from a phrase
- Calculate distance between two strings
- Search the best substring of a string with less Levenshtein distance to a given pattern
- Get stemmers and tokenizers for several languages
Perform a sentiment analysis for phrases (with negation support)
- Support named entity recognition and management, multilanguage, and accepting similar strings
- Supports classification: classifies utterances into intents (Natural Language Processing Classifier)
- Generates an answer from intents and conditions (Natural Language Generation Manager)
- Manages several languages (NLP Manager)
- Supports 29 languages (even fantasy languages)
There is a version of NLP.js that works in React Native, so you can build chatbots that can be trained and executed in the mobile environment without the need for the Internet connection.
Data Analysis / Data Visualization
It makes easy to publish networks on Web pages and allows developers to integrate network exploration in rich Web applications. Suitable for both beginners and advanced users alike.
- The default configuration deals with mouse and touch support, refreshes and rescales when the container changes and renders on WebGL (provided a browser supports it) and Canvas.
- Easily customizable settings allowing users to add their own functions to render nodes and edges however they like it.
- Public API makes it possible to modify data, move the camera, refresh the rendering, listen to events and add different degrees of interactivity.
One representative example: https://bl.ocks.org/mbostock/raw/3231298/
Nivo is built on top of the awesome d3 and Reactjs libraries.
Nivo is all about React components built on top of d3 that help build DataViz apps with ease.
- Motion/transitions, powered by react-motion
- Isomorphic rendering
- Component playground
- Good supporting documentation
- SVG charts, HTML charts, Canvas charts
- Server-side rendering API
- SVG patterns
- Responsive charts
General-Purpose Machine Learning
brain.js is focused on training and applying feedforward and recurrent neural networks. It also provides such advanced options as using GPU to train networks, asynchronous training that can fit multiple networks in parallel, and cross-validation, a more sophisticated validation method. brain.js saves and loads models to/from JSON files.
A fun and practical 19-part course on Brain.js can be found here.
Ml.js is machine learning and numerical analysis tools for Node.js and the Browser.
Ml.js is a comprehensive general-purpose Machine Learning library written in JS. The library itself is a compilation of the tools developed in the mljs organization. Although it’s primarily written for use in the browser, you may add your own dependencies to use in Node.js as well: those are labeled with ml-, so — pretty easy to find. The library supports the following routines: bit operations on arrays, sorting, hash tables, random number generation; linear algebra, array manipulation, optimization, statistics; cross-validation, supervised and unsupervised learning.
ml.js supports the following unsupervised learning methods: principal component analysis, hierarchical clustering, and K-means clustering.
Among the supervised learning you’ll find the following methods:
- Naive Bayes
- K-Nearest Neighbor (KNN)
- Confusion matrix
- Decision tree classifier
- Random forest classifier, among others
- Supported AI networks are Feedforward Neural Networks and Kohonen networks
If you want to learn more about this library, then this is a great video to start with: