Skip to content

Commit f5cb930

Browse files
author
Ron Petrusha
authored
Merge pull request #731 from dotnet/master
Update Live with current Master
2 parents f0162a3 + d938de2 commit f5cb930

File tree

1 file changed

+4
-3
lines changed
  • machine-learning/tutorials/MovieRecommendation

1 file changed

+4
-3
lines changed

machine-learning/tutorials/MovieRecommendation/Program.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,10 @@ public static void SaveModel(MLContext mlContext, ITransformer model)
144144
{
145145
// Save the trained model to .zip file
146146
// <SnippetSaveModel>
147-
using (var fs = new FileStream("moviePredictionModel.zip",
148-
FileMode.Create, FileAccess.Write, FileShare.Write))
149-
147+
var modelPath = Path.Combine(Environment.CurrentDirectory, "Data", "MovieRecommenderModel.zip");
148+
149+
Console.WriteLine("=============== Saving the model to a file ===============");
150+
using (var fs = new FileStream(modelPath, FileMode.Create, FileAccess.Write, FileShare.Write))
150151
mlContext.Model.Save(model, fs);
151152
// </SnippetSaveModel>
152153
}

0 commit comments

Comments
 (0)