Machine Learning in JavaScript - Sisense · PDF fileMachine Learning with JavaScript Boaz...

19
Machine Learning with JavaScript Boaz Farkash Director of Product Management @ Sisense

Transcript of Machine Learning in JavaScript - Sisense · PDF fileMachine Learning with JavaScript Boaz...

Page 1: Machine Learning in JavaScript - Sisense · PDF fileMachine Learning with JavaScript Boaz Farkash Director of Product Management @ Sisense. Agenda •Why I am interested in this? •Why

Machine Learningwith JavaScript

Boaz FarkashDirector of Product Management @ Sisense

Page 2: Machine Learning in JavaScript - Sisense · PDF fileMachine Learning with JavaScript Boaz Farkash Director of Product Management @ Sisense. Agenda •Why I am interested in this? •Why

Agenda

• Why I am interested in this?

• Why you should be interested in this

• What is ML?

• Why JS developers should tackle ML

• Examples

• Other ML JS Libraries

• What’s next for you?

Page 3: Machine Learning in JavaScript - Sisense · PDF fileMachine Learning with JavaScript Boaz Farkash Director of Product Management @ Sisense. Agenda •Why I am interested in this? •Why

Why am I interested in this?

• I work here:

• Javascript Background

• Worked on R integration with BI

• Backend vs Frontend – Who has the right to attempt ML?

Page 4: Machine Learning in JavaScript - Sisense · PDF fileMachine Learning with JavaScript Boaz Farkash Director of Product Management @ Sisense. Agenda •Why I am interested in this? •Why

Why JS developers should tackle ML

• Why not?

• JS developers are very practical

• Unlike data scientists

• More practical than backend developers

• When something is possible with Javascript, the path to making it accessible to end-users is the shortest.

• JS developers are becoming full-stack developers

Page 5: Machine Learning in JavaScript - Sisense · PDF fileMachine Learning with JavaScript Boaz Farkash Director of Product Management @ Sisense. Agenda •Why I am interested in this? •Why

Why JS developers should tackle ML

ML with JS is

not slow!

Page 6: Machine Learning in JavaScript - Sisense · PDF fileMachine Learning with JavaScript Boaz Farkash Director of Product Management @ Sisense. Agenda •Why I am interested in this? •Why

Why JS developers should tackle ML

• ML with JS is not slower than R/Python

• NodeJS

• Webworkers

• C/C++ where speed is crucial

• JS keeps evolving rapidly

• More adoption

• WebAssembly on the horizon

Page 7: Machine Learning in JavaScript - Sisense · PDF fileMachine Learning with JavaScript Boaz Farkash Director of Product Management @ Sisense. Agenda •Why I am interested in this? •Why

WebAssembly Expected Improvements

• Full threading support

• SIMD types and intrinsics

• Zero-cost exceptions

• Coroutines

• Dynamic linking

• DOM integration

• Integrated garbage collection

• Tail-call optimization

• Multi-process support

• Started by Mozilla developers

• Became joint effort between Google, Microsoft, Mozilla

& Apple

• The bytecode of the web

• Drastically faster

• Will complement JS with capabilities it doesn’t have and

don’t play well with JS semantics

• Web developers will tackler even more complex

problems, like ML

Page 8: Machine Learning in JavaScript - Sisense · PDF fileMachine Learning with JavaScript Boaz Farkash Director of Product Management @ Sisense. Agenda •Why I am interested in this? •Why

Example #1

• Created by Heather Arthur (harthur on Github)

• Should I bother?

Page 9: Machine Learning in JavaScript - Sisense · PDF fileMachine Learning with JavaScript Boaz Farkash Director of Product Management @ Sisense. Agenda •Why I am interested in this? •Why

Neural Networks with “brain”

Page 10: Machine Learning in JavaScript - Sisense · PDF fileMachine Learning with JavaScript Boaz Farkash Director of Product Management @ Sisense. Agenda •Why I am interested in this? •Why

Choosing the right input

PixelsvsEdges

Page 11: Machine Learning in JavaScript - Sisense · PDF fileMachine Learning with JavaScript Boaz Farkash Director of Product Management @ Sisense. Agenda •Why I am interested in this? •Why

Train a 1000 cats

Page 12: Machine Learning in JavaScript - Sisense · PDF fileMachine Learning with JavaScript Boaz Farkash Director of Product Management @ Sisense. Agenda •Why I am interested in this? •Why

Identify new cats

Page 13: Machine Learning in JavaScript - Sisense · PDF fileMachine Learning with JavaScript Boaz Farkash Director of Product Management @ Sisense. Agenda •Why I am interested in this? •Why

See it

Page 14: Machine Learning in JavaScript - Sisense · PDF fileMachine Learning with JavaScript Boaz Farkash Director of Product Management @ Sisense. Agenda •Why I am interested in this? •Why

Example #2

• Created by Amir Arad

• Should I swim?

Page 15: Machine Learning in JavaScript - Sisense · PDF fileMachine Learning with JavaScript Boaz Farkash Director of Product Management @ Sisense. Agenda •Why I am interested in this? •Why

Train 6000 sharks

http://www.sharkattackfile.net/incidentlog.htm

Page 16: Machine Learning in JavaScript - Sisense · PDF fileMachine Learning with JavaScript Boaz Farkash Director of Product Management @ Sisense. Agenda •Why I am interested in this? •Why

Consider going for a swim

A youngAmericanFemaleSurfer Has this chance to survive:0.6759295781730543A oldAustralianMaleSurfer Has this chance to survive:0.3966031586730335A youngIndianFemaleSwimmer Has this chance to survive:0.6760293212564229A youngAustralianMaleBoater Has this chance to survive:0.3945805472407228

Page 17: Machine Learning in JavaScript - Sisense · PDF fileMachine Learning with JavaScript Boaz Farkash Director of Product Management @ Sisense. Agenda •Why I am interested in this? •Why

Other ML JS Libraries

• machine_learning• Logistic Regression• MLP (Multi-Layer Perceptron)• SVM (Support Vector Machine)• KNN (K-nearest neighbors)• K-means clustering• 3 Optimization Algorithms (Hill-Climbing,

Simulated Annealing, Genetic Algorithm)• Decision Tree• NMF (non-negative matrix factorization)

• Clusterfck - K-Means & Hierarchical

Clustering

• limdu.js• Multi-label classification

• Online learning

• Real-time classification

• forestjs – Random forrest

• Dclassify - Naïve Bayes

• convnetjs - convolutional neural networks

• linearReg.js – Linear regression

• SVMjs

Page 18: Machine Learning in JavaScript - Sisense · PDF fileMachine Learning with JavaScript Boaz Farkash Director of Product Management @ Sisense. Agenda •Why I am interested in this? •Why

What’s next for you?

• If you work with / employ data scientists

• Tie the bond between Data Scientists & JS developers

• Data scientists should empower JS developers by helping them implement ML algorithms in JS.

• It is in the Data Scientists interest that JS developers can work on ML applications, while they work on ML research.

• If you are a JS developer just getting started with ML

• Do not be afraid not to learn R/Python

• Leverage existing libraries and contribute

Page 19: Machine Learning in JavaScript - Sisense · PDF fileMachine Learning with JavaScript Boaz Farkash Director of Product Management @ Sisense. Agenda •Why I am interested in this? •Why

Thank You