NYC Data Science Academy| Blog
Bootcamps
Lifetime Job Support Available Financing Available
Bootcamps
Data Science with Machine Learning Flagship ๐Ÿ† Data Analytics Bootcamp Artificial Intelligence Bootcamp New Release ๐ŸŽ‰
Free Lesson
Intro to Data Science New Release ๐ŸŽ‰
Find Inspiration
Find Alumni with Similar Background
Job Outlook
Occupational Outlook Graduate Outcomes Must See ๐Ÿ”ฅ
Alumni
Success Stories Testimonials Alumni Directory Alumni Exclusive Study Program
Courses
View Bundled Courses
Financing Available
Bootcamp Prep Popular ๐Ÿ”ฅ Data Science Mastery Data Science Launchpad with Python View AI Courses Generative AI for Everyone New ๐ŸŽ‰ Generative AI for Finance New ๐ŸŽ‰ Generative AI for Marketing New ๐ŸŽ‰
Bundle Up
Learn More and Save More
Combination of data science courses.
View Data Science Courses
Beginner
Introductory Python
Intermediate
Data Science Python: Data Analysis and Visualization Popular ๐Ÿ”ฅ Data Science R: Data Analysis and Visualization
Advanced
Data Science Python: Machine Learning Popular ๐Ÿ”ฅ Data Science R: Machine Learning Designing and Implementing Production MLOps New ๐ŸŽ‰ Natural Language Processing for Production (NLP) New ๐ŸŽ‰
Find Inspiration
Get Course Recommendation Must Try ๐Ÿ’Ž An Ultimate Guide to Become a Data Scientist
For Companies
For Companies
Corporate Offerings Hiring Partners Candidate Portfolio Hire Our Graduates
Students Work
Students Work
All Posts Capstone Data Visualization Machine Learning Python Projects R Projects
Tutorials
About
About
About Us Accreditation Contact Us Join Us FAQ Webinars Subscription An Ultimate Guide to
Become a Data Scientist
    Login
NYC Data Science Acedemy
Bootcamps
Courses
Students Work
About
Bootcamps
Bootcamps
Data Science with Machine Learning Flagship
Data Analytics Bootcamp
Artificial Intelligence Bootcamp New Release ๐ŸŽ‰
Free Lessons
Intro to Data Science New Release ๐ŸŽ‰
Find Inspiration
Find Alumni with Similar Background
Job Outlook
Occupational Outlook
Graduate Outcomes Must See ๐Ÿ”ฅ
Alumni
Success Stories
Testimonials
Alumni Directory
Alumni Exclusive Study Program
Courses
Bundles
financing available
View All Bundles
Bootcamp Prep
Data Science Mastery
Data Science Launchpad with Python NEW!
View AI Courses
Generative AI for Everyone
Generative AI for Finance
Generative AI for Marketing
View Data Science Courses
View All Professional Development Courses
Beginner
Introductory Python
Intermediate
Python: Data Analysis and Visualization
R: Data Analysis and Visualization
Advanced
Python: Machine Learning
R: Machine Learning
Designing and Implementing Production MLOps
Natural Language Processing for Production (NLP)
For Companies
Corporate Offerings
Hiring Partners
Candidate Portfolio
Hire Our Graduates
Students Work
All Posts
Capstone
Data Visualization
Machine Learning
Python Projects
R Projects
About
Accreditation
About Us
Contact Us
Join Us
FAQ
Webinars
Subscription
An Ultimate Guide to Become a Data Scientist
Tutorials
Data Analytics
  • Learn Pandas
  • Learn NumPy
  • Learn SciPy
  • Learn Matplotlib
Machine Learning
  • Boosting
  • Random Forest
  • Linear Regression
  • Decision Tree
  • PCA
Interview by Companies
  • JPMC
  • Google
  • Facebook
Artificial Intelligence
  • Learn Generative AI
  • Learn ChatGPT-3.5
  • Learn ChatGPT-4
  • Learn Google Bard
Coding
  • Learn Python
  • Learn SQL
  • Learn MySQL
  • Learn NoSQL
  • Learn PySpark
  • Learn PyTorch
Interview Questions
  • Python Hard
  • R Easy
  • R Hard
  • SQL Easy
  • SQL Hard
  • Python Easy
Data Science Blog > Capstone > Winton Kaggle Competition

Winton Kaggle Competition

Zachary Escalante
Posted on Jun 30, 2016

Contributed by Zach Escalante. He  is currently in the NYC Data Science Academy 12 week full time Data Science Bootcamp program taking place between April 11th to July 1st, 2016. This post is based on his final class project - Capstone (due on the 12th week of the program)

Introduction

This Capstone project was an exciting opportunity for me to implement a sampling of the many machine learning techniques we as a bootcamp have been practicing for these past 12 weeks.

For my final project, I settled on working on a data set that was part of a Kaggle competition posted by Winton Capital Management which closed several months ago. I chose this specific competition because it addressed the difficult task of predicting time series. This is a very relevant problem for the financial industry (how to model asset returns, which are usually a stationary process) and one which I wanted to tackle with a plethora of new tools at my disposal. One of the important questions regarding stationary processes for financial data sets deals with outlier detection. Is it possible to implement a model that can predict (or even give a hint) as to when to expect a large movement either up or down in an asset? We very recently had a prime example of this with the UK voting to leave the EU.

Here we see the Hi Yield credit default index dropped in excess of two points overnight:

 

Screen Shot 2016-06-26 at 11.29.48 AM

The British Pound set record lows in a matter of hours versus the US dollar:

Screen Shot 2016-06-26 at 11.28.29 AM

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

These recent events highlight the necessity of being able to model time series to the best of our ability, which is why I chose this project to work on for my Capstone.

The Competition:

The Kaggle competition provided a training data set that contained 40,000 rows and 211 columns. Each row represented an observation of an asset (these could have been stocks, currencies, commodities or bonds - for linguistic ease and simplification, we will refer to them as stocks), and each column was a variable. Our first columns 2-26 were data features, the next two columns (27 & 28) were the T-2 and T-1 returns, after that we had 180 single-minute returns for the current day, followed by T+1 and T+2 returns and the two weight columns. Our goal for the competition as to use the features, T-2, T-1 and the first 120 minutes worth of returns to predict the next 60 minutes of returns and the T+1 and T+2 returns.

 

Screen Shot 2016-06-26 at 11.16.37 AM

In order to score the predictions, the contestants had to minimize the Weighted Mean Average Error:
Screen Shot 2016-06-26 at 11.01.09 AM

This meant taking each prediction and taking the difference between the prediction and the actual values and multiplying them by the respective weight. Then we sum these weights and divide by the number of observations to find the WMAE. To give some context or the difficulty of this data set, with over 800 people submitting predictions to be scored, a prediction of straight zeros (so no predictions whatsoever) would have been the 323rd best score on the leaderboard.

The Approach

My approach was to run two different models on the data set: one to predict the minute returns and the other to predict the T+1 and T+2 returns. For the T+1 and T+2 returns, I decided to use an XGBoost with stacking, due to this method's reputation for accuracy. For the minute returns, I settled on something I found in research, an Echo State Network model (a specific type of Recurrent Neural Net).

Echo State Network

A Recurrent Neural Network (RNN) is a type of Neural Network (NN) that can recursively call the output from a hidden layer of neurons and use that information to feed back into that same layer of neurons (1).

recurrent_neural_network

This is different than a feedforward structure in a typical NN where the output of each neuron on layer N feeds to each neuron in layer N+1 (dependent on whether the signal to that neuron have been triggered or not).

feedforward

The Echo State Network (ESN) is a special type of the RNN where all of the weights assigned to the input vector and the pre-specified hidden layers are randomly assigned and only the last layer's output regression weights are trained (2).

Screen Shot 2016-06-26 at 12.36.38 PM

The inputs to the ESN are summarized in this graphic

Screen Shot 2016-06-30 at 6.25.07 PM

Where the update equations are as follows

Screen Shot 2016-06-26 at 12.36.21 PM

and the final outputs are this

Screen Shot 2016-06-26 at 12.36.28 PM

The algorithm is run as follows:

Screen Shot 2016-06-30 at 6.31.33 PM

I chose an ESN to analyze the 60 individual minute returns of our data set for the simple reason that the recurrent nature of the network helps it to handle time series quite well (3). The ESN Algorithm has three main parameters to tune: the reservoir size (size of our hidden layer matrix), the spectral radius (this scales the weights of the reservoir matrix) and alpha, the leaking rate.

XGBoost

An XGBoost with stacking has historically performed very well for many people competing in Kaggle competitions. Due to the prolificacy of the XGBoost algorithm, I will focus on the practical implementation steps in after the data was cleaned and our missingness addressed in R:

  1. Fit a sparse model matrix to our data frame Screen Shot 2016-06-30 at 7.17.49 PM
  2. Run a Matrix
    Screen Shot 2016-06-30 at 7.19.32 PM
  3. Set the parameters

Screen Shot 2016-06-30 at 7.25.30 PM4. Train our model

Screen Shot 2016-06-30 at 7.27.28 PM

The tuning parameters that I found to give the greatest accuracy for my XGBoost model was grounds = 500, a max_depth = 9, and an eta = 0.1.

Results

For my ESN model, I optimized the parameters according to the minimization of the WMAE function. In order to determine whether our model was an improvement over our benchmark (guessing zero for each return), I graphed the WMAE of our model predictions over a subset of our training data:

Reservoir Size

Screen Shot 2016-06-26 at 3.36.54 PM

We can see here that a reservoir size of 130 is the reservoir size that gets the closes to beating our benchmark.

Spectral Radius

Screen Shot 2016-06-26 at 4.05.15 PM

After choosing my spectral radius, I settled on a radius factor of 1.25 value which once again, gets me the closest to beating our zero benchmark.

Alpha Parameter: Leaking Rate

Screen Shot 2016-06-26 at 3.20.38 PM

Lastly I tuned the alpha parameter and was unable to beat a zero benchmark. Unfortunately this meant that Echo State Network failed to add predictive accuracy to my data set. The main reason for this I believe is that the model was only able to learn for 120 observations for each stock. This is not nearly enough training data as per the examples I encountered in order to gain predictive power. Other examples I saw has a minimum of several thousand observations.

Considering that adding the predictions including the individual minute returns would only increase my WMAE and decrease my final submission rank, I chose to only submit my T+1 returns using an XGBoost:

Screen Shot 2016-06-26 at 4.12.08 PM

My final rank was a 747th on the leaderboard.

Improvements and Future Work

In order to improve my XGBoost algorithm, I need to spend more time analyzing important variables and tuning my XGBoost. I'm confident that with more time dedicated to these steps, I could break through the 0-guess benchmark that placed in the top 50% of all submissions.

The more interesting part to me is exploring how to create an ESN algorithm that can both capture the pattern,  and in predict the movements of a stationary time series data set. Research in this area is limited, but preliminary results indicate this is possible. I believe that financial assets (stocks, bonds, currencies - I realize these are not all technically 'assets', but they would still suffice) with long time series histories and multiple potential explanatory variables would be a promising data bank to work from.

Thank you for taking the time to read this blog. If you have additional questions or comments, feel free to reach out to me at zach.escalante@gmail.com

References:

(1) http://blog.josephwilk.net/ruby/recurrent-neural-networks-in-ruby.html

(2) http://minds.jacobs-university.de/sites/default/files/uploads/papers/PracticalESN.pdf

(3) http://minds.jacobs-university.de/ESNresearch

 

About Author

Zachary Escalante

Zach Escalante's path to the field of Data Analysis has not been a conventional one. Born and raised in South Florida, Zach did his first bachelor's degree in Finance at Florida Atlantic University (FAU). Following the completion of...
View all posts by Zachary Escalante >

Related Articles

Data Analysis
Injury Analysis of Soccer Players with Python
Machine Learning
Ames House Prices Predictions
Python
US Honey Production Analysis With Python (1998-2012)
Machine Learning
The Ames Data Set: Sales Price Tackled With Diverse Models
Python
EDA and machine learning Ames housing price prediction project

Leave a Comment

Cancel reply

You must be logged in to post a comment.

No comments found.

View Posts by Categories

All Posts 2399 posts
AI 7 posts
AI Agent 2 posts
AI-based hotel recommendation 1 posts
AIForGood 1 posts
Alumni 60 posts
Animated Maps 1 posts
APIs 41 posts
Artificial Intelligence 2 posts
Artificial Intelligence 2 posts
AWS 13 posts
Banking 1 posts
Big Data 50 posts
Branch Analysis 1 posts
Capstone 206 posts
Career Education 7 posts
CLIP 1 posts
Community 72 posts
Congestion Zone 1 posts
Content Recommendation 1 posts
Cosine SImilarity 1 posts
Data Analysis 5 posts
Data Engineering 1 posts
Data Engineering 3 posts
Data Science 7 posts
Data Science News and Sharing 73 posts
Data Visualization 324 posts
Events 5 posts
Featured 37 posts
Function calling 1 posts
FutureTech 1 posts
Generative AI 5 posts
Hadoop 13 posts
Image Classification 1 posts
Innovation 2 posts
Kmeans Cluster 1 posts
LLM 6 posts
Machine Learning 364 posts
Marketing 1 posts
Meetup 144 posts
MLOPs 1 posts
Model Deployment 1 posts
Nagamas69 1 posts
NLP 1 posts
OpenAI 5 posts
OpenNYC Data 1 posts
pySpark 1 posts
Python 16 posts
Python 458 posts
Python data analysis 4 posts
Python Shiny 2 posts
R 404 posts
R Data Analysis 1 posts
R Shiny 560 posts
R Visualization 445 posts
RAG 1 posts
RoBERTa 1 posts
semantic rearch 2 posts
Spark 17 posts
SQL 1 posts
Streamlit 2 posts
Student Works 1687 posts
Tableau 12 posts
TensorFlow 3 posts
Traffic 1 posts
User Preference Modeling 1 posts
Vector database 2 posts
Web Scraping 483 posts
wukong138 1 posts

Our Recent Popular Posts

AI 4 AI: ChatGPT Unifies My Blog Posts
by Vinod Chugani
Dec 18, 2022
Meet Your Machine Learning Mentors: Kyle Gallatin
by Vivian Zhang
Nov 4, 2020
NICU Admissions and CCHD: Predicting Based on Data Analysis
by Paul Lee, Aron Berke, Bee Kim, Bettina Meier and Ira Villar
Jan 7, 2020

View Posts by Tags

#python #trainwithnycdsa 2019 2020 Revenue 3-points agriculture air quality airbnb airline alcohol Alex Baransky algorithm alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus ames dataset ames housing dataset apartment rent API Application artist aws bank loans beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep boston safety Bundles cake recipe California Cancer Research capstone car price Career Career Day ChatGPT citibike classic cars classpass clustering Coding Course Demo Course Report covid 19 credit credit card crime frequency crops D3.js data data analysis Data Analyst data analytics data for tripadvisor reviews data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization database Deep Learning Demo Day Discount disney dplyr drug data e-commerce economy employee employee burnout employer networking environment feature engineering Finance Financial Data Science fitness studio Flask flight delay football gbm Get Hired ggplot2 googleVis H20 Hadoop hallmark holiday movie happiness healthcare frauds higgs boson Hiring hiring partner events Hiring Partners hotels housing housing data housing predictions housing price hy-vee Income industry Industry Experts Injuries Instructor Blog Instructor Interview insurance italki Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter las vegas airport lasso regression Lead Data Scienctist Lead Data Scientist leaflet league linear regression Logistic Regression machine learning Maps market matplotlib Medical Research Meet the team meetup methal health miami beach movie music Napoli NBA netflix Networking neural network Neural networks New Courses NHL nlp NYC NYC Data Science nyc data science academy NYC Open Data nyc property NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time performance phoenix pollutants Portfolio Development precision measurement prediction Prework Programming public safety PwC python Python Data Analysis python machine learning python scrapy python web scraping python webscraping Python Workshop R R Data Analysis R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn seafood type Selenium sentiment analysis sentiment classification Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau teachers team team performance TensorFlow Testimonial tf-idf Top Data Science Bootcamp Top manufacturing companies Transfers tweets twitter videos visualization wallstreet wallstreetbets web scraping Weekend Course What to expect whiskey whiskeyadvocate wildfire word cloud word2vec XGBoost yelp youtube trending ZORI

NYC Data Science Academy

NYC Data Science Academy teaches data science, trains companies and their employees to better profit from data, excels at big data project consulting, and connects trained Data Scientists to our industry.

NYC Data Science Academy is licensed by New York State Education Department.

Get detailed curriculum information about our
amazing bootcamp!

Please enter a valid email address
Sign up completed. Thank you!

Offerings

  • HOME
  • DATA SCIENCE BOOTCAMP
  • ONLINE DATA SCIENCE BOOTCAMP
  • Professional Development Courses
  • CORPORATE OFFERINGS
  • HIRING PARTNERS
  • About

  • About Us
  • Alumni
  • Blog
  • FAQ
  • Contact Us
  • Refund Policy
  • Join Us
  • SOCIAL MEDIA

    ยฉ 2025 NYC Data Science Academy
    All rights reserved. | Site Map
    Privacy Policy | Terms of Service
    Bootcamp Application