This module for Node-RED contains a set of nodes which offer machine learning functionalities. Such nodes have a python core that takes advantage of common ML libraries such as SciKit-Learn and Tensorflow. Classification and outlier detection can be performed through the use of this package.
Be sure to have a working installation of Node-RED.
Install python and the following libraries:
- Python 3.6.4 or higher accessible by the command 'python' (on linux 'python3')
- Tensorflow (optional: can be skipped)
To install the latest version use the Menu - Manage palette option and search for node-red-contrib-machine-learning, or run the following command in your Node-RED user directory (typically ~/.node-red):
npm i node-red-contrib-machine-learning
These flows create a dataset, train a model and then evaluate it. Models, after training, can be use in real scenarios to make predictions.
Flows and test datasets are available in the 'test' folder. Make sure that the paths specified inside nodes' configurations are correct before trying to execute the program.
Tip: you can run 'node-red' (or 'sudo node-red' if you are uning linux) from the folder '.node-red/node-modules/node-red-contrib-machine-learning' and the paths will be automatically correct.
This flow loads a csv file, shuffles it and creates a trainig and a test partition.
This flow loads a training partition and trains a 'decision tree classifier', saving the model locally.
This flow loads a test partition and evaluates a previously trained model.
This flow shows how to use a trained model during deploymnet. Data is received via mqtt, predictions are made and then sent back.
Example flows available here: