Created
December 3, 2019 14:08
-
-
Save icebeam7/82619f681631bdc2d21e3103296c0e17 to your computer and use it in GitHub Desktop.
MovieRecommender: LoadData code
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 (IDataView training, IDataView test) LoadData(MLContext mlContext) | |
{ | |
var dataPath = Path.Combine(Environment.CurrentDirectory, "Data"); | |
var catalog = mlContext.Data; | |
var trainingData = Path.Combine(dataPath, "recommendation-ratings-train.csv"); | |
var trainingDataView = catalog.LoadFromTextFile<MovieRating>( | |
trainingData, hasHeader: true, separatorChar: ','); | |
var testData = Path.Combine(dataPath, "recommendation-ratings-test.csv"); | |
var testDataView = catalog.LoadFromTextFile<MovieRating>( | |
testData, hasHeader: true, separatorChar: ','); | |
return (trainingDataView, testDataView); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment