Created
January 18, 2015 16:19
-
-
Save JefClaes/1229fd20a7f271480b19 to your computer and use it in GitHub Desktop.
Averages are not good enough (3)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let frequencyDistribution input = | |
input |> | |
Seq.groupBy (fun x -> | |
match x with | |
| x when x < 30.0 -> [ 0, 30 ] | |
| x when x < 70.0 -> [ 30, 70 ] | |
| x when x < 90.0 -> [ 70, 90 ] | |
| _ -> [ 90, System.Int32.MaxValue ] ) |> | |
Seq.map (fun (x, y) -> x, y |> Seq.length) | |
// Frequency Distribution = seq [ | |
// ([(0, 30)], 2); | |
// ([(30, 70)], 5); | |
// ([(90, 2147483647)], 1)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment