Top Banner
40
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: ApacheCon 2015 - A Stock Prediction System Using OSS
Page 2: ApacheCon 2015 - A Stock Prediction System Using OSS

A Stock Prediction System using open-source software

Fred Melo

[email protected]

@fredmelo_br

William Markito [email protected]

@william_markito

Page 3: ApacheCon 2015 - A Stock Prediction System Using OSS
Page 4: ApacheCon 2015 - A Stock Prediction System Using OSS

It's all about DATA

Data Sources Look for patterns

Prediction

Page 5: ApacheCon 2015 - A Stock Prediction System Using OSS
Page 6: ApacheCon 2015 - A Stock Prediction System Using OSS
Page 7: ApacheCon 2015 - A Stock Prediction System Using OSS

Machine Learning is the answer

Neural Networks

Clustering Genetic Algorithms

Page 8: ApacheCon 2015 - A Stock Prediction System Using OSS

Train with historical dataset

Apply model to the new input

Applying Machine Learning

Page 9: ApacheCon 2015 - A Stock Prediction System Using OSS

Hard to add new data sources

Why?

Hard to scale

Why so hard?

Hard to make it real-time

Page 10: ApacheCon 2015 - A Stock Prediction System Using OSS

HDFS

Data Lake

Store Analytics

Hard to change Labor intensive

Inefficient

No real-time information ETL based Data-source specific

Traditional models are reactive and static

Page 11: ApacheCon 2015 - A Stock Prediction System Using OSS

HDFS Data Lake Expert System /

Machine Learning

In-Memory Real-Time Data

Continuous Learning Continuous Improvement

Continuous Adapting

Data Stream Pipeline

Multiple Data Sources Real-Time Processing Store Everything

Stream-based, real-time closed-loop analytics are needed

Page 12: ApacheCon 2015 - A Stock Prediction System Using OSS

Info

Analysis

Look at past trends (for similar input)

Evaluate current input

Score / Predict

Neural Network

How can it be addressed?

Page 13: ApacheCon 2015 - A Stock Prediction System Using OSS

Info

Analysis

Filter

[ json ]

Neural Network

How can it be addressed?

Page 14: ApacheCon 2015 - A Stock Prediction System Using OSS

Info

Analysis

Filter Enrich Neural Network

How can it be addressed?

Page 15: ApacheCon 2015 - A Stock Prediction System Using OSS

Info

Analysis

Neural Network Filter Enrich Transform

How can it be addressed?

Page 16: ApacheCon 2015 - A Stock Prediction System Using OSS

Info

Analysis

Filter Enrich Transform

Neural Network

How can it be addressed?

Page 17: ApacheCon 2015 - A Stock Prediction System Using OSS

Info

Analysis

Filter Enrich Transform

Transform

Neural Network

How can it be addressed?

Page 18: ApacheCon 2015 - A Stock Prediction System Using OSS

Neural Network

In-Memory Data Grid Real-time scoring

How can it be addressed?

Train

Page 19: ApacheCon 2015 - A Stock Prediction System Using OSS

Neural Network

In-Memory Data Grid

Front-end

Update Push

How can it be addressed?

Page 20: ApacheCon 2015 - A Stock Prediction System Using OSS

Ingest Transform Sink SpringXD

Store / Analyze

Fast Data

Distributed Computing

Predict / Machine Learning

Other Sources and Destinations

JMS

Streaming real-time analytics architecture

Page 21: ApacheCon 2015 - A Stock Prediction System Using OSS

Transform Sink

SpringXD

Extensible Open-Source Fault-Tolerant Horizontally Scalable

HTTP

Machine Learning

Fast Data

Filter

Predict Sink HTTP

Split

Dashboard

Push

Demo Architecture

Page 22: ApacheCon 2015 - A Stock Prediction System Using OSS

SpringXD

shell - R

Transformer

geode-json client

geode-json client

http-client

http-server

obj-to-json

splitter

splitter

Simulator

tap

Page 23: ApacheCon 2015 - A Stock Prediction System Using OSS

SpringXD

INGEST / SINK PROCESS ANALYZE

•  Little or no coding required

•  Dozens of built-in connectors

•  Seamless integration with Kafka, Sqoop

•  Create new connectors easily using Spring

•  Call Spark, Reactor or RxJava

•  Built-in configurable filtering, splitting and transformation

•  Out-of-box configurable jobs for batch processing

•  Import and invoke PMML jobs easily

•  Call Python, R, Madlib and other tools

•  Built-in configurable counters and gauges

Data Stream Pipelining

Page 24: ApacheCon 2015 - A Stock Prediction System Using OSS

SpringXD

XD Nodes XD Nodes XD Nodes XD Nodes

Ingest

SpringXD

Split Filter Transform Sink

XD admin

XD Nodes

Ingest Split Filter Transform Sink

Stream Deployment

Messaging

Scale-Out and HA Architecture

Page 25: ApacheCon 2015 - A Stock Prediction System Using OSS

Transform Sink

SpringXD

Extensible Open-Source Fault-Tolerant Horizontally Scalable

HTTP

Machine Learning

Fast Data

Filter

Predict Sink HTTP

Split

Dashboard

Push

Demo Architecture

Page 26: ApacheCon 2015 - A Stock Prediction System Using OSS

Geode client-server architecture

Page 27: ApacheCon 2015 - A Stock Prediction System Using OSS

Partitioned Regions

Page 28: ApacheCon 2015 - A Stock Prediction System Using OSS

Event handling

Page 29: ApacheCon 2015 - A Stock Prediction System Using OSS

Transform Sink

SpringXD

Extensible Open-Source Fault-Tolerant Horizontally Scalable

HTTP

Machine Learning

Fast Data

Filter

Predict Sink HTTP

Split

Dashboard

Push

Demo Architecture

Page 30: ApacheCon 2015 - A Stock Prediction System Using OSS

Neural Networks

Page 31: ApacheCon 2015 - A Stock Prediction System Using OSS

Neural Networks

Page 32: ApacheCon 2015 - A Stock Prediction System Using OSS

medium avg (x+1)

relative strength (x)

medium avg (x)

price(x)

Neural Network

Page 33: ApacheCon 2015 - A Stock Prediction System Using OSS

Neural Network

Page 34: ApacheCon 2015 - A Stock Prediction System Using OSS

Transform Sink

SpringXD

Extensible Open-Source Fault-Tolerant Horizontally Scalable

HTTP

Machine Learning

Fast Data

Filter

Predict Sink HTTP

Split

Dashboard

Push

Demo Architecture

Page 35: ApacheCon 2015 - A Stock Prediction System Using OSS
Page 36: ApacheCon 2015 - A Stock Prediction System Using OSS

Demo Time

Page 37: ApacheCon 2015 - A Stock Prediction System Using OSS

SpringXD

shell - R

Transformer

geode-json client

geode-json client

http-client

http-server

obj-to-json

splitter

splitter

Simulator

tap

Page 38: ApacheCon 2015 - A Stock Prediction System Using OSS

SpringXD

http://projectgeode.org http://projects.spring.io/spring-xd http://www.r-project.org

Page 39: ApacheCon 2015 - A Stock Prediction System Using OSS
Page 40: ApacheCon 2015 - A Stock Prediction System Using OSS

Follow-up: In-Memory Unconference

"A place for all things in-memory: projects, people, ideas, roadmaps, discussions."Location: Hill Country A/B”

Weds 4:15pm - 6pm. (after this talk)

The demo code is on GitHub! @fredmelo_br @william_markito