Slide 1

Slide 1 text

def talk(struct) do struct |> title("Machine Learning with Elixir and Phoenix") |> speaker("Eric Weinstein") |> conf("ElixirConf EU") |> city("Barcelona, España") |> date("4 May 2017") end

Slide 2

Slide 2 text

for Joshua |##...........................................| 4%

Slide 3

Slide 3 text

Part 0: Hello! |###..........................................| 7%

Slide 4

Slide 4 text

May the 4th Be With You |#####........................................| 11%

Slide 5

Slide 5 text

About Me eric_weinstein = %{employer: "Hulu", github: "ericqweinstein", twitter: "ericqweinstein", website: "ericweinste.in"} 30% off with EURORUBY30! |#######......................................| 16%

Slide 6

Slide 6 text

Agenda • Machine learning and neural networks • A wee bit o’ finance • The Phoenix application |#########....................................| 20%

Slide 7

Slide 7 text

Part 1: Machine Learning |###########..................................| 24%

Slide 8

Slide 8 text

What is it? |############.................................| 27%

Slide 9

Slide 9 text

In a word: |#############................................| 29%

Slide 10

Slide 10 text

Generalization |###############..............................| 33%

Slide 11

Slide 11 text

What’s Supervised Learning? Classification or regression, generalizing from labeled data to unlabeled data |#################............................| 37%

Slide 12

Slide 12 text

Our Data • Data from the S&P 500 from 2015 and 2016 • 3 features, 252 instances • https://finance.yahoo.com/quote/SPY/history? p=SPY |##################...........................| 40%

Slide 13

Slide 13 text

Features && Labels • Bollinger Bands® • Simple moving average (SMA) • Relative strength index (RSI) • 20-day return |####################.........................| 44%

Slide 14

Slide 14 text

Features && Labels • Bollinger Bands® • Simple moving average (SMA) • Relative strength index (RSI) • 20-day return |#####################........................| 47%

Slide 15

Slide 15 text

Neural Networks • Computational model based on biological brains • Can model any continuous function (with at least two layers), relatively fast to query, and can model interaction among inputs • However, they are also finicky (often requiring lots of tuning and are prone to overfitting), expensive to train, and black boxes |#######################......................| 50%

Slide 16

Slide 16 text

|########################.....................| 53% Visualization Image credit: https://en.wikipedia.org/wiki/Artificial_neural_network

Slide 17

Slide 17 text

Training Rules • Buy when predicted 20-day return is positive • Sell when predicted 20-day return is negative • Do nothing when predicted 20-day return is zero (or very close to it) |##########################...................| 57%

Slide 18

Slide 18 text

Part 2: Finan¢e |###########################..................| 60%

Slide 19

Slide 19 text

Caveat Emptor • I am not a financial professional • No guarantees or warrantees, express or implied, about the completeness or correctness of my experiments • If you repeat them, you can (and probably will) lose money at some point |#############################................| 64%

Slide 20

Slide 20 text

Some Jargon S&P 500: American index comprising 500 large companies Adjusted close: closing price adjusted for historical events (such as stock splits) Stock split: Event where a company splits each existing share into multiple shares (e.g. 2:1) Lookahead bias: Bias introduced by using data that wouldn’t have yet been available in a simulation |##############################...............| 67%

Slide 21

Slide 21 text

Our Indicators Simple moving average: Arithmetic moving average over a specific window Bollinger Bands®: N standard deviations above and below the SMA (oftentimes N = 2) RSI: Momentum indicator that measures speed and change of price movements |################################.............| 71%

Slide 22

Slide 22 text

Part 3: |#################################............| 74%

Slide 23

Slide 23 text

|###################################..........| 77%

Slide 24

Slide 24 text

|####################################.........| 80%

Slide 25

Slide 25 text

|#####################################........| 83%

Slide 26

Slide 26 text

|#######################################......| 87%

Slide 27

Slide 27 text

How’d We Do? • S&P 500 2015 return: -0.73% • Our return (training): 2.9% • S&P 500 2016 return: 9.84% • Our return (testing): 16.0% |########################################.....| 90%

Slide 28

Slide 28 text

Summary • Machine learning is fun and practical • It’s super doable with Elixir + BEAM • Library support is what we really need |##########################################...| 93%

Slide 29

Slide 29 text

Takeaways (TL;DPA) • Be the change you want to see in the community! • https://github.com/ericqweinstein/elixirconfeu • http://quantsoftware.gatech.edu |############################################.| 98%

Slide 30

Slide 30 text

IO.puts("Thanks!") |#############################################| 100%