Skip to content

Instantly share code, notes, and snippets.

@icebeam7
Created December 3, 2019 14:59
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 icebeam7/61f59dde38e27ffa4b81251510387cc1 to your computer and use it in GitHub Desktop.
Save icebeam7/61f59dde38e27ffa4b81251510387cc1 to your computer and use it in GitHub Desktop.
MovieRecommender: SaveModel code
public static void SaveModel(MLContext mlContext, DataViewSchema trainingDataViewSchema, ITransformer model)
{
var data = Path.Combine(Environment.CurrentDirectory, "Data");
var modelPath = Path.Combine(data, "MovieRecommenderModel.zip");
Console.WriteLine("=============== Saving the model to a file ===============");
mlContext.Model.Save(model, trainingDataViewSchema, modelPath);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment