SlideShare a Scribd company logo
APACHE SAMOA:
MINING BIG DATA STREAMS
WITH APACHE FLINK
Albert Bifet @abifet
12 October 2015
APACHE SAMOA 0.3.0
• Released July 2015
pReduce Limitations
ample
w compute in real time (latency less than 1 second):
redictions
requent items as Twitter hashtags
entiment analysis
14
Streaming Predictive Analytics on
Apache Flink
Author:
Foteini Beligianni
Examiner:
Vladimir Vlassov
Supervisors:
Seif Haridi
Paris Carbone
A thesis submitted for the degree of Master of Science in
Distributed Systems and Services
MOTIVATION
REALTIME ANALYTICS
eal time analytics
REALTIME ANALYTICS
real time analytics
APACHE SAMOAVISION
• Distributed stream mining platform
• Library of state-of-the-art algorithms

for practitioners
• Development and collaboration framework

for researchers
• Algorithms & Systems
IMPORTANCE
• Example: spam detection in
comments onYahoo News
• Trends change in time
• Need to retrain model with
new data
Importance$of$O
•  As$spam$trends$change
retrain$the$model$with
INTERNET OF THINGS
• EMC Digital Universe, 2014
digital universe
Figure 3: EMC Digital Universe, 2014
7
BIG DATA STREAM
• Volume +Velocity (+Variety)
• Too large for single commodity
server main memory
• Too fast for single commodity
server CPU
• A solution should be:
• Distributed
• Scalable
BIG DATA
PROCESSING ENGINES
• Low latency
• High Latency (Not real time)
apache storm
Storm characteristics for real-time data processing workloads
1 Fast
2 Scalable
3 Fault-tolerant
4 Reliable
5 Easy to operate
apache samza from linkedin
Storm and Samza are fairly similar. Both systems provide:
1 a partitioned stream model,
2 a distributed execution environment,
3 an API for stream processing,
4 fault tolerance,
5 Kafka integration
real time computation: streaming computation
MapReduce Limitations
Example
How compute in real time (latency less than 1 second):
1 predictions
2 frequent items as Twitter hashtags
3 sentiment analysis
14
apache spark streaming
DATA SCIENCEdata scientist
Figure 1:
2
MACHINE LEARNING
• Classification
• Regression
• Clustering
• Frequent Pattern Mining
WHAT IS APACHE SAMOA?
STREAMING MODEL
• Sequence is potentially infinite
• High amount of data, high speed of arrival
• Change over time (concept drift)
• Approximation algorithms

(small error with high probability)
• Single pass, one data item at a time
• Sub-linear space and time per data item
TAXONOMY
Data
Mining
Distributed
Batch
Hadoop
Mahout
Stream
Storm, S4,
Samza
SAMOA
Non
Distributed
Batch
R,
WEKA,
…
Stream
MOA
ARCHITECTURE
An adapter for integrating Apache Flink into Apache SAMOA was implemente
n scope of this master thesis, with the main parts of its implementation bein
addressed in this section. With the use of our adapter, ML algorithms can b
executed on top of Apache Flink. The implemented adapter will be used for th
evaluation of the ML pipelines and HT algorithm variations.
Figure 20: Apache SAMOA’s high level architecture.
STATUSSTATUS
• Parallel algorithms
• Classification (Vertical HoeffdingTree)
• Clustering (CluStream)
• Regression (Adaptive Model Rules)
• Execution engines
IS SAMOA USEFUL FORYOU?
• Only if you need to deal with:
• Large fast data
• Evolving process (model updates)
• What is happening now?
• Use feedback in real-time
• Adapt to changes faster
GROUPINGS
• Key Grouping 

(hashing)
• Shuffle Grouping

(round-robin)
• All Grouping

(broadcast)
PE PE
PEI
PEI
PEI
PEI
PE PE
PEI
PEI
PEI
PEI
GROUPINGS
• Key Grouping 

(hashing)
• Shuffle Grouping

(round-robin)
• All Grouping

(broadcast)
PE PE
PEI
PEI
PEI
PEI
GROUPINGS
• Key Grouping 

(hashing)
• Shuffle Grouping

(round-robin)
• All Grouping

(broadcast)
PE PE
PEI
PEI
PEI
PEI
GROUPINGS
• Key Grouping 

(hashing)
• Shuffle Grouping

(round-robin)
• All Grouping

(broadcast)
ML DEVELOPER API
Processing Item
Processor
Stream
ML DEVELOPER API
TopologyBuilder builder;
Processor sourceOne = new SourceProcessor();
builder.addProcessor(sourceOne);
Stream streamOne = builder.createStream(sourceOne);
Processor sourceTwo = new SourceProcessor();
builder.addProcessor(sourceTwo);
Stream streamTwo = builder.createStream(sourceTwo);
Processor join = new JoinProcessor());
builder.addProcessor(join)
.connectInputShuffle(streamOne)
.connectInputKey(streamTwo);
VERTICAL HOEFFDINGTREE
(VHT)
DECISIONTREE
• Nodes are tests on attributes
• Branches are possible
outcomes
• Leafs are class assignments


 Class
Instance
Attributes
Road
Tested?
Mileage?
Age?
NoYes
High
✅
❌
Low
OldRecent
✅ ❌
Car deal?
HOEFFDINGTREE
• Sample of stream enough for near optimal decision
• Estimate merit of alternatives from prefix of stream
• Choose sample size based on statistical principles
• When to expand a leaf?
• Let x1 be the most informative attribute,

x2 the second most informative one
• Hoeffding bound: split if G(x1, x2) > ✏ =
r
R2 ln(1/ )
2n
P. Domingos and G. Hulten, “Mining High-Speed Data Streams,” KDD ’00
PARALLEL DECISIONTREES
• Which kind of parallelism?
• Task
• Data
• Horizontal
• Vertical
Data
Attributes
Instances
HORIZONTAL PARALLELISM
Y. Ben-Haim and E.Tom-Tov,“A Streaming Parallel DecisionTree Algorithm,” JMLR, vol. 11, pp.
849–872, 2010
Stats
Stats
Stats
Stream
Histograms
Model
Instances
Model Updates
Aggregation to
compute splits
Single attribute
tracked in
multiple node
30
HOEFFDINGTREE
PROFILING
Other
6 %
Split
24 %
Learn
70 %
CPU time for training

100 nominal and 100
numeric attributes
VERTICAL PARALLELISM
Single attribute tracked
in single node
Stats
Stats
Stats
Stream
Model
Attributes
Splits
ADVANTAGES OFVERTICAL
• High number of attributes => high level of parallelism

(e.g., documents)
• Vs task parallelism
• Parallelism observed immediately
• Vs horizontal parallelism
• Reduced memory usage (no model replication)
• Parallelized split computation
VERTICAL HOEFFDINGTREE
Control
Split
Result
Source (n) Model (n) Stats (n) Evaluator (1)
InstanceStream
Shuffle Grouping
Key Grouping
All Grouping
ACCURACY
No. Leaf Nodes VHT2 –
tree-100
30
Very close and
very high accuracy
PERFORMANCE
35
0
50
100
150
200
250
MHT VHT2-par-3
ExecutionTime(seconds)
Classifier
Profiling Results for text-10000
with 100000 instances
t_calc
t_comm
t_serial
Throughput
VHT2-par-3: 2631 inst/sec
MHT : 507 inst/sec
Streaming Predictive Analytics on
Apache Flink
Author:
Foteini Beligianni
Examiner:
Vladimir Vlassov
Supervisors:
Seif Haridi
Paris Carbone
A thesis submitted for the degree of Master of Science in
Distributed Systems and Services
REPLICATED MODELVHT
(RMVHT)4 ALGORITHM IMPLEMENTATION
4.1.2 Replicated Model of VHT Algorithm (RmVHT)
COMPARISON NATIVEVHT6 EXPERIMENTAL EVALUATION
Figure 22: Prequential classification error of Flink’s native VHT SAMOA’s VHT
and RmVHT algorithm for UCI-Forest Covertype data set.Flink’s native
VHT has data source with parallelism equal to 1.
COMPARISON NATIVEVHT6 EXPERIMENTAL EVALUATION
Figure 25: Prequential classification error of Flink’s native VHT, SAMOA’s VHT
and RmVHT algorithm for UCI-Forest Covertype data set. Flink’s na-
tive VHT has data source with parallelism equal to 8.
COMPARISON NATIVEVHT
The Higgs data set is a synthetic data set, a detailed description of which is
presented in Appendix Section A.2.1. In general we observe that Higgs is not
such a good data set to be used for classification with a DT classifier. As we see
in Figure 27, SAMOA’s VHT learns slower than Flink’s native VHT but achieves
lower prequential classification error at the end. On the other hand Flink’s VHT
seems to learn faster at the beginning, but then its prequential classification error
remains stable and slightly greater than SAMOA’s.
Figure 27: Prequential classification error of Flink’s native VHT, SAMOA’s VHT
and RmVHT algorithm for UCI-HIGGS data set.
COMPARISON NATIVEVHT
As we observe in Figure 31, for the Waveform21 data set SAMOA’s VHT outper-
forms Flink’s native VHT implementation. Moreover, we see that SAMOA’s VHT is
learning slower, but achieves lower classification error at the end, whereas Flink’s
native VHT learns faster, as it decreases very fast the classification error, but then
its error remains stable.
Figure 31: Classification error of VHT and RmVHT classifier, for Waveform 21-
attribute data set on Apache Flink and Apache SAMOA.
In Figure 32, we observe that for the Led data set Flink’s native VHT outper-
COMPARISON NATIVEVHT
• NativeVHT is faster than SAMOAVHT
• NativeVHT is more accurate than SAMOAVHT
in real datasets
• Future work for nativeVHT: stress test with
nominal attributes, and use Gini Impurity
CONCLUSIONS
• Streaming is the future and is happening now
• Mining big data streams is an open field
• SAMOA:A Platform for Mining Big Data Streams
• Available and open-source (incubating @ASF)

http://samoa.incubator.apache.org
• A platform for collaboration and research on

distributed stream mining
OPEN CHALLENGES
• Distributed stream mining algorithms
• Active & semi-supervised learning + crowdsourcing
• Millions of classes (e.g.,Wikipedia pages)
• Multi-target learning
• System issues (load balancing, communication)
• Programming paradigms and abstractions
THETEAM
Albert

Bifet
Matthieu

Morel
Gianmarco

De Francisci Morales
Arinto

Murdopo
Nicolas

Kourtellis
Olivier

Van Laere
SUPPORTING
ORGANISATIONS
THANKS!
https://samoa.incubator.apache.org
@ApacheSAMOA

More Related Content

PPTX
S. Bartoli & F. Pompermaier – A Semantic Big Data Companion
PDF
Fabian Hueske – Juggling with Bits and Bytes
PDF
Introduction to Apache Flink - Fast and reliable big data processing
PDF
Gradoop: Scalable Graph Analytics with Apache Flink @ Flink Forward 2015
PDF
Dongwon Kim – A Comparative Performance Evaluation of Flink
PDF
K. Tzoumas & S. Ewen – Flink Forward Keynote
PDF
Christian Kreuzfeld – Static vs Dynamic Stream Processing
PPTX
Suneel Marthi - Deep Learning with Apache Flink and DL4J
S. Bartoli & F. Pompermaier – A Semantic Big Data Companion
Fabian Hueske – Juggling with Bits and Bytes
Introduction to Apache Flink - Fast and reliable big data processing
Gradoop: Scalable Graph Analytics with Apache Flink @ Flink Forward 2015
Dongwon Kim – A Comparative Performance Evaluation of Flink
K. Tzoumas & S. Ewen – Flink Forward Keynote
Christian Kreuzfeld – Static vs Dynamic Stream Processing
Suneel Marthi - Deep Learning with Apache Flink and DL4J

What's hot (20)

PDF
FlinkML: Large Scale Machine Learning with Apache Flink
PDF
Apache con big data 2015 - Data Science from the trenches
PPTX
SICS: Apache Flink Streaming
PPTX
Apache flink
PDF
Flink Forward SF 2017: Dean Wampler - Streaming Deep Learning Scenarios with...
PPTX
Apache Flink - Overview and Use cases of a Distributed Dataflow System (at pr...
PPTX
Apache Flink: API, runtime, and project roadmap
PDF
Large-Scale Stream Processing in the Hadoop Ecosystem - Hadoop Summit 2016
PPTX
A Data Streaming Architecture with Apache Flink (berlin Buzzwords 2016)
PPTX
ApacheCon: Apache Flink - Fast and Reliable Large-Scale Data Processing
PDF
Large-Scale Stream Processing in the Hadoop Ecosystem
PDF
Gelly-Stream: Single-Pass Graph Streaming Analytics with Apache Flink
PDF
Flink Apachecon Presentation
PPTX
Real-time Stream Processing with Apache Flink
PPTX
Jim Dowling - Multi-tenant Flink-as-a-Service on YARN
PPTX
Why apache Flink is the 4G of Big Data Analytics Frameworks
PPTX
Spark Summit EU talk by Sameer Agarwal
PDF
Machine Learning with Apache Flink at Stockholm Machine Learning Group
PDF
Towards Benchmaking Modern Distruibuted Systems-(Grace Huang, Intel)
PDF
Stateful Distributed Stream Processing
FlinkML: Large Scale Machine Learning with Apache Flink
Apache con big data 2015 - Data Science from the trenches
SICS: Apache Flink Streaming
Apache flink
Flink Forward SF 2017: Dean Wampler - Streaming Deep Learning Scenarios with...
Apache Flink - Overview and Use cases of a Distributed Dataflow System (at pr...
Apache Flink: API, runtime, and project roadmap
Large-Scale Stream Processing in the Hadoop Ecosystem - Hadoop Summit 2016
A Data Streaming Architecture with Apache Flink (berlin Buzzwords 2016)
ApacheCon: Apache Flink - Fast and Reliable Large-Scale Data Processing
Large-Scale Stream Processing in the Hadoop Ecosystem
Gelly-Stream: Single-Pass Graph Streaming Analytics with Apache Flink
Flink Apachecon Presentation
Real-time Stream Processing with Apache Flink
Jim Dowling - Multi-tenant Flink-as-a-Service on YARN
Why apache Flink is the 4G of Big Data Analytics Frameworks
Spark Summit EU talk by Sameer Agarwal
Machine Learning with Apache Flink at Stockholm Machine Learning Group
Towards Benchmaking Modern Distruibuted Systems-(Grace Huang, Intel)
Stateful Distributed Stream Processing
Ad

Viewers also liked (20)

PDF
Anwar Rizal – Streaming & Parallel Decision Tree in Flink
PDF
Mohamed Amine Abdessemed – Real-time Data Integration with Apache Flink & Kafka
PPTX
Apache Flink Training: DataStream API Part 1 Basic
PDF
Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin
PDF
Marc Schwering – Using Flink with MongoDB to enhance relevancy in personaliza...
PDF
Mikio Braun – Data flow vs. procedural programming
PDF
Jim Dowling – Interactive Flink analytics with HopsWorks and Zeppelin
PPTX
Apache Flink Training: DataStream API Part 2 Advanced
PPTX
Aljoscha Krettek – Notions of Time
PDF
Apache Flink internals
PDF
Ufuc Celebi – Stream & Batch Processing in one System
PDF
Martin Junghans – Gradoop: Scalable Graph Analytics with Apache Flink
PDF
Vasia Kalavri – Training: Gelly School
PPTX
Assaf Araki – Real Time Analytics at Scale
PDF
Simon Laws – Apache Flink Cluster Deployment on Docker and Docker-Compose
PDF
Sebastian Schelter – Distributed Machine Learing with the Samsara DSL
PDF
Vyacheslav Zholudev – Flink, a Convenient Abstraction Layer for Yarn?
PPTX
Kamal Hakimzadeh – Reproducible Distributed Experiments
PPTX
Fabian Hueske – Cascading on Flink
PDF
Matthias J. Sax – A Tale of Squirrels and Storms
Anwar Rizal – Streaming & Parallel Decision Tree in Flink
Mohamed Amine Abdessemed – Real-time Data Integration with Apache Flink & Kafka
Apache Flink Training: DataStream API Part 1 Basic
Moon soo Lee – Data Science Lifecycle with Apache Flink and Apache Zeppelin
Marc Schwering – Using Flink with MongoDB to enhance relevancy in personaliza...
Mikio Braun – Data flow vs. procedural programming
Jim Dowling – Interactive Flink analytics with HopsWorks and Zeppelin
Apache Flink Training: DataStream API Part 2 Advanced
Aljoscha Krettek – Notions of Time
Apache Flink internals
Ufuc Celebi – Stream & Batch Processing in one System
Martin Junghans – Gradoop: Scalable Graph Analytics with Apache Flink
Vasia Kalavri – Training: Gelly School
Assaf Araki – Real Time Analytics at Scale
Simon Laws – Apache Flink Cluster Deployment on Docker and Docker-Compose
Sebastian Schelter – Distributed Machine Learing with the Samsara DSL
Vyacheslav Zholudev – Flink, a Convenient Abstraction Layer for Yarn?
Kamal Hakimzadeh – Reproducible Distributed Experiments
Fabian Hueske – Cascading on Flink
Matthias J. Sax – A Tale of Squirrels and Storms
Ad

Similar to Albert Bifet – Apache Samoa: Mining Big Data Streams with Apache Flink (20)

PDF
Mining Big Data Streams with APACHE SAMOA
PDF
Mining big data streams with APACHE SAMOA by Albert Bifet
PPTX
SAMOA: A Platform for Mining Big Data Streams (Apache BigData North America 2...
PPTX
Data provenance in Hopsworks
PPTX
SAMOA: A Platform for Mining Big Data Streams (Apache BigData Europe 2015)
PPTX
Apache Flink Meetup Munich (November 2015): Flink Overview, Architecture, Int...
PDF
Using Machine Learning to Understand Kafka Runtime Behavior (Shivanath Babu, ...
PDF
Flink Streaming Berlin Meetup
PDF
Metadata and Provenance for ML Pipelines with Hopsworks
PDF
Baymeetup-FlinkResearch
PPTX
Apache Flink: Past, Present and Future
PPTX
Streaming in the Wild with Apache Flink
PPTX
Data Stream Processing with Apache Flink
PDF
Data Stream Analytics - Why they are important
PDF
Big Data Analytics Platforms by KTH and RISE SICS
PPTX
Chicago Flink Meetup: Flink's streaming architecture
PPTX
Architecture of Flink's Streaming Runtime @ ApacheCon EU 2015
PPT
Tale of two streaming frameworks- Apace Storm & Apache Flink
PDF
Tale of two streaming frameworks (Karthik D - Walmart)
PDF
Deconstructing Lambda
Mining Big Data Streams with APACHE SAMOA
Mining big data streams with APACHE SAMOA by Albert Bifet
SAMOA: A Platform for Mining Big Data Streams (Apache BigData North America 2...
Data provenance in Hopsworks
SAMOA: A Platform for Mining Big Data Streams (Apache BigData Europe 2015)
Apache Flink Meetup Munich (November 2015): Flink Overview, Architecture, Int...
Using Machine Learning to Understand Kafka Runtime Behavior (Shivanath Babu, ...
Flink Streaming Berlin Meetup
Metadata and Provenance for ML Pipelines with Hopsworks
Baymeetup-FlinkResearch
Apache Flink: Past, Present and Future
Streaming in the Wild with Apache Flink
Data Stream Processing with Apache Flink
Data Stream Analytics - Why they are important
Big Data Analytics Platforms by KTH and RISE SICS
Chicago Flink Meetup: Flink's streaming architecture
Architecture of Flink's Streaming Runtime @ ApacheCon EU 2015
Tale of two streaming frameworks- Apace Storm & Apache Flink
Tale of two streaming frameworks (Karthik D - Walmart)
Deconstructing Lambda

More from Flink Forward (20)

PDF
Building a fully managed stream processing platform on Flink at scale for Lin...
PPTX
Evening out the uneven: dealing with skew in Flink
PPTX
“Alexa, be quiet!”: End-to-end near-real time model building and evaluation i...
PDF
Introducing BinarySortedMultiMap - A new Flink state primitive to boost your ...
PDF
Introducing the Apache Flink Kubernetes Operator
PPTX
Autoscaling Flink with Reactive Mode
PDF
Dynamically Scaling Data Streams across Multiple Kafka Clusters with Zero Fli...
PPTX
One sink to rule them all: Introducing the new Async Sink
PPTX
Tuning Apache Kafka Connectors for Flink.pptx
PDF
Flink powered stream processing platform at Pinterest
PPTX
Apache Flink in the Cloud-Native Era
PPTX
Where is my bottleneck? Performance troubleshooting in Flink
PPTX
Using the New Apache Flink Kubernetes Operator in a Production Deployment
PPTX
The Current State of Table API in 2022
PDF
Flink SQL on Pulsar made easy
PPTX
Dynamic Rule-based Real-time Market Data Alerts
PPTX
Exactly-Once Financial Data Processing at Scale with Flink and Pinot
PPTX
Processing Semantically-Ordered Streams in Financial Services
PDF
Tame the small files problem and optimize data layout for streaming ingestion...
PDF
Batch Processing at Scale with Flink & Iceberg
Building a fully managed stream processing platform on Flink at scale for Lin...
Evening out the uneven: dealing with skew in Flink
“Alexa, be quiet!”: End-to-end near-real time model building and evaluation i...
Introducing BinarySortedMultiMap - A new Flink state primitive to boost your ...
Introducing the Apache Flink Kubernetes Operator
Autoscaling Flink with Reactive Mode
Dynamically Scaling Data Streams across Multiple Kafka Clusters with Zero Fli...
One sink to rule them all: Introducing the new Async Sink
Tuning Apache Kafka Connectors for Flink.pptx
Flink powered stream processing platform at Pinterest
Apache Flink in the Cloud-Native Era
Where is my bottleneck? Performance troubleshooting in Flink
Using the New Apache Flink Kubernetes Operator in a Production Deployment
The Current State of Table API in 2022
Flink SQL on Pulsar made easy
Dynamic Rule-based Real-time Market Data Alerts
Exactly-Once Financial Data Processing at Scale with Flink and Pinot
Processing Semantically-Ordered Streams in Financial Services
Tame the small files problem and optimize data layout for streaming ingestion...
Batch Processing at Scale with Flink & Iceberg

Recently uploaded (20)

PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Electronic commerce courselecture one. Pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Cloud computing and distributed systems.
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPT
Teaching material agriculture food technology
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Transforming Manufacturing operations through Intelligent Integrations
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
PDF
Advanced Soft Computing BINUS July 2025.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Telecom Fraud Prevention Guide | Hyperlink InfoSystem
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Electronic commerce courselecture one. Pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
GamePlan Trading System Review: Professional Trader's Honest Take
Review of recent advances in non-invasive hemoglobin estimation
Cloud computing and distributed systems.
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Teaching material agriculture food technology
MYSQL Presentation for SQL database connectivity
Transforming Manufacturing operations through Intelligent Integrations
Dropbox Q2 2025 Financial Results & Investor Presentation
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
Advanced Soft Computing BINUS July 2025.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Telecom Fraud Prevention Guide | Hyperlink InfoSystem
20250228 LYD VKU AI Blended-Learning.pptx

Albert Bifet – Apache Samoa: Mining Big Data Streams with Apache Flink

  • 1. APACHE SAMOA: MINING BIG DATA STREAMS WITH APACHE FLINK Albert Bifet @abifet 12 October 2015
  • 2. APACHE SAMOA 0.3.0 • Released July 2015 pReduce Limitations ample w compute in real time (latency less than 1 second): redictions requent items as Twitter hashtags entiment analysis 14
  • 3. Streaming Predictive Analytics on Apache Flink Author: Foteini Beligianni Examiner: Vladimir Vlassov Supervisors: Seif Haridi Paris Carbone A thesis submitted for the degree of Master of Science in Distributed Systems and Services
  • 7. APACHE SAMOAVISION • Distributed stream mining platform • Library of state-of-the-art algorithms
 for practitioners • Development and collaboration framework
 for researchers • Algorithms & Systems
  • 8. IMPORTANCE • Example: spam detection in comments onYahoo News • Trends change in time • Need to retrain model with new data Importance$of$O •  As$spam$trends$change retrain$the$model$with
  • 9. INTERNET OF THINGS • EMC Digital Universe, 2014 digital universe Figure 3: EMC Digital Universe, 2014 7
  • 10. BIG DATA STREAM • Volume +Velocity (+Variety) • Too large for single commodity server main memory • Too fast for single commodity server CPU • A solution should be: • Distributed • Scalable
  • 11. BIG DATA PROCESSING ENGINES • Low latency • High Latency (Not real time) apache storm Storm characteristics for real-time data processing workloads 1 Fast 2 Scalable 3 Fault-tolerant 4 Reliable 5 Easy to operate apache samza from linkedin Storm and Samza are fairly similar. Both systems provide: 1 a partitioned stream model, 2 a distributed execution environment, 3 an API for stream processing, 4 fault tolerance, 5 Kafka integration real time computation: streaming computation MapReduce Limitations Example How compute in real time (latency less than 1 second): 1 predictions 2 frequent items as Twitter hashtags 3 sentiment analysis 14 apache spark streaming
  • 13. MACHINE LEARNING • Classification • Regression • Clustering • Frequent Pattern Mining
  • 14. WHAT IS APACHE SAMOA?
  • 15. STREAMING MODEL • Sequence is potentially infinite • High amount of data, high speed of arrival • Change over time (concept drift) • Approximation algorithms
 (small error with high probability) • Single pass, one data item at a time • Sub-linear space and time per data item
  • 17. ARCHITECTURE An adapter for integrating Apache Flink into Apache SAMOA was implemente n scope of this master thesis, with the main parts of its implementation bein addressed in this section. With the use of our adapter, ML algorithms can b executed on top of Apache Flink. The implemented adapter will be used for th evaluation of the ML pipelines and HT algorithm variations. Figure 20: Apache SAMOA’s high level architecture.
  • 18. STATUSSTATUS • Parallel algorithms • Classification (Vertical HoeffdingTree) • Clustering (CluStream) • Regression (Adaptive Model Rules) • Execution engines
  • 19. IS SAMOA USEFUL FORYOU? • Only if you need to deal with: • Large fast data • Evolving process (model updates) • What is happening now? • Use feedback in real-time • Adapt to changes faster
  • 20. GROUPINGS • Key Grouping 
 (hashing) • Shuffle Grouping
 (round-robin) • All Grouping
 (broadcast) PE PE PEI PEI PEI PEI
  • 21. PE PE PEI PEI PEI PEI GROUPINGS • Key Grouping 
 (hashing) • Shuffle Grouping
 (round-robin) • All Grouping
 (broadcast)
  • 22. PE PE PEI PEI PEI PEI GROUPINGS • Key Grouping 
 (hashing) • Shuffle Grouping
 (round-robin) • All Grouping
 (broadcast)
  • 23. PE PE PEI PEI PEI PEI GROUPINGS • Key Grouping 
 (hashing) • Shuffle Grouping
 (round-robin) • All Grouping
 (broadcast)
  • 24. ML DEVELOPER API Processing Item Processor Stream
  • 25. ML DEVELOPER API TopologyBuilder builder; Processor sourceOne = new SourceProcessor(); builder.addProcessor(sourceOne); Stream streamOne = builder.createStream(sourceOne); Processor sourceTwo = new SourceProcessor(); builder.addProcessor(sourceTwo); Stream streamTwo = builder.createStream(sourceTwo); Processor join = new JoinProcessor()); builder.addProcessor(join) .connectInputShuffle(streamOne) .connectInputKey(streamTwo);
  • 27. DECISIONTREE • Nodes are tests on attributes • Branches are possible outcomes • Leafs are class assignments
 
 Class Instance Attributes Road Tested? Mileage? Age? NoYes High ✅ ❌ Low OldRecent ✅ ❌ Car deal?
  • 28. HOEFFDINGTREE • Sample of stream enough for near optimal decision • Estimate merit of alternatives from prefix of stream • Choose sample size based on statistical principles • When to expand a leaf? • Let x1 be the most informative attribute,
 x2 the second most informative one • Hoeffding bound: split if G(x1, x2) > ✏ = r R2 ln(1/ ) 2n P. Domingos and G. Hulten, “Mining High-Speed Data Streams,” KDD ’00
  • 29. PARALLEL DECISIONTREES • Which kind of parallelism? • Task • Data • Horizontal • Vertical Data Attributes Instances
  • 30. HORIZONTAL PARALLELISM Y. Ben-Haim and E.Tom-Tov,“A Streaming Parallel DecisionTree Algorithm,” JMLR, vol. 11, pp. 849–872, 2010 Stats Stats Stats Stream Histograms Model Instances Model Updates Aggregation to compute splits Single attribute tracked in multiple node 30
  • 31. HOEFFDINGTREE PROFILING Other 6 % Split 24 % Learn 70 % CPU time for training
 100 nominal and 100 numeric attributes
  • 32. VERTICAL PARALLELISM Single attribute tracked in single node Stats Stats Stats Stream Model Attributes Splits
  • 33. ADVANTAGES OFVERTICAL • High number of attributes => high level of parallelism
 (e.g., documents) • Vs task parallelism • Parallelism observed immediately • Vs horizontal parallelism • Reduced memory usage (no model replication) • Parallelized split computation
  • 34. VERTICAL HOEFFDINGTREE Control Split Result Source (n) Model (n) Stats (n) Evaluator (1) InstanceStream Shuffle Grouping Key Grouping All Grouping
  • 35. ACCURACY No. Leaf Nodes VHT2 – tree-100 30 Very close and very high accuracy
  • 36. PERFORMANCE 35 0 50 100 150 200 250 MHT VHT2-par-3 ExecutionTime(seconds) Classifier Profiling Results for text-10000 with 100000 instances t_calc t_comm t_serial Throughput VHT2-par-3: 2631 inst/sec MHT : 507 inst/sec
  • 37. Streaming Predictive Analytics on Apache Flink Author: Foteini Beligianni Examiner: Vladimir Vlassov Supervisors: Seif Haridi Paris Carbone A thesis submitted for the degree of Master of Science in Distributed Systems and Services
  • 38. REPLICATED MODELVHT (RMVHT)4 ALGORITHM IMPLEMENTATION 4.1.2 Replicated Model of VHT Algorithm (RmVHT)
  • 39. COMPARISON NATIVEVHT6 EXPERIMENTAL EVALUATION Figure 22: Prequential classification error of Flink’s native VHT SAMOA’s VHT and RmVHT algorithm for UCI-Forest Covertype data set.Flink’s native VHT has data source with parallelism equal to 1.
  • 40. COMPARISON NATIVEVHT6 EXPERIMENTAL EVALUATION Figure 25: Prequential classification error of Flink’s native VHT, SAMOA’s VHT and RmVHT algorithm for UCI-Forest Covertype data set. Flink’s na- tive VHT has data source with parallelism equal to 8.
  • 41. COMPARISON NATIVEVHT The Higgs data set is a synthetic data set, a detailed description of which is presented in Appendix Section A.2.1. In general we observe that Higgs is not such a good data set to be used for classification with a DT classifier. As we see in Figure 27, SAMOA’s VHT learns slower than Flink’s native VHT but achieves lower prequential classification error at the end. On the other hand Flink’s VHT seems to learn faster at the beginning, but then its prequential classification error remains stable and slightly greater than SAMOA’s. Figure 27: Prequential classification error of Flink’s native VHT, SAMOA’s VHT and RmVHT algorithm for UCI-HIGGS data set.
  • 42. COMPARISON NATIVEVHT As we observe in Figure 31, for the Waveform21 data set SAMOA’s VHT outper- forms Flink’s native VHT implementation. Moreover, we see that SAMOA’s VHT is learning slower, but achieves lower classification error at the end, whereas Flink’s native VHT learns faster, as it decreases very fast the classification error, but then its error remains stable. Figure 31: Classification error of VHT and RmVHT classifier, for Waveform 21- attribute data set on Apache Flink and Apache SAMOA. In Figure 32, we observe that for the Led data set Flink’s native VHT outper-
  • 43. COMPARISON NATIVEVHT • NativeVHT is faster than SAMOAVHT • NativeVHT is more accurate than SAMOAVHT in real datasets • Future work for nativeVHT: stress test with nominal attributes, and use Gini Impurity
  • 44. CONCLUSIONS • Streaming is the future and is happening now • Mining big data streams is an open field • SAMOA:A Platform for Mining Big Data Streams • Available and open-source (incubating @ASF)
 http://samoa.incubator.apache.org • A platform for collaboration and research on
 distributed stream mining
  • 45. OPEN CHALLENGES • Distributed stream mining algorithms • Active & semi-supervised learning + crowdsourcing • Millions of classes (e.g.,Wikipedia pages) • Multi-target learning • System issues (load balancing, communication) • Programming paradigms and abstractions