all your types are belong to us!
TRANSCRIPT
![Page 1: All your types are belong to us!](https://reader034.vdocuments.site/reader034/viewer/2022051515/55491174b4c9055d458bedbe/html5/thumbnails/1.jpg)
ALL YOUR TYPES ARE BELONG TO US!
PHILLIP TRELFORD, @PTRELFORD
DDD DUNDEE 2013, #DUNDDD
![Page 2: All your types are belong to us!](https://reader034.vdocuments.site/reader034/viewer/2022051515/55491174b4c9055d458bedbe/html5/thumbnails/2.jpg)
F#UNCTIONAL LONDONERS
Meetup• 600 members
• 50 meetup
• Meets every 2 weeks
• Talks & Hands On
Topics• Finance
• Machine Learning
• Big Data
• Gaming
![Page 3: All your types are belong to us!](https://reader034.vdocuments.site/reader034/viewer/2022051515/55491174b4c9055d458bedbe/html5/thumbnails/3.jpg)
FSHARP.ORG/GROUPS
![Page 4: All your types are belong to us!](https://reader034.vdocuments.site/reader034/viewer/2022051515/55491174b4c9055d458bedbe/html5/thumbnails/4.jpg)
F# TESTIMONIALS – MACHINE LEARNINGPHILLIP TRELFORD, @PTRELFORD
DDD DUNDEE 2013, #DUNDDD
![Page 5: All your types are belong to us!](https://reader034.vdocuments.site/reader034/viewer/2022051515/55491174b4c9055d458bedbe/html5/thumbnails/5.jpg)
FSHARP.ORG/TESTIMONIALS
For a machine learning scientist, speed of experimentation is the critical factor to optimize.
Compiling is fast but loading large amounts of data in memory takes a long time.
With F#’s REPL, you only need to load the data once
and you can then code and explore in the interactive environment.
Unlike C# and C++, F# was designed for this mode of interaction.
- Patrice Simard, Microsoft
![Page 6: All your types are belong to us!](https://reader034.vdocuments.site/reader034/viewer/2022051515/55491174b4c9055d458bedbe/html5/thumbnails/6.jpg)
FSHARP.ORG/TESTIMONIALS - AMYRIS BIOTECH
F# has been phenomenally useful.
I would be writing a lot of this in Python otherwise
and F# is more robust, 20x - 100x faster to run
and for anything but the most trivial programs,
faster to develop.
- Darren Platt, Amyris Biotechnology
![Page 7: All your types are belong to us!](https://reader034.vdocuments.site/reader034/viewer/2022051515/55491174b4c9055d458bedbe/html5/thumbnails/7.jpg)
CASE STUDIESPHILLIP TRELFORD, @PTRELFORD
DDD DUNDEE 2013, #DUNDDD
![Page 8: All your types are belong to us!](https://reader034.vdocuments.site/reader034/viewer/2022051515/55491174b4c9055d458bedbe/html5/thumbnails/8.jpg)
F# TOOLS FOR HALO 3
Questions
• Controllable player skill distribution (slow down!)
• Controllable skills distributions (re-ordering)
Simulations
• Large scale simulation of 8,000,000,000 matches
• Distributed computation – 15 machines for 2wks
Tools
• Result viewer (Logged results: 52GB of data)
• Real-time simulator of partial update
![Page 9: All your types are belong to us!](https://reader034.vdocuments.site/reader034/viewer/2022051515/55491174b4c9055d458bedbe/html5/thumbnails/9.jpg)
ADCENTER
Weeks of data in training:
• 7,000,000,000 impressions
2 weeks of CPU time during sessions
• 2 wks x 7 days x 86,400 sec/day
Learning algorithm speed requirement:
• 5,787 impression updates /sec
• 172.8 µs per impression update
![Page 10: All your types are belong to us!](https://reader034.vdocuments.site/reader034/viewer/2022051515/55491174b4c9055d458bedbe/html5/thumbnails/10.jpg)
LIVE DEMOSPHILLIP TRELFORD, @PTRELFORD
DDD DUNDEE 2013, #DUNDDD
![Page 11: All your types are belong to us!](https://reader034.vdocuments.site/reader034/viewer/2022051515/55491174b4c9055d458bedbe/html5/thumbnails/11.jpg)
TYPE PROVIDERS: JSON
open FSharp.Data
type Simple = JsonProvider<“sample.js”>
let simple = Simple.Parse(""" { "name":"Tomas", "age":4 } """)
simple.Age
![Page 12: All your types are belong to us!](https://reader034.vdocuments.site/reader034/viewer/2022051515/55491174b4c9055d458bedbe/html5/thumbnails/12.jpg)
CSV TYPE PROVIDER
![Page 13: All your types are belong to us!](https://reader034.vdocuments.site/reader034/viewer/2022051515/55491174b4c9055d458bedbe/html5/thumbnails/13.jpg)
SPLIT DATA SET (FROM ML IN ACTION)
Pythondef splitDataSet(dataSet, axis, value):
retDataSet = []
for featVec in dataSet:
if featVec[axis] == value:
reducedFeatVec = featVec[:axis]
reducedFeatVec.extend(featVec[axis+1:])
retDataSet.append(reducedFeatVec)
return retDataSet
F#let splitDataSet(dataSet, axis, value) =
[|for featVec in dataSet do
if featVec.[axis] = value then
yield featVec |> Array.removeAt axis|]
![Page 14: All your types are belong to us!](https://reader034.vdocuments.site/reader034/viewer/2022051515/55491174b4c9055d458bedbe/html5/thumbnails/14.jpg)
K-MEANS CLUSTERING ALGORITHM
(* K-Means Algorithm *)
/// Group all the vectors by the nearest center.
let classify centroids vectors =
vectors |> Array.groupBy (fun v -> centroids |> Array.minBy (distance v))
/// Repeatedly classify the vectors, starting with the seed centroids
let computeCentroids seed vectors =
seed |> Seq.iterate (fun centers -> classify centers vectors
|> Array.map (snd >> average))
![Page 15: All your types are belong to us!](https://reader034.vdocuments.site/reader034/viewer/2022051515/55491174b4c9055d458bedbe/html5/thumbnails/15.jpg)
R – TYPE PROVIDER
![Page 16: All your types are belong to us!](https://reader034.vdocuments.site/reader034/viewer/2022051515/55491174b4c9055d458bedbe/html5/thumbnails/16.jpg)
WORLD BANK DATA
![Page 17: All your types are belong to us!](https://reader034.vdocuments.site/reader034/viewer/2022051515/55491174b4c9055d458bedbe/html5/thumbnails/17.jpg)
RESOURCESPHILLIP TRELFORD, @PTRELFORD
DDD DUNDEE 2013, #DUNDDD
![Page 18: All your types are belong to us!](https://reader034.vdocuments.site/reader034/viewer/2022051515/55491174b4c9055d458bedbe/html5/thumbnails/18.jpg)
TYPE PROVIDERS
• JSON
• XML
• CSV
• Excel
• SQL
• R
• MATLAB
• Hadoop
• ...
![Page 19: All your types are belong to us!](https://reader034.vdocuments.site/reader034/viewer/2022051515/55491174b4c9055d458bedbe/html5/thumbnails/19.jpg)
TRYFSHARP.ORG
![Page 20: All your types are belong to us!](https://reader034.vdocuments.site/reader034/viewer/2022051515/55491174b4c9055d458bedbe/html5/thumbnails/20.jpg)
BUY THE BOOK
![Page 21: All your types are belong to us!](https://reader034.vdocuments.site/reader034/viewer/2022051515/55491174b4c9055d458bedbe/html5/thumbnails/21.jpg)
GET THE T-SHIRT
![Page 22: All your types are belong to us!](https://reader034.vdocuments.site/reader034/viewer/2022051515/55491174b4c9055d458bedbe/html5/thumbnails/22.jpg)
MACHINE LEARNING JOB TRENDS
• Source indeed.co.uk
![Page 23: All your types are belong to us!](https://reader034.vdocuments.site/reader034/viewer/2022051515/55491174b4c9055d458bedbe/html5/thumbnails/23.jpg)
QUESTIONSPHILLIP TRELFORD, @PTRELFORD
DDD DUNDEE 2013, #DUNDDD