http://www.cit.ie
Computer Science Department
Haithem. afli@cit.ie
@AfliHaithem
Affective Analytics and Visualization
for Ensemble event-driven Stock
Market Forecasting
Praveen Joshi & Haithem Afli
AVI 2020 Workshop on AI, Big Data analysis and Visualization
June 9th, 2020
Outline
haithem.afli@cit.ie 2
Introduction and Context
Stock Market and Artificial Intelligence
Related work
Proposed Approach
System Architecture
Task Description
Experimental Setup
Results
Conclusion and Discussion
haithem.afli@cit.ie 3
The Stock Market
The stock market is where you can buy, sell, and trade stocks any
business day. It's also called a stock exchange, and works like an
auction where investors buy and sell shares of stocks.
haithem.afli@cit.ie 4
The Stock Market
Stocks allow you to own a share of a public corporation. Stock prices usually reflect
investors' opinions of what the company's earnings will be.
haithem.afli@cit.ie 5
The Stock Market Traders
Ø They are aware of every move that can harm the company or
the sector.
Ø Fundamentals of the company is also the most important part in
their working.
Ø Future predictions are also sometimes on purpose and without
any knowing as people listen to them and they make their
investments according to their saying.
Ø They have contacts and the contacts are also the source for their
wins to happen.
The Stock Market Traders
haithem.afli@cit.ie 6
Can we automate the Traders Task using
Artificial Intelligence?
haithem.afli@cit.ie 7
Graph from Tobias Bohnhoff
https://nativevideotube.blogspot.com/
Related Work
haithem.afli@cit.ie 8
§ Twitter [Bollen, 2011] : Sentiment Analysis of Twitter for
stock market prediction
§ Business NEWS [Hu, Ziniu, et al., 2019]: Sentiment Analysis
for stock market prediction
§ Event driven stock market forecasting [Ding, Xiao, et al.,
2015]: Finding quantifiable events in twitter and Business
NEWS.
haithem.afli@cit.ie 9
Twitter Business NEWS Financial Indicator
Model combination
Output (Rise/ Fall) X-Visualisation
Contribution
Proposed Approach
haithem.afli@cit.ie 10
§ Build Twitter model to capture sentiments and emotions
§ Build Business NEWS model to capture sentiments and
emotions.
§ Assess hybrid model architecture to incorporate multi-
platform data and predict stock market.
§ Validate the Prediction with the help of Visualisation.
Preprocessing pipeline for textual data
haithem.afli@cit.ie 11
Scrapped Raw Text : Twitter tweets via python API and NEWS via Data Miner of Chrome
Social Data
Twitter
Business News
Financial Times
Noisy Entity Removal
Stop words
Punctuations
URL’s
Text Normalization
Tokenization
Lemmatization
Processed
Textual
Documents
Textual: Feature Engineered
Dataset Preparation
haithem.afli@cit.ie 12
Sentiment Analysis Emotion AnalysisLegends:
Processed Documents
Twitter Text
• Tweet Length
• Re-Tweets
NEWS Text
• NEWS Length
Combining Feature Set
Resultant dataset for
Twitter
Features
Extracted
from
Ontology
Features
from
Scraper
Harvard
IV-4
Loughran
and
McDonald
Text Blob
NRC
Emotion
Lexicon
Feature
Engineered
Twitter
Dataset
Ontology Space
Financial Indicator: Data Curation and Feature
Engineered Dataset Preparation
haithem.afli@cit.ie 13
Quandl
API
Series Engineering
• Sma1
• Sma2
• Vol increment
• Open increment
• Ma7
• Ma21
• 26EMA
• 12EMA
• MACD
• 30 Day
• MA 30 Day STD
• Upper band
• Lower band
• EMA momentum
• log momentum
• Fourier transformed
• Open
• High
• Close
• Adj Close
• Volume
• Date
Financial Data
Feature
Engineered
Financial Dataset
Experimental Setup: Data Overview
haithem.afli@cit.ie 14
Experimental Setup: ML/DL
haithem.afli@cit.ie 15
Naïve Bayes
Gradient
Boosting
Ada Boost xGboost
Voting Classifier Random Forest
Machine
Learning
Models
Dense Neural
Network
CNN_LSTM
Network
CNN
BidirectionalLSTM
Network
CNN_GRU
Network
CNN_RNN
Network
ULMFiT
Deep
Learning
Models
Artificial Intelligence Predictive Models
haithem.afli@cit.ie 16
Hybrid Architecture based on Best Model
Selection Strategy
Twitter Model
Machine Learning
Model
ULMFiT
Deep Learning
Model
BERT
Deep Learning
Model
NEWS Model
Machine Learning
Model
ULMFiT
Deep Learning
Model
BERT
Deep Learning
Model
Financial Model
Machine
Learning Model
Voting
Classifier
Output
Best Twitter
model
Best Financial
model
Best NEWS
Model
Input
17
Hybrid Architecture based on
Shallow Transfer Learning Model
Twitter
BERT
NEWS
BERT
Input
ML/ DL
Classifier
Output
BERT Dataset
haithem.afli@cit.ie
Hybrid Architecture based on
Engineered Features
10/06/2020 haithem.afli@cit.ie 18
Twitter
Model
Feature
Engineered
NEWS Model
Feature
Engineered
Financial
Model
Feature
Engineered
ML/ DL
Classifier
Output
Input
Feature Engineered Dataset
haithem.afli@cit.ie 19
Hybrid Architecture based on Shallow Transfer Learning (DL Models) results
Hybrid Architecture based on engineered features dataset (DL Models) results
Results
haithem.afli@cit.ie 20
Results
Hybrid Architecture based on engineered features dataset (ML models) results
Hybrid Architecture based on Best Model Selection Strategy results
Conclusion
Haithem.afli@cit.ie
§ Feasibility study of the social media platform and Business
NEWS over the stock market prediction.
§ With the amount of data flowing in different social media
platform and righteous Business NEWS, in coming future, it
will be very much possible to capture the stock price
movement with multiple such platforms efficiently.
§ Complex feature can be developed in the financial indicator
as they showed prominent results as individual models.
http://www.cit.ie
Computer Science Department
Haithem. afli@cit.ie
@AfliHaithem
Thank you

Affective Analytics and Visualization for Ensemble event-driven stock market forecasting

  • 1.
    http://www.cit.ie Computer Science Department Haithem.afli@cit.ie @AfliHaithem Affective Analytics and Visualization for Ensemble event-driven Stock Market Forecasting Praveen Joshi & Haithem Afli AVI 2020 Workshop on AI, Big Data analysis and Visualization June 9th, 2020
  • 2.
    Outline haithem.afli@cit.ie 2 Introduction andContext Stock Market and Artificial Intelligence Related work Proposed Approach System Architecture Task Description Experimental Setup Results Conclusion and Discussion
  • 3.
    haithem.afli@cit.ie 3 The StockMarket The stock market is where you can buy, sell, and trade stocks any business day. It's also called a stock exchange, and works like an auction where investors buy and sell shares of stocks.
  • 4.
    haithem.afli@cit.ie 4 The StockMarket Stocks allow you to own a share of a public corporation. Stock prices usually reflect investors' opinions of what the company's earnings will be.
  • 5.
    haithem.afli@cit.ie 5 The StockMarket Traders Ø They are aware of every move that can harm the company or the sector. Ø Fundamentals of the company is also the most important part in their working. Ø Future predictions are also sometimes on purpose and without any knowing as people listen to them and they make their investments according to their saying. Ø They have contacts and the contacts are also the source for their wins to happen.
  • 6.
    The Stock MarketTraders haithem.afli@cit.ie 6
  • 7.
    Can we automatethe Traders Task using Artificial Intelligence? haithem.afli@cit.ie 7 Graph from Tobias Bohnhoff https://nativevideotube.blogspot.com/
  • 8.
    Related Work haithem.afli@cit.ie 8 §Twitter [Bollen, 2011] : Sentiment Analysis of Twitter for stock market prediction § Business NEWS [Hu, Ziniu, et al., 2019]: Sentiment Analysis for stock market prediction § Event driven stock market forecasting [Ding, Xiao, et al., 2015]: Finding quantifiable events in twitter and Business NEWS.
  • 9.
    haithem.afli@cit.ie 9 Twitter BusinessNEWS Financial Indicator Model combination Output (Rise/ Fall) X-Visualisation Contribution
  • 10.
    Proposed Approach haithem.afli@cit.ie 10 §Build Twitter model to capture sentiments and emotions § Build Business NEWS model to capture sentiments and emotions. § Assess hybrid model architecture to incorporate multi- platform data and predict stock market. § Validate the Prediction with the help of Visualisation.
  • 11.
    Preprocessing pipeline fortextual data haithem.afli@cit.ie 11 Scrapped Raw Text : Twitter tweets via python API and NEWS via Data Miner of Chrome Social Data Twitter Business News Financial Times Noisy Entity Removal Stop words Punctuations URL’s Text Normalization Tokenization Lemmatization Processed Textual Documents
  • 12.
    Textual: Feature Engineered DatasetPreparation haithem.afli@cit.ie 12 Sentiment Analysis Emotion AnalysisLegends: Processed Documents Twitter Text • Tweet Length • Re-Tweets NEWS Text • NEWS Length Combining Feature Set Resultant dataset for Twitter Features Extracted from Ontology Features from Scraper Harvard IV-4 Loughran and McDonald Text Blob NRC Emotion Lexicon Feature Engineered Twitter Dataset Ontology Space
  • 13.
    Financial Indicator: DataCuration and Feature Engineered Dataset Preparation haithem.afli@cit.ie 13 Quandl API Series Engineering • Sma1 • Sma2 • Vol increment • Open increment • Ma7 • Ma21 • 26EMA • 12EMA • MACD • 30 Day • MA 30 Day STD • Upper band • Lower band • EMA momentum • log momentum • Fourier transformed • Open • High • Close • Adj Close • Volume • Date Financial Data Feature Engineered Financial Dataset
  • 14.
    Experimental Setup: DataOverview haithem.afli@cit.ie 14
  • 15.
    Experimental Setup: ML/DL haithem.afli@cit.ie15 Naïve Bayes Gradient Boosting Ada Boost xGboost Voting Classifier Random Forest Machine Learning Models Dense Neural Network CNN_LSTM Network CNN BidirectionalLSTM Network CNN_GRU Network CNN_RNN Network ULMFiT Deep Learning Models Artificial Intelligence Predictive Models
  • 16.
    haithem.afli@cit.ie 16 Hybrid Architecturebased on Best Model Selection Strategy Twitter Model Machine Learning Model ULMFiT Deep Learning Model BERT Deep Learning Model NEWS Model Machine Learning Model ULMFiT Deep Learning Model BERT Deep Learning Model Financial Model Machine Learning Model Voting Classifier Output Best Twitter model Best Financial model Best NEWS Model Input
  • 17.
    17 Hybrid Architecture basedon Shallow Transfer Learning Model Twitter BERT NEWS BERT Input ML/ DL Classifier Output BERT Dataset haithem.afli@cit.ie
  • 18.
    Hybrid Architecture basedon Engineered Features 10/06/2020 haithem.afli@cit.ie 18 Twitter Model Feature Engineered NEWS Model Feature Engineered Financial Model Feature Engineered ML/ DL Classifier Output Input Feature Engineered Dataset
  • 19.
    haithem.afli@cit.ie 19 Hybrid Architecturebased on Shallow Transfer Learning (DL Models) results Hybrid Architecture based on engineered features dataset (DL Models) results Results
  • 20.
    haithem.afli@cit.ie 20 Results Hybrid Architecturebased on engineered features dataset (ML models) results Hybrid Architecture based on Best Model Selection Strategy results
  • 21.
    Conclusion Haithem.afli@cit.ie § Feasibility studyof the social media platform and Business NEWS over the stock market prediction. § With the amount of data flowing in different social media platform and righteous Business NEWS, in coming future, it will be very much possible to capture the stock price movement with multiple such platforms efficiently. § Complex feature can be developed in the financial indicator as they showed prominent results as individual models.
  • 22.