Skip to content

Instantly share code, notes, and snippets.

View mathias-brandewinder's full-sized avatar

Mathias Brandewinder mathias-brandewinder

View GitHub Profile
@mathias-brandewinder
mathias-brandewinder / day.csv
Last active December 6, 2019 23:37
ML.NET in FSI / dotnetcore
instant dteday season yr mnth holiday weekday workingday weathersit temp atemp hum windspeed casual registered cnt
1 2011-01-01 1 0 1 0 6 0 2 0.344167 0.363625 0.805833 0.160446 331 654 985
2 2011-01-02 1 0 1 0 0 0 2 0.363478 0.353739 0.696087 0.248539 131 670 801
3 2011-01-03 1 0 1 0 1 1 1 0.196364 0.189405 0.437273 0.248309 120 1229 1349
4 2011-01-04 1 0 1 0 2 1 1 0.2 0.212122 0.590435 0.160296 108 1454 1562
5 2011-01-05 1 0 1 0 3 1 1 0.226957 0.22927 0.436957 0.1869 82 1518 1600
6 2011-01-06 1 0 1 0 4 1 1 0.204348 0.233209 0.518261 0.0895652 88 1518 1606
7 2011-01-07 1 0 1 0 5 1 2 0.196522 0.208839 0.498696 0.168726 148 1362 1510
8 2011-01-08 1 0 1 0 6 0 2 0.165 0.162254 0.535833 0.266804 68 891 959
9 2011-01-09 1 0 1 0 0 0 1 0.138333 0.116175 0.434167 0.36195 54 768 822
@mathias-brandewinder
mathias-brandewinder / santa.fsx
Created December 4, 2019 01:04
Santa's Mailbox
// This is the code sample for my #fsAdvent 2019 contribution.
// Check the corresponding blog post for some explanations :)
// https://brandewinder.com/2019/12/04/santas-mailbox/
open System
open System.Threading.Tasks
open System.Diagnostics
open System.Collections.Generic
let factorize x =
@mathias-brandewinder
mathias-brandewinder / App.fs
Last active July 11, 2020 13:56
Lorentz attractor in Fable-Elmish
(*
Simulation of the Lorentz attractor, using Fable.
If you want to see this code in action, just copy this code into the Fable REPL:
https://fable.io/repl/
*)
module App
open Elmish
open Elmish.React
@mathias-brandewinder
mathias-brandewinder / advent.fsx
Created January 7, 2018 20:09
Advent of Code 2017
module part1 =
let captcha (input:string) =
let len = input.Length
let circular i = i % len
input
|> Seq.toArray
|> Array.fold (fun (index,count) x ->
index + 1,
if x = input.[circular (index + 1)]
@mathias-brandewinder
mathias-brandewinder / cntk.fsx
Created December 24, 2017 03:27
Baby steps with CNTK and F#
// Code for the post http://brandewinder.com/2017/12/23/baby-steps-with-cntk-and-fsharp/
open System
open System.IO
open System.Collections.Generic
Environment.SetEnvironmentVariable("Path",
Environment.GetEnvironmentVariable("Path") + ";" + __SOURCE_DIRECTORY__)
let dependencies = [
@mathias-brandewinder
mathias-brandewinder / version1.fsx
Last active October 11, 2017 11:30
CNTK Logistic
// C# original: https://github.com/Microsoft/CNTK/blob/master/Examples/TrainingCSharp/Common/LogisticRegression.cs
// I assume CNTK.CPUOnly has been installed via Paket
// required dependencies:
// packages\CNTK.CPUOnly\lib\net45\x64
// packages\CNTK.CPUOnly\support\x64\Dependency
// packages\CNTK.CPUOnly\support\x64\Dependency\Release
// packages\CNTK.CPUOnly\support\x64\Release
// loading native dependencies in a script is a bit annoying,
@mathias-brandewinder
mathias-brandewinder / notes.md
Created July 21, 2017 18:37
F# Meetup activities planning, Jul 2017

Reboot meetings, aiming for regularity: alternate monthly, 1 talk, 1 hands-on, 1 breakfast. Tentatively: Aug: hands-on (Slack bot) Sep: rehearsal / teaser for the open fsharp conference Oct: breakfast? Nov: hands-on (F# Notebooks + ML)

Use Github more: we have an organization, https://github.com/sfsharp, let's use it.

Topics / Speakers / Formats

@mathias-brandewinder
mathias-brandewinder / graph.fsx
Created April 11, 2017 21:43
Visualize Azure Function App with F# and GraphViz
(*
Reading out bindings
*)
type Direction =
| Trigger
| In
| Out
type Properties = Map<string,string>
@mathias-brandewinder
mathias-brandewinder / presentation.md
Created September 19, 2016 19:41
intro to Azure Functions
  • title : Azure Functions
  • description : Introduction to Azure Functions with F#
  • author : Mathias Brandewinder
  • theme : night
  • transition : default

An intro to Azure Functions with F#