SlideShare ist ein Scribd-Unternehmen logo
1 von 13
MACHINE LEARNING IN FINANCE
USING PYTHON
ERIC THAM
Director, Quant Strategies
Presentation Slides on
http://www.slideshare.net/erictham/machine-learning-in-finance-using-python
MACHINE LEARNING
Key words: Pattern recognition, algorithm, data, prediction…
Main categories: Supervised & unsupervised learning
Key algorithms : Clustering, regression, classification, regression (more to
Statistics)
Key Models: SVM, GLS, Tree-based regression, neural network, cluster
analysis
MACHINE LEARNING IN FINANCE
Questions :
How do u recognise finance patterns … ?
What data? What do u use it for ?
Unlike normal usage for facial recognition, NLP
MACHINE LEARNING IN FINANCE
i. Sentiment analysis : (Behavoiural finance)
ii. Credit analytics
iii. Financial forecasting
iv. Portfolio allocation
MACHINE LEARNING PYTHON LIBRARIES
Libraries:
i. sci-kit learn
ii. Theano
iii. Stats-model
Sentiment analysis generally use machine learning.
GENERAL FORECASTING: (MACHINE LEARNING)
3 steps to any forecasting: (or machine learning)
1. Preprocess and transform data:
- On both output and input: this is key; it is an art and a science;
- in finance: these could be economic variables, sentiment data, price data
2. Model :
- CART, neural network, logistic regression etc.
- time period
3. Assess and backtest
- statistical output;
- in sample and out of sample
Go back to 1 if necessary.
BUILDING A FINANCIAL FORECASTING MODEL IN
PYTHON
1. Sourcing data - retrieves data from sources eg quandl, pandas.io, Yahoo
finance, proprietary databases (go to datasource.py file)
BUILDING FINANCIAL FORECASTING MODEL IN
PYTHON
1 .. Technical transformation on data (dataTechnical.py)
- technical indicators like RSI, MACD, KDJ:
BUILDING FINANCIAL FORECASTING IN PYTHON
Go to techInterpret.py
BUILDING FINANCIAL FORECASTING MODEL IN
PYTHON
Training - applies different model parameters (possibly 1000s combinations) to
assess best results
Go to dataTrain.py
PORTFOLIO SELECTION & ALLOCATION
1. clusterPortfolio.py (K-means)
- aggregates stock features eg. sentiment, technical indicators,
momentum indicators, historical returns, betas etc.
- X  n * m : model with n stocks each with m features each
- these are clustered into K clusters with the best cluster being
selected)
- criteria to use: means scores, risk levels, portfolio themes, backtest
results etc.
PORTFOLIO SELECTION & ALLOCATION
Go to clusterPortfolio.py
CONCLUSION:
Thank you !
Remember it is an art not a science; machine learning in finance gives you
a framework to understand the system;
Still need intuition and trial-and-error (luck)
My Email : erictham115@yahoo.com

Weitere ähnliche Inhalte

Was ist angesagt?

IRJET- Stock Price Prediction using Long Short Term Memory
IRJET-  	  Stock Price Prediction using Long Short Term MemoryIRJET-  	  Stock Price Prediction using Long Short Term Memory
IRJET- Stock Price Prediction using Long Short Term MemoryIRJET Journal
 
Stock Market Price Prediction Using Technical Analysis
Stock Market Price Prediction Using Technical AnalysisStock Market Price Prediction Using Technical Analysis
Stock Market Price Prediction Using Technical AnalysisASHEESHVERMA6
 
STOCK MARKET PREDICTION USING MACHINE LEARNING METHODS
STOCK MARKET PREDICTION USING MACHINE LEARNING METHODSSTOCK MARKET PREDICTION USING MACHINE LEARNING METHODS
STOCK MARKET PREDICTION USING MACHINE LEARNING METHODSIAEME Publication
 
GRC 2020 - IIA - ISACA Machine Learning Monitoring, Compliance and Governance
GRC 2020 - IIA - ISACA Machine Learning Monitoring, Compliance and GovernanceGRC 2020 - IIA - ISACA Machine Learning Monitoring, Compliance and Governance
GRC 2020 - IIA - ISACA Machine Learning Monitoring, Compliance and GovernanceAndrew Clark
 
Can we use Mixture Models to Predict Market Bottoms? by Brian Christopher - 2...
Can we use Mixture Models to Predict Market Bottoms? by Brian Christopher - 2...Can we use Mixture Models to Predict Market Bottoms? by Brian Christopher - 2...
Can we use Mixture Models to Predict Market Bottoms? by Brian Christopher - 2...QuantInsti
 

Was ist angesagt? (6)

shailesh_resume
shailesh_resumeshailesh_resume
shailesh_resume
 
IRJET- Stock Price Prediction using Long Short Term Memory
IRJET-  	  Stock Price Prediction using Long Short Term MemoryIRJET-  	  Stock Price Prediction using Long Short Term Memory
IRJET- Stock Price Prediction using Long Short Term Memory
 
Stock Market Price Prediction Using Technical Analysis
Stock Market Price Prediction Using Technical AnalysisStock Market Price Prediction Using Technical Analysis
Stock Market Price Prediction Using Technical Analysis
 
STOCK MARKET PREDICTION USING MACHINE LEARNING METHODS
STOCK MARKET PREDICTION USING MACHINE LEARNING METHODSSTOCK MARKET PREDICTION USING MACHINE LEARNING METHODS
STOCK MARKET PREDICTION USING MACHINE LEARNING METHODS
 
GRC 2020 - IIA - ISACA Machine Learning Monitoring, Compliance and Governance
GRC 2020 - IIA - ISACA Machine Learning Monitoring, Compliance and GovernanceGRC 2020 - IIA - ISACA Machine Learning Monitoring, Compliance and Governance
GRC 2020 - IIA - ISACA Machine Learning Monitoring, Compliance and Governance
 
Can we use Mixture Models to Predict Market Bottoms? by Brian Christopher - 2...
Can we use Mixture Models to Predict Market Bottoms? by Brian Christopher - 2...Can we use Mixture Models to Predict Market Bottoms? by Brian Christopher - 2...
Can we use Mixture Models to Predict Market Bottoms? by Brian Christopher - 2...
 

Ähnlich wie Machine learning in finance using python

Machine Learning and Analytics Breakout Session
Machine Learning and Analytics Breakout SessionMachine Learning and Analytics Breakout Session
Machine Learning and Analytics Breakout SessionSplunk
 
Machine Learning and Analytics in Splunk
Machine Learning and Analytics in SplunkMachine Learning and Analytics in Splunk
Machine Learning and Analytics in SplunkSplunk
 
Self Study Business Approach to DS_01022022.docx
Self Study Business Approach to DS_01022022.docxSelf Study Business Approach to DS_01022022.docx
Self Study Business Approach to DS_01022022.docxShanmugasundaram M
 
INTRODUCTION TO DATA SCIENCE -CONCEPTS.pptx
INTRODUCTION TO DATA SCIENCE -CONCEPTS.pptxINTRODUCTION TO DATA SCIENCE -CONCEPTS.pptx
INTRODUCTION TO DATA SCIENCE -CONCEPTS.pptxMadhumitha N
 
Machine Learning and Analytics Breakout Session
Machine Learning and Analytics Breakout SessionMachine Learning and Analytics Breakout Session
Machine Learning and Analytics Breakout SessionSplunk
 
Machine Learning Basics
Machine Learning BasicsMachine Learning Basics
Machine Learning BasicsSuresh Arora
 
Introduction to Business Analytics-sample.pptx
Introduction to Business Analytics-sample.pptxIntroduction to Business Analytics-sample.pptx
Introduction to Business Analytics-sample.pptxabedeh1
 
How to analyze text data for AI and ML with Named Entity Recognition
How to analyze text data for AI and ML with Named Entity RecognitionHow to analyze text data for AI and ML with Named Entity Recognition
How to analyze text data for AI and ML with Named Entity RecognitionSkyl.ai
 
Predictive Analytics: Context and Use Cases
Predictive Analytics: Context and Use CasesPredictive Analytics: Context and Use Cases
Predictive Analytics: Context and Use CasesKimberley Mitchell
 
data science and business analytics
data science and business analyticsdata science and business analytics
data science and business analyticssunnypatil1778
 
Introduction to data science
Introduction to data scienceIntroduction to data science
Introduction to data scienceMahir Haque
 
Introduction To Data Science With Python
Introduction To Data Science With PythonIntroduction To Data Science With Python
Introduction To Data Science With PythonSpotle.ai
 
Machine Learning and Analytics Breakout Session
Machine Learning and Analytics Breakout SessionMachine Learning and Analytics Breakout Session
Machine Learning and Analytics Breakout SessionSplunk
 
An Overview of Python for Data Analytics
An Overview of Python for Data AnalyticsAn Overview of Python for Data Analytics
An Overview of Python for Data AnalyticsIRJET Journal
 
Data science technology overview
Data science technology overviewData science technology overview
Data science technology overviewSoojung Hong
 
Data Analytics & Visualization (Introduction)
Data Analytics & Visualization (Introduction)Data Analytics & Visualization (Introduction)
Data Analytics & Visualization (Introduction)Dolapo Amusat
 
Open Source Business Intelligence Overview
Open Source Business Intelligence OverviewOpen Source Business Intelligence Overview
Open Source Business Intelligence OverviewAlex Meadows
 

Ähnlich wie Machine learning in finance using python (20)

MyMediaLite
MyMediaLiteMyMediaLite
MyMediaLite
 
Machine Learning and Analytics Breakout Session
Machine Learning and Analytics Breakout SessionMachine Learning and Analytics Breakout Session
Machine Learning and Analytics Breakout Session
 
Machine Learning and Analytics in Splunk
Machine Learning and Analytics in SplunkMachine Learning and Analytics in Splunk
Machine Learning and Analytics in Splunk
 
Lecture-6-7.pptx
Lecture-6-7.pptxLecture-6-7.pptx
Lecture-6-7.pptx
 
Self Study Business Approach to DS_01022022.docx
Self Study Business Approach to DS_01022022.docxSelf Study Business Approach to DS_01022022.docx
Self Study Business Approach to DS_01022022.docx
 
INTRODUCTION TO DATA SCIENCE -CONCEPTS.pptx
INTRODUCTION TO DATA SCIENCE -CONCEPTS.pptxINTRODUCTION TO DATA SCIENCE -CONCEPTS.pptx
INTRODUCTION TO DATA SCIENCE -CONCEPTS.pptx
 
Machine Learning and Analytics Breakout Session
Machine Learning and Analytics Breakout SessionMachine Learning and Analytics Breakout Session
Machine Learning and Analytics Breakout Session
 
Machine Learning Basics
Machine Learning BasicsMachine Learning Basics
Machine Learning Basics
 
ML Basics
ML BasicsML Basics
ML Basics
 
Introduction to Business Analytics-sample.pptx
Introduction to Business Analytics-sample.pptxIntroduction to Business Analytics-sample.pptx
Introduction to Business Analytics-sample.pptx
 
How to analyze text data for AI and ML with Named Entity Recognition
How to analyze text data for AI and ML with Named Entity RecognitionHow to analyze text data for AI and ML with Named Entity Recognition
How to analyze text data for AI and ML with Named Entity Recognition
 
Predictive Analytics: Context and Use Cases
Predictive Analytics: Context and Use CasesPredictive Analytics: Context and Use Cases
Predictive Analytics: Context and Use Cases
 
data science and business analytics
data science and business analyticsdata science and business analytics
data science and business analytics
 
Introduction to data science
Introduction to data scienceIntroduction to data science
Introduction to data science
 
Introduction To Data Science With Python
Introduction To Data Science With PythonIntroduction To Data Science With Python
Introduction To Data Science With Python
 
Machine Learning and Analytics Breakout Session
Machine Learning and Analytics Breakout SessionMachine Learning and Analytics Breakout Session
Machine Learning and Analytics Breakout Session
 
An Overview of Python for Data Analytics
An Overview of Python for Data AnalyticsAn Overview of Python for Data Analytics
An Overview of Python for Data Analytics
 
Data science technology overview
Data science technology overviewData science technology overview
Data science technology overview
 
Data Analytics & Visualization (Introduction)
Data Analytics & Visualization (Introduction)Data Analytics & Visualization (Introduction)
Data Analytics & Visualization (Introduction)
 
Open Source Business Intelligence Overview
Open Source Business Intelligence OverviewOpen Source Business Intelligence Overview
Open Source Business Intelligence Overview
 

Kürzlich hochgeladen

House of Commons ; CDC schemes overview document
House of Commons ; CDC schemes overview documentHouse of Commons ; CDC schemes overview document
House of Commons ; CDC schemes overview documentHenry Tapper
 
Classical Theory of Macroeconomics by Adam Smith
Classical Theory of Macroeconomics by Adam SmithClassical Theory of Macroeconomics by Adam Smith
Classical Theory of Macroeconomics by Adam SmithAdamYassin2
 
Economics, Commerce and Trade Management: An International Journal (ECTIJ)
Economics, Commerce and Trade Management: An International Journal (ECTIJ)Economics, Commerce and Trade Management: An International Journal (ECTIJ)
Economics, Commerce and Trade Management: An International Journal (ECTIJ)ECTIJ
 
Economic Risk Factor Update: April 2024 [SlideShare]
Economic Risk Factor Update: April 2024 [SlideShare]Economic Risk Factor Update: April 2024 [SlideShare]
Economic Risk Factor Update: April 2024 [SlideShare]Commonwealth
 
BPPG response - Options for Defined Benefit schemes - 19Apr24.pdf
BPPG response - Options for Defined Benefit schemes - 19Apr24.pdfBPPG response - Options for Defined Benefit schemes - 19Apr24.pdf
BPPG response - Options for Defined Benefit schemes - 19Apr24.pdfHenry Tapper
 
Tenets of Physiocracy History of Economic
Tenets of Physiocracy History of EconomicTenets of Physiocracy History of Economic
Tenets of Physiocracy History of Economiccinemoviesu
 
Stock Market Brief Deck for "this does not happen often".pdf
Stock Market Brief Deck for "this does not happen often".pdfStock Market Brief Deck for "this does not happen often".pdf
Stock Market Brief Deck for "this does not happen often".pdfMichael Silva
 
(中央兰开夏大学毕业证学位证成绩单-案例)
(中央兰开夏大学毕业证学位证成绩单-案例)(中央兰开夏大学毕业证学位证成绩单-案例)
(中央兰开夏大学毕业证学位证成绩单-案例)twfkn8xj
 
Financial Leverage Definition, Advantages, and Disadvantages
Financial Leverage Definition, Advantages, and DisadvantagesFinancial Leverage Definition, Advantages, and Disadvantages
Financial Leverage Definition, Advantages, and Disadvantagesjayjaymabutot13
 
《加拿大本地办假证-寻找办理Dalhousie毕业证和达尔豪斯大学毕业证书的中介代理》
《加拿大本地办假证-寻找办理Dalhousie毕业证和达尔豪斯大学毕业证书的中介代理》《加拿大本地办假证-寻找办理Dalhousie毕业证和达尔豪斯大学毕业证书的中介代理》
《加拿大本地办假证-寻找办理Dalhousie毕业证和达尔豪斯大学毕业证书的中介代理》rnrncn29
 
(办理学位证)加拿大萨省大学毕业证成绩单原版一比一
(办理学位证)加拿大萨省大学毕业证成绩单原版一比一(办理学位证)加拿大萨省大学毕业证成绩单原版一比一
(办理学位证)加拿大萨省大学毕业证成绩单原版一比一S SDS
 
Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...
Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...
Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...First NO1 World Amil baba in Faisalabad
 
call girls in Nand Nagri (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in  Nand Nagri (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in  Nand Nagri (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Nand Nagri (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Call Girls Near Delhi Pride Hotel, New Delhi|9873777170
Call Girls Near Delhi Pride Hotel, New Delhi|9873777170Call Girls Near Delhi Pride Hotel, New Delhi|9873777170
Call Girls Near Delhi Pride Hotel, New Delhi|9873777170Sonam Pathan
 
NO1 WorldWide Genuine vashikaran specialist Vashikaran baba near Lahore Vashi...
NO1 WorldWide Genuine vashikaran specialist Vashikaran baba near Lahore Vashi...NO1 WorldWide Genuine vashikaran specialist Vashikaran baba near Lahore Vashi...
NO1 WorldWide Genuine vashikaran specialist Vashikaran baba near Lahore Vashi...Amil baba
 
NO1 Certified Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Ami...
NO1 Certified Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Ami...NO1 Certified Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Ami...
NO1 Certified Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Ami...Amil baba
 
(办理原版一样)QUT毕业证昆士兰科技大学毕业证学位证留信学历认证成绩单补办
(办理原版一样)QUT毕业证昆士兰科技大学毕业证学位证留信学历认证成绩单补办(办理原版一样)QUT毕业证昆士兰科技大学毕业证学位证留信学历认证成绩单补办
(办理原版一样)QUT毕业证昆士兰科技大学毕业证学位证留信学历认证成绩单补办fqiuho152
 
PMFBY , Pradhan Mantri Fasal bima yojna
PMFBY , Pradhan Mantri  Fasal bima yojnaPMFBY , Pradhan Mantri  Fasal bima yojna
PMFBY , Pradhan Mantri Fasal bima yojnaDharmendra Kumar
 
212MTAMount Durham University Bachelor's Diploma in Technology
212MTAMount Durham University Bachelor's Diploma in Technology212MTAMount Durham University Bachelor's Diploma in Technology
212MTAMount Durham University Bachelor's Diploma in Technologyz xss
 

Kürzlich hochgeladen (20)

House of Commons ; CDC schemes overview document
House of Commons ; CDC schemes overview documentHouse of Commons ; CDC schemes overview document
House of Commons ; CDC schemes overview document
 
Classical Theory of Macroeconomics by Adam Smith
Classical Theory of Macroeconomics by Adam SmithClassical Theory of Macroeconomics by Adam Smith
Classical Theory of Macroeconomics by Adam Smith
 
Economics, Commerce and Trade Management: An International Journal (ECTIJ)
Economics, Commerce and Trade Management: An International Journal (ECTIJ)Economics, Commerce and Trade Management: An International Journal (ECTIJ)
Economics, Commerce and Trade Management: An International Journal (ECTIJ)
 
Economic Risk Factor Update: April 2024 [SlideShare]
Economic Risk Factor Update: April 2024 [SlideShare]Economic Risk Factor Update: April 2024 [SlideShare]
Economic Risk Factor Update: April 2024 [SlideShare]
 
BPPG response - Options for Defined Benefit schemes - 19Apr24.pdf
BPPG response - Options for Defined Benefit schemes - 19Apr24.pdfBPPG response - Options for Defined Benefit schemes - 19Apr24.pdf
BPPG response - Options for Defined Benefit schemes - 19Apr24.pdf
 
Tenets of Physiocracy History of Economic
Tenets of Physiocracy History of EconomicTenets of Physiocracy History of Economic
Tenets of Physiocracy History of Economic
 
Stock Market Brief Deck for "this does not happen often".pdf
Stock Market Brief Deck for "this does not happen often".pdfStock Market Brief Deck for "this does not happen often".pdf
Stock Market Brief Deck for "this does not happen often".pdf
 
(中央兰开夏大学毕业证学位证成绩单-案例)
(中央兰开夏大学毕业证学位证成绩单-案例)(中央兰开夏大学毕业证学位证成绩单-案例)
(中央兰开夏大学毕业证学位证成绩单-案例)
 
Financial Leverage Definition, Advantages, and Disadvantages
Financial Leverage Definition, Advantages, and DisadvantagesFinancial Leverage Definition, Advantages, and Disadvantages
Financial Leverage Definition, Advantages, and Disadvantages
 
《加拿大本地办假证-寻找办理Dalhousie毕业证和达尔豪斯大学毕业证书的中介代理》
《加拿大本地办假证-寻找办理Dalhousie毕业证和达尔豪斯大学毕业证书的中介代理》《加拿大本地办假证-寻找办理Dalhousie毕业证和达尔豪斯大学毕业证书的中介代理》
《加拿大本地办假证-寻找办理Dalhousie毕业证和达尔豪斯大学毕业证书的中介代理》
 
🔝+919953056974 🔝young Delhi Escort service Pusa Road
🔝+919953056974 🔝young Delhi Escort service Pusa Road🔝+919953056974 🔝young Delhi Escort service Pusa Road
🔝+919953056974 🔝young Delhi Escort service Pusa Road
 
(办理学位证)加拿大萨省大学毕业证成绩单原版一比一
(办理学位证)加拿大萨省大学毕业证成绩单原版一比一(办理学位证)加拿大萨省大学毕业证成绩单原版一比一
(办理学位证)加拿大萨省大学毕业证成绩单原版一比一
 
Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...
Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...
Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...
 
call girls in Nand Nagri (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in  Nand Nagri (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in  Nand Nagri (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Nand Nagri (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Call Girls Near Delhi Pride Hotel, New Delhi|9873777170
Call Girls Near Delhi Pride Hotel, New Delhi|9873777170Call Girls Near Delhi Pride Hotel, New Delhi|9873777170
Call Girls Near Delhi Pride Hotel, New Delhi|9873777170
 
NO1 WorldWide Genuine vashikaran specialist Vashikaran baba near Lahore Vashi...
NO1 WorldWide Genuine vashikaran specialist Vashikaran baba near Lahore Vashi...NO1 WorldWide Genuine vashikaran specialist Vashikaran baba near Lahore Vashi...
NO1 WorldWide Genuine vashikaran specialist Vashikaran baba near Lahore Vashi...
 
NO1 Certified Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Ami...
NO1 Certified Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Ami...NO1 Certified Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Ami...
NO1 Certified Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Ami...
 
(办理原版一样)QUT毕业证昆士兰科技大学毕业证学位证留信学历认证成绩单补办
(办理原版一样)QUT毕业证昆士兰科技大学毕业证学位证留信学历认证成绩单补办(办理原版一样)QUT毕业证昆士兰科技大学毕业证学位证留信学历认证成绩单补办
(办理原版一样)QUT毕业证昆士兰科技大学毕业证学位证留信学历认证成绩单补办
 
PMFBY , Pradhan Mantri Fasal bima yojna
PMFBY , Pradhan Mantri  Fasal bima yojnaPMFBY , Pradhan Mantri  Fasal bima yojna
PMFBY , Pradhan Mantri Fasal bima yojna
 
212MTAMount Durham University Bachelor's Diploma in Technology
212MTAMount Durham University Bachelor's Diploma in Technology212MTAMount Durham University Bachelor's Diploma in Technology
212MTAMount Durham University Bachelor's Diploma in Technology
 

Machine learning in finance using python

  • 1. MACHINE LEARNING IN FINANCE USING PYTHON ERIC THAM Director, Quant Strategies Presentation Slides on http://www.slideshare.net/erictham/machine-learning-in-finance-using-python
  • 2. MACHINE LEARNING Key words: Pattern recognition, algorithm, data, prediction… Main categories: Supervised & unsupervised learning Key algorithms : Clustering, regression, classification, regression (more to Statistics) Key Models: SVM, GLS, Tree-based regression, neural network, cluster analysis
  • 3. MACHINE LEARNING IN FINANCE Questions : How do u recognise finance patterns … ? What data? What do u use it for ? Unlike normal usage for facial recognition, NLP
  • 4. MACHINE LEARNING IN FINANCE i. Sentiment analysis : (Behavoiural finance) ii. Credit analytics iii. Financial forecasting iv. Portfolio allocation
  • 5. MACHINE LEARNING PYTHON LIBRARIES Libraries: i. sci-kit learn ii. Theano iii. Stats-model Sentiment analysis generally use machine learning.
  • 6. GENERAL FORECASTING: (MACHINE LEARNING) 3 steps to any forecasting: (or machine learning) 1. Preprocess and transform data: - On both output and input: this is key; it is an art and a science; - in finance: these could be economic variables, sentiment data, price data 2. Model : - CART, neural network, logistic regression etc. - time period 3. Assess and backtest - statistical output; - in sample and out of sample Go back to 1 if necessary.
  • 7. BUILDING A FINANCIAL FORECASTING MODEL IN PYTHON 1. Sourcing data - retrieves data from sources eg quandl, pandas.io, Yahoo finance, proprietary databases (go to datasource.py file)
  • 8. BUILDING FINANCIAL FORECASTING MODEL IN PYTHON 1 .. Technical transformation on data (dataTechnical.py) - technical indicators like RSI, MACD, KDJ:
  • 9. BUILDING FINANCIAL FORECASTING IN PYTHON Go to techInterpret.py
  • 10. BUILDING FINANCIAL FORECASTING MODEL IN PYTHON Training - applies different model parameters (possibly 1000s combinations) to assess best results Go to dataTrain.py
  • 11. PORTFOLIO SELECTION & ALLOCATION 1. clusterPortfolio.py (K-means) - aggregates stock features eg. sentiment, technical indicators, momentum indicators, historical returns, betas etc. - X  n * m : model with n stocks each with m features each - these are clustered into K clusters with the best cluster being selected) - criteria to use: means scores, risk levels, portfolio themes, backtest results etc.
  • 12. PORTFOLIO SELECTION & ALLOCATION Go to clusterPortfolio.py
  • 13. CONCLUSION: Thank you ! Remember it is an art not a science; machine learning in finance gives you a framework to understand the system; Still need intuition and trial-and-error (luck) My Email : erictham115@yahoo.com

Hinweis der Redaktion

  1. A self introduction of myself: Studied phd in finance in University of Lausanne/ Switzerland 洛桑大学 Masters in Financial engineering in Columbia University 哥伦比亚 大学 Masters in Business Analytics (Big Data) in National University of Singapore Presently a partner in a data analytics start-up doing web and consumer analytics Now, have an interest in Big Data, and especially in NLP in finance. Paper : real time analysis of twitter sentiment on the NASDAQ markets. Hoping to get it published with some more work!  First real-time (20 mins) different from other papers  Some interesting findings (to elaborate later)
  2. Definitions in wikipedia… Key words – supervised learning in layman terms uses a reference (learning from past experiences) whilst unsupervised learning learns from unlabelled data eg clustering, PCA
  3. questions need to be answered in context; a few areas that I think of as follows:
  4. the answers: will not talk too much on sentiment analysis there is a talk previously on NLTK+ ; number of other open source libraries as well like jieba : NLP (and sentiment analysis as a whole uses SVM and recurrent neural network) - Unstructured data analysis See my link on twitter mood drives markets; Writing a paper on sentiment drives markets and markets drives sentiment – hope to complete it this couple of months Credit analytics: uses classification on credit scoring : logistic regression; tree-based regression: Assesses a person credit-worthiness based on his credit scores The following two not the main point of my presentation; but the next two more so;
  5. Not my aim to go through excellent ML libraries but will share those that I use and apply  esp sci-kit lean and statsmodel Separate presentation (I understand) using NLTK; and another Theano expert (Deep learning) which I will not touch on then! Scikit learn and statsmodel -> both good; scikit-learn has more functions generally; for ordinary regressions good enough to use statsmodel
  6. Step 1: actually tests your understanding of the subject matter; Transformation could be normalisation, threshold -> normally involves categorisation; or a mixture model ; frequency of data Anything Step 2: Not necessary complex models best: model complexity tend to be defined by parameterisation, non-linearity, time-varyingness (stochasticity), meta-models Number of dimensions (of data), In forecasting, the model basically says given this scenario or set of data under this situation, u should get this output with a certain degree of probability. It is the same with other machine learning in computer science – whether NLP, speech etc. Step 3: did the model achieve what you want? Why is financial forecasting so difficult? Because it is social science! It is hard to deterministically human emotions, reactions and actions; Structural changes to model
  7. See code in github; Criteria can be risk, different returns, drawdown; sharpe ratio etc
  8. See code in github; Criteria can be risk, different returns, drawdown; sharpe ratio etc
  9. See code in github; Criteria can be risk, different returns, drawdown; sharpe ratio etc
  10. Code: See python slide
  11. See code in github: In portfolio allocation, Imaibo has the advantage in it has the sentiment data.
  12. See code in github: In portfolio allocation, Imaibo has the advantage in it has the sentiment data.