-
-
Save mdfarragher/a3315286e9c987fe02968727b2d20ede 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
// set up a training pipeline | |
let pipeline = | |
EstimatorChain() | |
// step 1: convert the label value to a boolean | |
.Append( | |
context.Transforms.CustomMapping( | |
Action<HeartData, ToLabel>(fun input output -> output.Label <- input.Diagnosis > 0.0f), | |
"LabelMapping")) | |
// step 2: concatenate all feature columns | |
.Append(context.Transforms.Concatenate("Features", "Age", "Sex", "Cp", "TrestBps", "Chol", "Fbs", "RestEcg", "Thalac", "Exang", "OldPeak", "Slope", "Ca", "Thal")) | |
// step 3: set up a fast tree learner | |
.Append(context.BinaryClassification.Trainers.FastTree()) | |
// train the model | |
let model = partitions.TrainSet |> pipeline.Fit | |
// the rest of the code goes here.... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment