Skip to content

Instantly share code, notes, and snippets.

@mdfarragher
Last active July 21, 2020 12:43
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/0dd66d792b45facb6e4675aefc1dbe4e to your computer and use it in GitHub Desktop.
Save mdfarragher/0dd66d792b45facb6e4675aefc1dbe4e to your computer and use it in GitHub Desktop.
// file paths to data files (assumes os = windows!)
let dataPath = sprintf "%s\\yellow_tripdata_2018-12_small.csv" Environment.CurrentDirectory
/// The main application entry point.
[<EntryPoint>]
let main argv =
// create the machine learning context
let context = new MLContext()
// load the data
let dataView = context.Data.LoadFromTextFile<TaxiTrip>(dataPath, hasHeader = true, separatorChar = ',')
// split into a training and test partition
let partitions = context.Data.TrainTestSplit(dataView, testFraction = 0.2)
// the rest of the code goes here...
0 // return value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment