Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Machine Learning with Elixir and Phoenix

Machine Learning with Elixir and Phoenix

Slides for my ElixirConf EU 2017 talk on machine learning.

Eric Weinstein

May 04, 2017
Tweet

More Decks by Eric Weinstein

Other Decks in Technology

Transcript

  1. 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
  2. About Me eric_weinstein = %{employer: "Hulu", github: "ericqweinstein", twitter: "ericqweinstein",

    website: "ericweinste.in"} 30% off with EURORUBY30! |#######......................................| 16%
  3. Agenda • Machine learning and neural networks • A wee

    bit o’ finance • The Phoenix application |#########....................................| 20%
  4. What’s Supervised Learning? Classification or regression, generalizing from labeled data

    to unlabeled data |#################............................| 37%
  5. 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%
  6. Features && Labels • Bollinger Bands® • Simple moving average

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

    (SMA) • Relative strength index (RSI) • 20-day return |#####################........................| 47%
  8. 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%
  9. 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%
  10. 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%
  11. 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%
  12. 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%
  13. 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%
  14. Summary • Machine learning is fun and practical • It’s

    super doable with Elixir + BEAM • Library support is what we really need |##########################################...| 93%
  15. Takeaways (TL;DPA) • Be the change you want to see

    in the community! • https://github.com/ericqweinstein/elixirconfeu • http://quantsoftware.gatech.edu |############################################.| 98%