From 7228011613002fc7570ed765bdb709cf42d7ac07 Mon Sep 17 00:00:00 2001 From: Petr Kulikov Date: Wed, 3 Oct 2018 21:21:43 +0200 Subject: [PATCH 1/5] ML.NET cookbook: typo fix --- docs/code/MlNetCookBook.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/code/MlNetCookBook.md b/docs/code/MlNetCookBook.md index 02cd200f5b..4b82386d7d 100644 --- a/docs/code/MlNetCookBook.md +++ b/docs/code/MlNetCookBook.md @@ -240,7 +240,7 @@ var data = reader.Read(new MultiFileSource(dataPath)); var transformedData = dataPipeline.Fit(data).Transform(data); // 'transformedData' is a 'promise' of data. Let's actually read it. -var someRows = transformedData.AsDynamic +var someRows = transformedData // Convert to an enumerable of user-defined type. .AsEnumerable(env, reuseRowObject: false) // Take a couple values as an array. @@ -982,4 +982,4 @@ dynamicPipe = dynamicPipe.Append(new KeyToValueEstimator(env, "PredictedLabel")) var dynamicModel = dynamicPipe.Fit(data.AsDynamic); // Now 'dynamicModel', and 'model.AsDynamic' are equivalent. -``` \ No newline at end of file +``` From e426028bcda67b74407d4c9c29f71e9eb42dc82c Mon Sep 17 00:00:00 2001 From: Petr Kulikov Date: Wed, 3 Oct 2018 22:30:58 +0200 Subject: [PATCH 2/5] Added missing AsDynamic call --- docs/code/MlNetHighLevelConcepts.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/code/MlNetHighLevelConcepts.md b/docs/code/MlNetHighLevelConcepts.md index 9ec58dce1d..c075d6c919 100644 --- a/docs/code/MlNetHighLevelConcepts.md +++ b/docs/code/MlNetHighLevelConcepts.md @@ -137,7 +137,7 @@ The above algorithm can be implemented using the [schema comprehension](SchemaCo ```c# var inputData = env.CreateDataView(new InputExample[] { example }); var outputData = model.Transform(inputData); -var output = outputData.AsEnumerable(env, reuseRowObject: false).Single(); +var output = outputData.AsDynamic.AsEnumerable(env, reuseRowObject: false).Single(); ``` But this would be cumbersome, and would incur performance costs. @@ -150,4 +150,4 @@ var output = predictionFunc.Predict(example); The same `predictionFunc` can (and should!) be used multiple times, thus amortizing the initial cost of `MakePredictionFunction` call. -The prediction function is *not re-entrant / thread-safe*: if you want to conduct predictions simultaneously with multiple threads, you need to have a prediction function per thread. \ No newline at end of file +The prediction function is *not re-entrant / thread-safe*: if you want to conduct predictions simultaneously with multiple threads, you need to have a prediction function per thread. From 376a9bbd91579249658ea8fb61755f4defa0078a Mon Sep 17 00:00:00 2001 From: Petr Kulikov Date: Wed, 3 Oct 2018 22:32:38 +0200 Subject: [PATCH 3/5] Cookbook: revert original change --- docs/code/MlNetCookBook.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/code/MlNetCookBook.md b/docs/code/MlNetCookBook.md index 4b82386d7d..3b37522254 100644 --- a/docs/code/MlNetCookBook.md +++ b/docs/code/MlNetCookBook.md @@ -240,7 +240,7 @@ var data = reader.Read(new MultiFileSource(dataPath)); var transformedData = dataPipeline.Fit(data).Transform(data); // 'transformedData' is a 'promise' of data. Let's actually read it. -var someRows = transformedData +var someRows = transformedData.AsDynamic // Convert to an enumerable of user-defined type. .AsEnumerable(env, reuseRowObject: false) // Take a couple values as an array. From dd2ec90b8edee26f9546f4ceb4d43ada362b5f3b Mon Sep 17 00:00:00 2001 From: Petr Kulikov Date: Wed, 3 Oct 2018 22:37:46 +0200 Subject: [PATCH 4/5] Remove trailing whitespace From a85267ea1e694d4fb15f4b66b9da862e34b4eeed Mon Sep 17 00:00:00 2001 From: pkulikov Date: Wed, 3 Oct 2018 22:39:26 +0200 Subject: [PATCH 5/5] Removed end-of-file new lines --- docs/code/MlNetCookBook.md | 2 +- docs/code/MlNetHighLevelConcepts.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/code/MlNetCookBook.md b/docs/code/MlNetCookBook.md index 3b37522254..02cd200f5b 100644 --- a/docs/code/MlNetCookBook.md +++ b/docs/code/MlNetCookBook.md @@ -982,4 +982,4 @@ dynamicPipe = dynamicPipe.Append(new KeyToValueEstimator(env, "PredictedLabel")) var dynamicModel = dynamicPipe.Fit(data.AsDynamic); // Now 'dynamicModel', and 'model.AsDynamic' are equivalent. -``` +``` \ No newline at end of file diff --git a/docs/code/MlNetHighLevelConcepts.md b/docs/code/MlNetHighLevelConcepts.md index c075d6c919..9cc803401a 100644 --- a/docs/code/MlNetHighLevelConcepts.md +++ b/docs/code/MlNetHighLevelConcepts.md @@ -150,4 +150,4 @@ var output = predictionFunc.Predict(example); The same `predictionFunc` can (and should!) be used multiple times, thus amortizing the initial cost of `MakePredictionFunction` call. -The prediction function is *not re-entrant / thread-safe*: if you want to conduct predictions simultaneously with multiple threads, you need to have a prediction function per thread. +The prediction function is *not re-entrant / thread-safe*: if you want to conduct predictions simultaneously with multiple threads, you need to have a prediction function per thread. \ No newline at end of file