Created
April 30, 2019 09:34
-
-
Save AndyButland/9ac355c6c6981855db91dd181af10bec 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
public static void Main(string[] args) | |
{ | |
var context = new MLContext(); | |
var data = GetTrainAndTestData(context, InputDataPath); | |
... | |
} | |
private static TrainCatalogBase.TrainTestData GetTrainAndTestData(MLContext context, string dataPath) | |
{ | |
// Load data from the CSV file. | |
var dataView = context.Data.LoadFromTextFile<CountryData>(dataPath, hasHeader: true, separatorChar: ','); | |
// Split the data randomly, in 90:10 ratio, for training and evaluation data respectively. | |
return context.MulticlassClassification.TrainTestSplit(dataView, testFraction: 0.1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment