stdlib

Real-Time Machine Learning in JavaScript

stdlib
Athan Reines | @kgryte | @stdlibjs

Overview

     
  1. Intro
  2. Motivation
  3. JavaScript
  4. Examples
  5. Tips and Tricks
  6. Conclusions

Machine Learning

Models

$$y = a_nx_n + a_{n-1}x_{n-1} + \cdots + a_0x_0 + b$$

What will be the temperature tomorrow?

$$t_n = t_{n-1}$$

$$t_n = \frac{1}{7} \sum_{i=n-7}^{n-1} t_i$$

$$t_n = \frac{1}{W} \sum_{i=n-W}^{n-1} t_i$$

Training Algorithms

  • Batch: build a model from a "batch" of data
  • Incremental: continuously update a model as data arrives
  • Mini-batch: hybrid of batch and incremental training.

Real-Time Machine Learning

Why incremental algorithms?

  • Privacy
  • Low latency
  • Offline
  • Power efficient
  • Direct access to sensor data

Example Data Streams

  • Mouse/cursor movements
  • Scrolling
  • Clicks
  • Sensors
  • Monitoring

Use Cases

  • Forecasting
  • Anomalies
  • Clustering

Why JavaScript?

Myths

  • Performance
  • Incompatibility

Examples

Anomaly Detection

Clustering

Regression

Classification

Tips and Tricks

  • Simulation
  • Exploratory Data Analysis
  • Data Structures
    • ndarray
    • circular buffers
    • trees
  • Algorithms

Conclusions

     
  • JavaScript
  • Data Structures
  • Algorithms

Thank you!

stdlib

https://github.com/stdlib-js/stdlib
https://www.patreon.com/athan

Appendix






















				

The End