Skip to content

Commit 7e72431

Browse files
committed
More review comments.
1 parent 6f9cc87 commit 7e72431

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/Microsoft.ML.Data/Model/ModelOperationsCatalog.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public void Save<TSource>(ITransformer model, IDataLoader<TSource> loader, Strea
5858
/// Save a transformer model and the loader used to create its input data to the file.
5959
/// </summary>
6060
/// <param name="model">The trained model to be saved. Note that this can be <see langword="null"/>, as a shorthand
61-
/// for an empty data set. Upon loading with <see cref="LoadWithDataLoader(Stream, out IDataLoader{IMultiStreamSource})"/>
61+
/// for an empty transformer chain. Upon loading with <see cref="LoadWithDataLoader(Stream, out IDataLoader{IMultiStreamSource})"/>
6262
/// the returned value will be an empty <see cref="TransformerChain{TLastTransformer}"/>.</param>
6363
/// <param name="loader">The loader that was used to create data to train the model.</param>
6464
/// <param name="filePath">Path where model should be saved.</param>
@@ -76,7 +76,7 @@ public void Save<TSource>(ITransformer model, IDataLoader<TSource> loader, strin
7676
/// Save a transformer model and the schema of the data that was used to train it to the stream.
7777
/// </summary>
7878
/// <param name="model">The trained model to be saved. Note that this can be <see langword="null"/>, as a shorthand
79-
/// for an empty data set. Upon loading with <see cref="Load(Stream, out DataViewSchema)"/> the returned value will
79+
/// for an empty transformer chain. Upon loading with <see cref="Load(Stream, out DataViewSchema)"/> the returned value will
8080
/// be an empty <see cref="TransformerChain{TLastTransformer}"/>.</param>
8181
/// <param name="inputSchema">The schema of the input to the transformer. This can be <see langword="null"/>.</param>
8282
/// <param name="stream">A writeable, seekable stream to save to.</param>
@@ -98,7 +98,7 @@ public void Save(ITransformer model, DataViewSchema inputSchema, Stream stream)
9898
/// Save a transformer model and the schema of the data that was used to train it to the file.
9999
/// </summary>
100100
/// <param name="model">The trained model to be saved. Note that this can be <see langword="null"/>, as a shorthand
101-
/// for an empty data set. Upon loading with <see cref="Load(Stream, out DataViewSchema)"/> the returned value will
101+
/// for an empty transformer chain. Upon loading with <see cref="Load(Stream, out DataViewSchema)"/> the returned value will
102102
/// be an empty <see cref="TransformerChain{TLastTransformer}"/>.</param>
103103
/// <param name="inputSchema">The schema of the input to the transformer. This can be <see langword="null"/>.</param>
104104
/// <param name="filePath">Path where model should be saved.</param>

test/Microsoft.ML.Functional.Tests/ModelLoading.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,10 @@ public void SaveCompositeLoaderAndLoad()
234234
var file = new MultiFileSource(GetDataPath(TestDatasets.adult.trainFilename));
235235
var loader = ML.Data.CreateTextLoader<InputData>(hasHeader: true, dataSample: file);
236236
var composite = loader.Append(ML.Transforms.Normalize("Features"));
237-
var model = composite.Fit(file);
237+
var loaderWithEmbeddedModel = composite.Fit(file);
238238

239239
string modelPath = GetOutputPath(FullTestName + "-model.zip");
240-
ML.Model.Save(null, model, modelPath);
240+
ML.Model.Save(null, loaderWithEmbeddedModel, modelPath);
241241

242242
Load(modelPath, out var loadedWithSchema, out var loadedSchema,
243243
out var loadedWithLoader, out var loadedLoaderWithTransformer);
@@ -247,15 +247,15 @@ public void SaveCompositeLoaderAndLoad()
247247
Assert.Empty(Assert.IsType<TransformerChain<ITransformer>>(loadedWithSchema));
248248
Assert.Empty(Assert.IsType<TransformerChain<ITransformer>>(loadedWithLoader));
249249

250-
var expectedSchema = model.GetOutputSchema();
250+
var expectedSchema = loaderWithEmbeddedModel.GetOutputSchema();
251251
Assert.True(expectedSchema.Count == 3);
252252
Assert.NotNull(expectedSchema.GetColumnOrNull("Label"));
253253
Assert.NotNull(expectedSchema.GetColumnOrNull("Features"));
254254
Assert.True(expectedSchema["Features"].HasSlotNames());
255255

256-
CheckSameSchemas(model.GetOutputSchema(), loadedSchema);
256+
CheckSameSchemas(loaderWithEmbeddedModel.GetOutputSchema(), loadedSchema);
257257
var schemaFromLoadedLoader = loadedLoaderWithTransformer.GetOutputSchema();
258-
CheckSameSchemas(model.GetOutputSchema(), schemaFromLoadedLoader);
258+
CheckSameSchemas(loaderWithEmbeddedModel.GetOutputSchema(), schemaFromLoadedLoader);
259259

260260
// The type of the loader itself should be a composite data loader, and its single transformer
261261
// should be the normalizing transformer.

0 commit comments

Comments
 (0)