Skip to content

Instantly share code, notes, and snippets.

Avatar

Mathias Brandewinder mathias-brandewinder

View GitHub Profile
@mathias-brandewinder
mathias-brandewinder / day.csv
Last active Dec 6, 2019
ML.NET in FSI / dotnetcore
View day.csv
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
View santa.fsx
// 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 Jul 11, 2020
Lorentz attractor in Fable-Elmish
View App.fs
(*
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
View advent.fsx
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 Dec 24, 2017
Baby steps with CNTK and F#
View cntk.fsx
// 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 = [
View version1.fsx
// 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 Jul 21, 2017
F# Meetup activities planning, Jul 2017
View notes.md

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 Apr 11, 2017
Visualize Azure Function App with F# and GraphViz
View graph.fsx
(*
Reading out bindings
*)
type Direction =
| Trigger
| In
| Out
type Properties = Map<string,string>
View presentation.md
  • title : Azure Functions
  • description : Introduction to Azure Functions with F#
  • author : Mathias Brandewinder
  • theme : night
  • transition : default

An intro to Azure Functions with F#