-
-
Save mdfarragher/af26aee10dc207bd635b0eceb2e1479a 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 learning pipeline | |
let pipeline = | |
EstimatorChain() | |
// one-hot encode all text features | |
.Append(context.Transforms.Categorical.OneHotEncoding("VendorId")) | |
.Append(context.Transforms.Categorical.OneHotEncoding("RateCode")) | |
.Append(context.Transforms.Categorical.OneHotEncoding("PaymentType")) | |
// combine all input features into a single column | |
.Append(context.Transforms.Concatenate("Features", "VendorId", "RateCode", "PaymentType", "PassengerCount", "TripDistance")) | |
// cache the data to speed up training | |
.AppendCacheCheckpoint(context) | |
// use the fast tree learner | |
.Append(context.Regression.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