Skip to content

Commit ad6374a

Browse files
committed
update cookbooks and added comments about laziness of load
1 parent 41fb9c9 commit ad6374a

File tree

7 files changed

+191
-181
lines changed

7 files changed

+191
-181
lines changed

docs/code/MlNetCookBook.md

Lines changed: 74 additions & 74 deletions
Large diffs are not rendered by default.

docs/code/experimental/MlNetCookBookStaticApi.md

Lines changed: 97 additions & 97 deletions
Large diffs are not rendered by default.

docs/samples/Microsoft.ML.Samples/Static/FeatureSelectionTransform.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public static void FeatureSelectionTransform()
3737
),
3838
separator: '\t', hasHeader: true);
3939

40-
// Then, we use the reader to load the data as an IDataView.
40+
// Then, we use the loader to load the data as an IDataView.
4141
var data = loader.Load(dataFilePath);
4242

4343
// Second, we define the transformations that we apply on the data. Remember that an Estimator does not transform data

src/Microsoft.ML.Data/DataLoadSave/Binary/BinaryLoaderSaverCatalog.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ namespace Microsoft.ML
1212
public static class BinaryLoaderSaverCatalog
1313
{
1414
/// <summary>
15-
/// Load a data view from an <see cref="IMultiStreamSource"/> on a binary file.
15+
/// Load a <see cref="IDataView"/> from an <see cref="IMultiStreamSource"/> on a binary file.
16+
/// Note that <see cref="IDataView"/>'s are lazy, so no actual loading happens here, just schema validation.
1617
/// </summary>
1718
/// <param name="catalog">The catalog.</param>
1819
/// <param name="fileSource">The file source to load from. This can be a <see cref="MultiFileSource"/>, for example.</param>
@@ -27,7 +28,8 @@ public static IDataView LoadFromBinary(this DataOperationsCatalog catalog, IMult
2728
}
2829

2930
/// <summary>
30-
/// Load a data view from a binary file.
31+
/// Load a <see cref="IDataView"/> from a binary file.
32+
/// Note that <see cref="IDataView"/>'s are lazy, so no actual loading happens here, just schema validation.
3133
/// </summary>
3234
/// <param name="catalog">The catalog.</param>
3335
/// <param name="path">The path to the file to load from.</param>
@@ -42,7 +44,7 @@ public static IDataView LoadFromBinary(this DataOperationsCatalog catalog, strin
4244
}
4345

4446
/// <summary>
45-
/// Save the data view into a binary stream.
47+
/// Save the <see cref="IDataView"/> into a binary stream.
4648
/// </summary>
4749
/// <param name="catalog">The catalog.</param>
4850
/// <param name="data">The data view to save.</param>

src/Microsoft.ML.Data/DataLoadSave/CompositeDataLoader.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ public CompositeDataLoader(IDataLoader<TSource> loader, TransformerChain<TLastTr
3333
Transformer = transformerChain ?? new TransformerChain<TLastTransformer>();
3434
}
3535

36+
/// <summary>
37+
/// Produce the data view from the specified input.
38+
/// Note that <see cref="IDataView"/>'s are lazy, so no actual loading happens here, just schema validation.
39+
/// </summary>
3640
public IDataView Load(TSource input)
3741
{
3842
var idv = Loader.Load(input);

src/Microsoft.ML.Data/DataLoadSave/DataLoaderExtensions.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ namespace Microsoft.ML
1010
public static class DataLoaderExtensions
1111
{
1212
/// <summary>
13-
/// Reads data from one or more file <paramref name="path"/> into an <see cref="IDataView"/>.
13+
/// Loads data from one or more file <paramref name="path"/> into an <see cref="IDataView"/>.
14+
/// Note that <see cref="IDataView"/>'s are lazy, so no actual loading happens here, just schema validation.
1415
/// </summary>
1516
/// <param name="loader">The loader to use.</param>
1617
/// <param name="path">One or more paths from which to load data.</param>
1718
public static IDataView Load(this IDataLoader<IMultiStreamSource> loader, params string[] path)
1819
=> loader.Load(new MultiFileSource(path));
1920
}
20-
}
21+
}

src/Microsoft.ML.Data/DataLoadSave/Text/TextLoaderSaverCatalog.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ public static TextLoader CreateTextLoader<TInput>(this DataOperationsCatalog cat
8282
allowSparse, trimWhitespace, dataSample: dataSample);
8383

8484
/// <summary>
85-
/// Load a data view from a text file using <see cref="TextLoader"/>.
85+
/// Load a <see cref="IDataView"/> from a text file using <see cref="TextLoader"/>.
86+
/// Note that <see cref="IDataView"/>'s are lazy, so no actual loading happens here, just schema validation.
8687
/// </summary>
8788
/// <param name="catalog">The <see cref="DataOperationsCatalog"/> catalog.</param>
8889
/// <param name="path">The path to the file.</param>
@@ -119,7 +120,8 @@ public static IDataView LoadFromTextFile(this DataOperationsCatalog catalog,
119120
}
120121

121122
/// <summary>
122-
/// Load a data view from a text file using <see cref="TextLoader"/>.
123+
/// Load a <see cref="IDataView"/> from a text file using <see cref="TextLoader"/>.
124+
/// Note that <see cref="IDataView"/>'s are lazy, so no actual loading happens here, just schema validation.
123125
/// </summary>
124126
/// <param name="catalog">The <see cref="DataOperationsCatalog"/> catalog.</param>
125127
/// <param name="path">The path to the file.</param>
@@ -152,7 +154,8 @@ public static IDataView LoadFromTextFile<TInput>(this DataOperationsCatalog cata
152154
}
153155

154156
/// <summary>
155-
/// Load a data view from a text file using <see cref="TextLoader"/>.
157+
/// Load a <see cref="IDataView"/> from a text file using <see cref="TextLoader"/>.
158+
/// Note that <see cref="IDataView"/>'s are lazy, so no actual loading happens here, just schema validation.
156159
/// </summary>
157160
/// <param name="catalog">The <see cref="DataOperationsCatalog"/> catalog.</param>
158161
/// <param name="path">Specifies a file from which to load.</param>
@@ -169,7 +172,7 @@ public static IDataView LoadFromTextFile(this DataOperationsCatalog catalog, str
169172
}
170173

171174
/// <summary>
172-
/// Save the data view as text.
175+
/// Save the <see cref="IDataView"/> as text.
173176
/// </summary>
174177
/// <param name="catalog">The <see cref="DataOperationsCatalog"/> catalog.</param>
175178
/// <param name="data">The data view to save.</param>

0 commit comments

Comments
 (0)