Skip to content

Instantly share code, notes, and snippets.

@mdfarragher
Last active July 21, 2020 12:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdfarragher/c18ce57a356e96c6982b15ea12bfa29a to your computer and use it in GitHub Desktop.
Save mdfarragher/c18ce57a356e96c6982b15ea12bfa29a to your computer and use it in GitHub Desktop.
// create a prediction engine for one single prediction
let engine = context.Model.CreatePredictionEngine model
let taxiTripSample = {
VendorId = "VTS"
RateCode = "1"
PassengerCount = 1.0f
TripDistance = 3.75f
PaymentType = "CRD"
FareAmount = 0.0f // To predict. Actual/Observed = 15.5
}
// make the prediction
let prediction = taxiTripSample |> engine.Predict
// show the prediction
printfn "\r"
printfn "Single prediction:"
printfn " Predicted fare: %f" prediction.FareAmount
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment