11/14/2016 Machine Learning
http://localhost:3000/#/?export&_k=lv9fld 1/23
11/14/2016 Machine Learning
http://localhost:3000/#/?export&_k=lv9fld 2/23
REAL-TIME MACHINE
LEARNING WITH NODE.JS
PHILIPP BURCKHARDT
Carnegie Mellon University
11/14/2016 Machine Learning
http://localhost:3000/#/?export&_k=lv9fld 3/23
LEARNING
PATTERNS
FROM DATA(iStock)
11/14/2016 Machine Learning
http://localhost:3000/#/?export&_k=lv9fld 4/23
REAL-TIME MACHINE
LEARNING WITH
NODE.JS
11/14/2016 Machine Learning
http://localhost:3000/#/?export&_k=lv9fld 5/23
BATCH
Build model using a batch of available data
INCREMENTAL
Update model as new data comes in
TRAINING ALGORITHMS
11/14/2016 Machine Learning
http://localhost:3000/#/?export&_k=lv9fld 6/23
8. // For each simulated datum, update the
mean...
9. for ( var i = 0; i < 100; i++ ) {
10. var v = randu() * 100.0;
11. accumulator( v );
12. }
13. var mean = accumulator();
14.
15.
4. var incrmean = require(
'@stdlib/math/generics/statistics/incrmean' );
5.
6. var accumulator = incrmean();
7.
16.
17.
Update estimator as new data comes in...
11/14/2016 Machine Learning
http://localhost:3000/#/?export&_k=lv9fld 7/23
Prediction is very di cult,
especially if it's about the
future.
- Nils Bohr
11/14/2016 Machine Learning
http://localhost:3000/#/?export&_k=lv9fld 8/23
INDEPENDENTLY AND
IDENTICALLY
DISTRIBUTED (I.I.D.)
DATA ASSUMED TO BE
Might not hold: e.g., time series are mostly non-stationary
11/14/2016 Machine Learning
http://localhost:3000/#/?export&_k=lv9fld 9/23
8. setInterval( function() {
9. var mem = os.freemem() / os.totalmem();
10. accumulator( mem );
11. var mean = accumulator();
12. }, 1000 );
13.
14.
15.
16.
17.
1. 'use strict';
2.
3. var incrmmean = require(
'@stdlib/math/generics/statistics/incrmmean' );
4. var os = require( 'os' );
5.
6. var accumulator = incrmmean( 5 );
7.
Update moving mean as data comes in...
11/14/2016 Machine Learning
http://localhost:3000/#/?export&_k=lv9fld 10/23
Moving Means
window size
11/14/2016 Machine Learning
http://localhost:3000/#/?export&_k=lv9fld 11/23
11/14/2016 Machine Learning
http://localhost:3000/#/?export&_k=lv9fld 12/23
TYPES OF PROBLEMS
Regression
0 20 40 60 80 100
­1,000
­500
0
500
1,000
1,500
e.g., house prices
Classi cation
0 20 40 60 80 100
0
20
40
60
80
100
e.g., character recognition (OCR)
Clustering
0 20 40 60 80 100
0
20
40
60
80
100
e.g., movie tastes
11/14/2016 Machine Learning
http://localhost:3000/#/?export&_k=lv9fld 13/23
REGRESSION
Model relationship between a numeric dependent
variable y and one or more explanatory variables X.
11/14/2016 Machine Learning
http://localhost:3000/#/?export&_k=lv9fld 14/23
14. registry
15. .on( 'package', function onPkg( pkg ) {
16. var nVersions = pkg.versions ?
17. pkg.versions.length : 0;
18. if ( pkg.created ) {
19. var current = new Date().getTime();
20. var created = new Date( pkg.created );
21. var age = ( current - created ) /
22. ( 1000 * 60 * 60 * 24 * 365 );
23. model.update( [ age ], nVersions );
24. }
25. })
10. 'loss': 'huber',
11. 'intercept': true
12. });
13.
26.
27.
28.
29.
30.
31.
Use creation date to predict # of versions
11/14/2016 Machine Learning
http://localhost:3000/#/?export&_k=lv9fld 15/23
Start Regression line: = 0.000 + 0.000x
Number of package versions is positively correlated with age:
y^
11/14/2016 Machine Learning
http://localhost:3000/#/?export&_k=lv9fld 16/23
CLASSIFICATION
Model relationship between a dependent categorical
variable y and one or more explanatory variables X.
11/14/2016 Machine Learning
http://localhost:3000/#/?export&_k=lv9fld 17/23
Predicting a binary outcome
8. var model = onlineClassification({
9. 'lambda': 1e-6,
10. 'intercept': true,
11. 'loss': 'log'
12. });
13.
14. registry.on( 'package', function onPkg( pkg )
{
15. var usesReact = pkg.mentions( 'react' ) ?
16. 1 :
17. -1;
18.
19. var features = [
20. 'webpack', 'browserify', 'jest',
21. 'tape', 'mocha'
22. ].map(
23. d => pkg.devDependsOn( d ) );
24.
25. var phat = model.predict( features,
'probability' );
26. var yhat = phat > 0.5 ? +1 : -1;
27.
11/14/2016 Machine Learning
http://localhost:3000/#/?export&_k=lv9fld 18/23
React Usage
paradigm-tags
marketeer
couchcache
datamodel-to-openapi
eaze-request
paradigm-categories
joeljparks-hubot-cosmicjr
paradigm-taxonomies
gulp-controlled-merge-json
ember-cli-addon-tests
Predicted
Yes
Predicted
No
Yes 0 4
No 0 34
Webpack Browserify Jest Tape Mocha
­2.0
­1.0
1.0
2.0
11/14/2016 Machine Learning
http://localhost:3000/#/?export&_k=lv9fld 19/23
Evaluating regression and classi cation
models
500 1,000 1,500 2,000 2,500
0.10
0.20
0.30
0.40
0.50
15%
Look at generalization
error (performance on data not
used for model training)
Our toy model does not do
so well: A mis-classi cation rate
of 13% might sound great, but
always predicting -1 yields 15%!
11/14/2016 Machine Learning
http://localhost:3000/#/?export&_k=lv9fld 20/23
CLUSTERING
Group observations into meaningful clusters such that
objects within a cluster are similar to each other and di erent
from objects assigned to the other clusters.
11/14/2016 Machine Learning
http://localhost:3000/#/?export&_k=lv9fld 21/23
POPULAR ALGORITHMS
kmeans
dbscan
Hierarchical Clustering
Mixture of Gaussians
4
5
6
7
8Dim. 1
2
2.1
2.2
2.3
2.4
2.5
2.6
2.7
2.8
2.9
3
3.1
3.2
3.3
3.4
3.5
3.6
3.7
3.8
3.9
4
4.1
4.2
4.3
4.4
Dim. 2
1
2
3
4
5
6
7
Dim. 3
4
5
6
7
8 Dim. 1
2
2.1
2.2
2.3
2.4
2.5
2.6
2.7
2.8
2.9
3
3.1
3.2
3.3
3.4
3.5
3.6
3.7
3.8
3.9
4
4.1
4.2
4.3
4.4
Dim. 2
1
2
3
4
5
6
7
Dim. 3
Cluster 1
Cluster 2
Cluster 3
Iris setosa
Iris versicolor
Iris virginica
Iris Speciesk­Means Clusters
11/14/2016 Machine Learning
http://localhost:3000/#/?export&_k=lv9fld 22/23
Free Textbooks:
"An Introduction to Statistical Learning" by James, Witten,
Hastie & Tibshirani (plus accompanying video lectures)
"Elements of Statistical Learning: Data Mining, Inference,
and Prediction." by Hastie, Tibshirani & Friedman
stdlib GitHub repository: https://github.com/stdlib-
js/stdlib/tree/develop
FURTHER RESOURCES
11/14/2016 Machine Learning
http://localhost:3000/#/?export&_k=lv9fld 23/23
THANK YOU!

More Related Content

DOC
Satyabhan
DOCX
Mid ii important quess
PDF
Shoeb: Implementation Challenges of a Paperless Admission System
PDF
Web 2 . .3 Development Services
PPTX
Data science in Node.js
PDF
Real-Life Node.js Troubleshooting - Damian Schenkelman, Auth0
PDF
JavaOne 2014: Java vs JavaScript
PPTX
Introduction to Data Science
Satyabhan
Mid ii important quess
Shoeb: Implementation Challenges of a Paperless Admission System
Web 2 . .3 Development Services
Data science in Node.js
Real-Life Node.js Troubleshooting - Damian Schenkelman, Auth0
JavaOne 2014: Java vs JavaScript
Introduction to Data Science

Viewers also liked (19)

PDF
Node.js Core State of the Union- James Snell
PDF
Take Data Validation Seriously - Paul Milham, WildWorks
PDF
State of the CLI- Kat Marchan
PDF
Hitchhiker's Guide to"'Serverless" Javascript - Steven Faulkner, Bustle
PDF
From Pterodactyls and Cactus to Artificial Intelligence - Ivan Seidel Gomes, ...
PDF
Developing Nirvana - Corey A. Butler, Author.io
PDF
Multimodal Interactions & JS: The What, The Why and The How - Diego Paez, Des...
PDF
Are your v8 garbage collection logs speaking to you?Joyee Cheung -Alibaba Clo...
PDF
Node's Event Loop From the Inside Out - Sam Roberts, IBM
PDF
Math in V8 is Broken and How We Can Fix It - Athan Reines, Fourier
PDF
Web MIDI API - the paster, the present, and the future -
PDF
Comet with node.js and V8
ODP
IBM MQ v8 and JMS 2.0
PDF
Nodifying the Enterprise - Prince Soni, TO THE NEW
PDF
Text Mining with Node.js - Philipp Burckhardt, Carnegie Mellon University
PDF
Building Scalable Web Applications Using Microservices Architecture and NodeJ...
PDF
Node.js Event Loop & EventEmitter
PPTX
Express State of the Union at Nodejs Interactive EU- Doug Wilson
PDF
Workshop: Science Meets Industry: Online Behavioral Experiments with nodeGame...
Node.js Core State of the Union- James Snell
Take Data Validation Seriously - Paul Milham, WildWorks
State of the CLI- Kat Marchan
Hitchhiker's Guide to"'Serverless" Javascript - Steven Faulkner, Bustle
From Pterodactyls and Cactus to Artificial Intelligence - Ivan Seidel Gomes, ...
Developing Nirvana - Corey A. Butler, Author.io
Multimodal Interactions & JS: The What, The Why and The How - Diego Paez, Des...
Are your v8 garbage collection logs speaking to you?Joyee Cheung -Alibaba Clo...
Node's Event Loop From the Inside Out - Sam Roberts, IBM
Math in V8 is Broken and How We Can Fix It - Athan Reines, Fourier
Web MIDI API - the paster, the present, and the future -
Comet with node.js and V8
IBM MQ v8 and JMS 2.0
Nodifying the Enterprise - Prince Soni, TO THE NEW
Text Mining with Node.js - Philipp Burckhardt, Carnegie Mellon University
Building Scalable Web Applications Using Microservices Architecture and NodeJ...
Node.js Event Loop & EventEmitter
Express State of the Union at Nodejs Interactive EU- Doug Wilson
Workshop: Science Meets Industry: Online Behavioral Experiments with nodeGame...
Ad

Similar to Real-Time Machine Learning with Node.js - Philipp Burckhardt, Carnegie Mellon University (20)

PPTX
TE_B_10_INTERNSHIP_PPT_ANIKET_BHAVSAR.pptx
PPTX
IMPLEMENTATION OF MACHINE LEARNING IN E-COMMERCE & BEYOND
PDF
Python and Machine Learning Applications in Industry
PDF
Predictive apps for startups
PDF
Choosing a Machine Learning technique to solve your need
PDF
Machine Learning-Based Phishing Detection
PDF
Machine Learning for Web Developers
PDF
Tensors Are All You Need: Faster Inference with Hummingbird
PDF
Machine learning for IoT - unpacking the blackbox
PDF
Machine Learning in Production
PDF
Introduction to Mahout and Machine Learning
PPTX
Machine Learning Essentials Demystified part1 | Big Data Demystified
PDF
Machine Learning - Supervised Learning
PPTX
Eckovation Machine Learning
PDF
Diabetes Prediction Using Machine Learning
PPTX
Foundations-of-Machine-Learning_in Engineering.pptx
PDF
Machine Learning: je m'y mets demain!
PPTX
Machine learning presentation (razi)
PDF
Introduction to Machine Learning with Python ( PDFDrive.com ).pdf
PPTX
The Art of Intelligence – A Practical Introduction Machine Learning for Oracl...
TE_B_10_INTERNSHIP_PPT_ANIKET_BHAVSAR.pptx
IMPLEMENTATION OF MACHINE LEARNING IN E-COMMERCE & BEYOND
Python and Machine Learning Applications in Industry
Predictive apps for startups
Choosing a Machine Learning technique to solve your need
Machine Learning-Based Phishing Detection
Machine Learning for Web Developers
Tensors Are All You Need: Faster Inference with Hummingbird
Machine learning for IoT - unpacking the blackbox
Machine Learning in Production
Introduction to Mahout and Machine Learning
Machine Learning Essentials Demystified part1 | Big Data Demystified
Machine Learning - Supervised Learning
Eckovation Machine Learning
Diabetes Prediction Using Machine Learning
Foundations-of-Machine-Learning_in Engineering.pptx
Machine Learning: je m'y mets demain!
Machine learning presentation (razi)
Introduction to Machine Learning with Python ( PDFDrive.com ).pdf
The Art of Intelligence – A Practical Introduction Machine Learning for Oracl...
Ad

More from NodejsFoundation (6)

PPTX
The Morality of Code - Glen Goodwin, SAS Institute, inc.
PDF
Take Data Validation Seriously - Paul Milham, WildWorks
PDF
From Pterodactyls and Cactus to Artificial Intelligence - Ivan Seidel Gomes, ...
PDF
Breaking Down the Monolith - Peter Marton, RisingStack
PDF
The Enterprise Case for Node.js
PDF
Node Foundation Membership Overview 20160907
The Morality of Code - Glen Goodwin, SAS Institute, inc.
Take Data Validation Seriously - Paul Milham, WildWorks
From Pterodactyls and Cactus to Artificial Intelligence - Ivan Seidel Gomes, ...
Breaking Down the Monolith - Peter Marton, RisingStack
The Enterprise Case for Node.js
Node Foundation Membership Overview 20160907

Recently uploaded (20)

PDF
sustainability-14-14877-v2.pddhzftheheeeee
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PDF
STKI Israel Market Study 2025 version august
PDF
Five Habits of High-Impact Board Members
PPTX
Web Crawler for Trend Tracking Gen Z Insights.pptx
PDF
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
Unlock new opportunities with location data.pdf
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
Hybrid model detection and classification of lung cancer
PPT
Geologic Time for studying geology for geologist
PDF
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
PPTX
Chapter 5: Probability Theory and Statistics
PPT
What is a Computer? Input Devices /output devices
sustainability-14-14877-v2.pddhzftheheeeee
A novel scalable deep ensemble learning framework for big data classification...
NewMind AI Weekly Chronicles – August ’25 Week III
STKI Israel Market Study 2025 version august
Five Habits of High-Impact Board Members
Web Crawler for Trend Tracking Gen Z Insights.pptx
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
O2C Customer Invoices to Receipt V15A.pptx
WOOl fibre morphology and structure.pdf for textiles
Unlock new opportunities with location data.pdf
Final SEM Unit 1 for mit wpu at pune .pptx
1 - Historical Antecedents, Social Consideration.pdf
A contest of sentiment analysis: k-nearest neighbor versus neural network
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
Hybrid model detection and classification of lung cancer
Geologic Time for studying geology for geologist
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
Taming the Chaos: How to Turn Unstructured Data into Decisions
Chapter 5: Probability Theory and Statistics
What is a Computer? Input Devices /output devices

Real-Time Machine Learning with Node.js - Philipp Burckhardt, Carnegie Mellon University