Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero to data science

Embed Size (px)

Citation preview

Try F#:
From Zero to Data Science

Phil Trelford | @ptrelford | trelford.com/blog/ | github: ptrelfordRachel Reese | @rachelreese | rachelree.se | github: rachelreese

2:30pmIntro and Setup

2:45Set 1: Getting Started in F#

3:10F# in Finance

3:25Set 2: Data Visualization

3:55Break

4:05Intro to Type Providers

4:20Set 3: Data Science

4:50Challenge!

5:20Wrap up

5:30Fin!

Agenda

Pair Up!

Recommend Chrome or IE

Explore Try F# site.

Set up

F#

Succinct & expressive

Statically typed

Readable

Open source

Why F#?

Bindings and values and REPLs! Oh my!

Print a statement with a float.

Fun with Functional Functions

Add to the toHackerTalk function by changing e -> 3 and l -> 1.

Chaining Functions with the Forward Pipe Operator

Find the difference between the max high and the min low for all the days.

Find the difference between open and close on the day with the highest volume.

Using Data Structures to Create Larger Programs

Add a SuperLeaf to powerUp; test handlePowerUp.

Set 1: Getting Started

F# in finance

Progressive F# TutorialsNYC 2013

F#UNCTIONAL lONDONERS

600+ MembersFounded Feb 4, 201048 Meetings

New York City F# User Group

500+ MembersFounded Nov 10, 201025 Meetings

Investment Banks

Hedge funds

Prop shops

Utilities

Insurance

Who?

F# for Profit

Time to Market

Efficiency

Correctness

Complexity

Time to market

speed development by 50 percent or more, European IB

order of magnitude increase in productivity, GameSys

Efficiency

processes that used to require hours now take just minutes, Grange Insurance

performance is 10 better than the C++ that it replaces, Aviva

Correctness

leads to virtually bug-free code, Fixed Income

I am still waiting for the first bug to come in, E-On

Complexity

everything becomes simple and clear when expressed in F#, Byron Cook

fsharp.org/testimonials

speed development by 50 percent or more, European IB

order of magnitude increase in productivity, GameSys

processes that used to require hours now take just minutes, Grange Insurance

performance is 10 better than the C++ that it replaces, Aviva

leads to virtually bug-free code, Fixed Income

I am still waiting for the first bug to come in, E-On

complex algorithms can be expressed succinctly, Microsofteverything becomes simple and clear when expressed in F#, Byron Cook

Tickspec: debug examples

Joule Energy Trading Screen

Leverage

Units of Measure

.Net 4.5 Garbage Collector

Latency ModeApplication Scenarios

BatchCommand lineServer Side

InteractiveLOB applications

LowLatencyTrading Screens

SustainedLowLatencyFinancial Applications

F# in Excel

Try F#: http://tryfsharp.org

Charting Quick-Start

Add a vertical line to the Combining Charts example to make an asterisk, then center the figure on the chart.

Introduction to Data Visualization

Add a title to the Column chart.

Sampling Functions and Performance

Using DateTime.Now.Ticks, find the difference in processing time for the final samples.

Set 2: Data Visualization

Break

2:30pmIntro and Setup

2:45Set 1: Getting Started in F#

3:10F# in Finance

3:25Set 2: Data Visualization

3:55Break

4:05Intro to Type Providers

4:20Set 3: Data Science

4:50Challenge!

5:20Wrap up

5:30Fin!

Agenda

Type Providers

TYPE ALL THE DATA

What are type providers?

A mechanism to provide types to the compiler.

For me, part of the role of F# is about proving that statically-typed languages can play fully in the modern world of connected programming, without losing the simplicity, elegance or tooling that come with strong types.

Type providers are an essential part of tackling this, because we can no longer ignore the information-richness of external data sources, and have to change language and compiler architecture to adapt. - Don Syme

Why do we need them?

Intellisense, tooltips, & other tooling available

No code generationAlways in sync with the source

No extra bloated code

Scalable to millions of types (e.g. - freebase)

More natural with REPL

Benefits

Type Providers are about replacing our conventional notion of a library with a provider model. This allows a type provider to project an external information source into F# and makes it easier to access diverse sources of data.

Demo

WSDL Mash-upUsing F# to visualize World Bank data in R

Set 3: Data Science

Challenge!

Use tryfsharp.org/Create to find the name of the country with the max gasoline price in 2010.Bonus: Graph the top 10 countries in that list with a bar or column chart.

Additional Resources

MSDN F# home: http://fsharp.net

F# 3 Sample Pack: F# 3.0 Sample Pack

F# Koans: https://github.com/ChrisMarinos/FSharpKoans

Try F#: http://www.tryfsharp.org or http://tryfs.net/

Skills Matter: http://skillsmatter.com/go/scala

Community contributed samples: http://fssnip.net/

Wikibook: http://en.wikibooks.org/wiki/Programming:F_Sharp

Chat rooms: http://jabbr.net/ or http://irc.freenode.net

FPish: http://fpish.net/home/1/f~23

Try F#:
From Zero to Data Science

Rachel Reese | @rachelreese | rachelree.se | github: rachelreese

Click to edit the title text formatClick to edit Master title style

Click to edit the outline text formatSecond Outline LevelThird Outline LevelFourth Outline LevelFifth Outline LevelSixth Outline Level

Seventh Outline LevelClick to edit Master text styles

01/10/13

Click to edit the title text formatClick to edit Master title style

Click to edit the outline text formatSecond Outline LevelThird Outline LevelFourth Outline LevelFifth Outline LevelSixth Outline Level

Seventh Outline LevelClick to edit Master text styles

Second level

Third level

Fourth level

Fifth level

01/10/13

Click to edit the title text formatClick to edit Master title style

01/10/13

Click to edit the title text formatClick to edit Master title style

Click to edit the outline text formatSecond Outline LevelThird Outline LevelFourth Outline LevelFifth Outline LevelSixth Outline Level

Seventh Outline LevelClick to edit Master text styles

Second level

Third level

Fourth level

Fifth level

Click to edit the outline text formatSecond Outline LevelThird Outline LevelFourth Outline LevelFifth Outline LevelSixth Outline Level

Seventh Outline LevelClick to edit Master text styles

01/10/13

Click to edit the title text formatClick to edit Master title style

Click to edit the outline text formatSecond Outline LevelThird Outline LevelFourth Outline LevelFifth Outline LevelSixth Outline Level

Seventh Outline LevelClick to edit Master text styles

Second level

Third level

Fourth level

Fifth level

01/10/13

Click to edit the title text formatClick to edit Master title style

Click to edit the outline text formatSecond Outline LevelThird Outline LevelFourth Outline LevelFifth Outline LevelSixth Outline Level

Seventh Outline LevelClick to edit Master text styles

Second level

Third level

Fourth level

Fifth level

Click to edit the outline text formatSecond Outline LevelThird Outline LevelFourth Outline LevelFifth Outline LevelSixth Outline Level

Seventh Outline LevelClick to edit Master text styles

Second level

Third level

Fourth level

Fifth level

01/10/13

Click to edit the title text formatClick to edit Master title style

01/10/13

Click to edit the title text formatClick to edit Master title style

Click to edit the outline text formatSecond Outline LevelThird Outline LevelFourth Outline LevelFifth Outline LevelSixth Outline Level

Seventh Outline LevelClick to edit Master text styles

Click to edit the outline text formatSecond Outline LevelThird Outline LevelFourth Outline LevelFifth Outline LevelSixth Outline Level

Seventh Outline LevelClick to edit Master text styles

01/10/13

Click to edit the title text formatClick to edit Master title style

Click to edit the outline text formatSecond Outline LevelThird Outline LevelFourth Outline LevelFifth Outline LevelSixth Outline Level

Seventh Outline LevelClick to edit Master text styles

01/10/13