-
-
Save mdfarragher/dc9c559325e2ded674f8a9e8e76b4b5d to your computer and use it in GitHub Desktop.
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
// grab five digits from the test data | |
let digits = context.Data.CreateEnumerable(testData, reuseRowObject = false) |> Array.ofSeq | |
let testDigits = [ digits.[5]; digits.[16]; digits.[28]; digits.[63]; digits.[129] ] | |
// create a prediction engine | |
let engine = context.Model.CreatePredictionEngine model | |
// show predictions | |
printfn "Model predictions:" | |
printf " #\t\t"; [0..9] |> Seq.iter(fun i -> printf "%i\t\t" i); printfn "" | |
testDigits |> Seq.iter( | |
fun digit -> | |
printf " %i\t" (int digit.Number) | |
let p = engine.Predict digit | |
p.Score |> Seq.iter (fun s -> printf "%f\t" s) | |
printfn "") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment