Skip to content

Commit 18ce098

Browse files
committed
merge master
2 parents 7e11f86 + 3065a8f commit 18ce098

File tree

111 files changed

+664
-254
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+664
-254
lines changed

THIRD-PARTY-NOTICES.TXT

+24-1
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,27 @@ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
4242
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
4343
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
4444
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
45-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
45+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
46+
47+
License notice for SharpZipLib
48+
------------------------------
49+
50+
https://github.com/icsharpcode/SharpZipLib
51+
52+
Copyright © 2000-2018 SharpZipLib Contributors
53+
54+
Permission is hereby granted, free of charge, to any person obtaining a copy of this
55+
software and associated documentation files (the "Software"), to deal in the Software
56+
without restriction, including without limitation the rights to use, copy, modify, merge,
57+
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
58+
to whom the Software is furnished to do so, subject to the following conditions:
59+
60+
The above copyright notice and this permission notice shall be included in all copies or
61+
substantial portions of the Software.
62+
63+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
64+
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
65+
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
66+
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
67+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
68+
DEALINGS IN THE SOFTWARE.

docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/BootstrapSample.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
using System;
22
using System.Collections.Generic;
3+
using Microsoft.ML;
34

4-
namespace Microsoft.ML.Samples.Dynamic
5+
namespace Samples.Dynamic
56
{
67
public static class BootstrapSample
78
{
@@ -12,7 +13,7 @@ public static void Example()
1213
var mlContext = new MLContext();
1314

1415
// Get a small dataset as an IEnumerable and them read it as ML.NET's data type.
15-
IEnumerable<SamplesUtils.DatasetUtils.BinaryLabelFloatFeatureVectorFloatWeightSample> enumerableOfData = SamplesUtils.DatasetUtils.GenerateBinaryLabelFloatFeatureVectorFloatWeightSamples(5);
16+
IEnumerable<Microsoft.ML.SamplesUtils.DatasetUtils.BinaryLabelFloatFeatureVectorFloatWeightSample> enumerableOfData = Microsoft.ML.SamplesUtils.DatasetUtils.GenerateBinaryLabelFloatFeatureVectorFloatWeightSamples(5);
1617
var data = mlContext.Data.LoadFromEnumerable(enumerableOfData);
1718

1819
// Look at the original dataset
@@ -43,7 +44,7 @@ public static void Example()
4344
{
4445
var resample = mlContext.Data.BootstrapSample(data, seed: i);
4546

46-
var enumerable = mlContext.Data.CreateEnumerable<SamplesUtils.DatasetUtils.BinaryLabelFloatFeatureVectorFloatWeightSample>(resample, reuseRowObject: false);
47+
var enumerable = mlContext.Data.CreateEnumerable<Microsoft.ML.SamplesUtils.DatasetUtils.BinaryLabelFloatFeatureVectorFloatWeightSample>(resample, reuseRowObject: false);
4748
Console.WriteLine($"Label\tFeatures[0]");
4849
foreach (var row in enumerable)
4950
{

docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/Cache.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
using System;
2+
using Microsoft.ML;
23
using Microsoft.ML.SamplesUtils;
34

4-
namespace Microsoft.ML.Samples.Dynamic
5+
namespace Samples.Dynamic
56
{
67
public static class Cache
78
{

docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/CrossValidationSplit.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
using System;
22
using System.Collections.Generic;
3+
using Microsoft.ML;
34
using static Microsoft.ML.DataOperationsCatalog;
45

5-
namespace Microsoft.ML.Samples.Dynamic
6+
namespace Samples.Dynamic
67
{
78
/// <summary>
89
/// Sample class showing how to use CrossValidationSplit.

docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/DataViewEnumerable.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
using System;
22
using System.Collections.Generic;
3+
using Microsoft.ML;
34
using Microsoft.ML.SamplesUtils;
45

5-
namespace Microsoft.ML.Samples.Dynamic
6+
namespace Samples.Dynamic
67
{
78
/// <summary>
89
/// Sample class showing how to use ShuffleRows.

docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/FilterRowsByColumn.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
using System;
22
using System.Collections.Generic;
3+
using Microsoft.ML;
34

4-
namespace Microsoft.ML.Samples.Dynamic
5+
namespace Samples.Dynamic
56
{
67
/// <summary>
78
/// Sample class showing how to use FilterRowsByColumn.
@@ -15,7 +16,7 @@ public static void Example()
1516
var mlContext = new MLContext();
1617

1718
// Get a small dataset as an IEnumerable.
18-
IEnumerable<SamplesUtils.DatasetUtils.SampleTemperatureData> enumerableOfData = SamplesUtils.DatasetUtils.GetSampleTemperatureData(10);
19+
IEnumerable<Microsoft.ML.SamplesUtils.DatasetUtils.SampleTemperatureData> enumerableOfData = Microsoft.ML.SamplesUtils.DatasetUtils.GetSampleTemperatureData(10);
1920
var data = mlContext.Data.LoadFromEnumerable(enumerableOfData);
2021

2122
// Before we apply a filter, examine all the records in the dataset.
@@ -42,7 +43,7 @@ public static void Example()
4243
var filteredData = mlContext.Data.FilterRowsByColumn(data, columnName: "Temperature", lowerBound: 34, upperBound: 37);
4344

4445
// Look at the filtered data and observe that values outside [34,37) have been dropped.
45-
var enumerable = mlContext.Data.CreateEnumerable<SamplesUtils.DatasetUtils.SampleTemperatureData>(filteredData, reuseRowObject: true);
46+
var enumerable = mlContext.Data.CreateEnumerable<Microsoft.ML.SamplesUtils.DatasetUtils.SampleTemperatureData>(filteredData, reuseRowObject: true);
4647
Console.WriteLine($"Date\tTemperature");
4748
foreach (var row in enumerable)
4849
{

docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/FilterRowsByKeyColumnFraction.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
using System;
22
using System.Collections.Generic;
3+
using Microsoft.ML;
34
using Microsoft.ML.Data;
45
using Microsoft.ML.SamplesUtils;
56

6-
namespace Microsoft.ML.Samples.Dynamic
7+
namespace Samples.Dynamic
78
{
89
using MulticlassClassificationExample = DatasetUtils.MulticlassClassificationExample;
910

docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/FilterRowsByMissingValues.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
using System;
2+
using Microsoft.ML;
23
using Microsoft.ML.SamplesUtils;
34

4-
namespace Microsoft.ML.Samples.Dynamic
5+
namespace Samples.Dynamic
56
{
67
public class FilterRowsByMissingValues
78
{

docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/ShuffleRows.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
using System;
2+
using Microsoft.ML;
23
using Microsoft.ML.SamplesUtils;
34

4-
namespace Microsoft.ML.Samples.Dynamic
5+
namespace Samples.Dynamic
56
{
67
/// <summary>
78
/// Sample class showing how to use ShuffleRows.

docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/SkipRows.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using System;
2-
namespace Microsoft.ML.Samples.Dynamic
2+
using Microsoft.ML;
3+
4+
namespace Samples.Dynamic
35
{
46
/// <summary>
57
/// Sample class showing how to use Skip.
@@ -13,7 +15,7 @@ public static void Example()
1315
var mlContext = new MLContext();
1416

1517
// Get a small dataset as an IEnumerable.
16-
var enumerableOfData = SamplesUtils.DatasetUtils.GetSampleTemperatureData(10);
18+
var enumerableOfData = Microsoft.ML.SamplesUtils.DatasetUtils.GetSampleTemperatureData(10);
1719
var data = mlContext.Data.LoadFromEnumerable(enumerableOfData);
1820

1921
// Before we apply a filter, examine all the records in the dataset.
@@ -40,7 +42,7 @@ public static void Example()
4042
var filteredData = mlContext.Data.SkipRows(data, 5);
4143

4244
// Look at the filtered data and observe that the first 5 rows have been dropped
43-
var enumerable = mlContext.Data.CreateEnumerable<SamplesUtils.DatasetUtils.SampleTemperatureData>(filteredData, reuseRowObject: true);
45+
var enumerable = mlContext.Data.CreateEnumerable<Microsoft.ML.SamplesUtils.DatasetUtils.SampleTemperatureData>(filteredData, reuseRowObject: true);
4446
Console.WriteLine($"Date\tTemperature");
4547
foreach (var row in enumerable)
4648
{

docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/TakeRows.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using System;
2-
namespace Microsoft.ML.Samples.Dynamic
2+
using Microsoft.ML;
3+
4+
namespace Samples.Dynamic
35
{
46
/// <summary>
57
/// Sample class showing how to use Take.
@@ -13,7 +15,7 @@ public static void Example()
1315
var mlContext = new MLContext();
1416

1517
// Get a small dataset as an IEnumerable.
16-
var enumerableOfData = SamplesUtils.DatasetUtils.GetSampleTemperatureData(10);
18+
var enumerableOfData = Microsoft.ML.SamplesUtils.DatasetUtils.GetSampleTemperatureData(10);
1719
var data = mlContext.Data.LoadFromEnumerable(enumerableOfData);
1820

1921
// Before we apply a filter, examine all the records in the dataset.
@@ -40,7 +42,7 @@ public static void Example()
4042
var filteredData = mlContext.Data.TakeRows(data, 5);
4143

4244
// Look at the filtered data and observe that only the first 5 rows are in the resulting dataset.
43-
var enumerable = mlContext.Data.CreateEnumerable<SamplesUtils.DatasetUtils.SampleTemperatureData>(filteredData, reuseRowObject: true);
45+
var enumerable = mlContext.Data.CreateEnumerable<Microsoft.ML.SamplesUtils.DatasetUtils.SampleTemperatureData>(filteredData, reuseRowObject: true);
4446
Console.WriteLine($"Date\tTemperature");
4547
foreach (var row in enumerable)
4648
{

docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/TrainTestSplit.cs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
using System;
22
using System.Collections.Generic;
3-
using System.Collections.Immutable;
4-
using System.Linq;
5-
using Microsoft.ML.Data;
3+
using Microsoft.ML;
64
using static Microsoft.ML.DataOperationsCatalog;
75

8-
namespace Microsoft.ML.Samples.Dynamic
6+
namespace Samples.Dynamic
97
{
108
/// <summary>
119
/// Sample class showing how to use TrainTestSplit.

docs/samples/Microsoft.ML.Samples/Dynamic/FeatureContributionCalculationTransform.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
using System;
2+
using Microsoft.ML;
23
using Microsoft.ML.Data;
34
using Microsoft.ML.SamplesUtils;
45
using Microsoft.ML.Trainers;
56

6-
namespace Microsoft.ML.Samples.Dynamic
7+
namespace Samples.Dynamic
78
{
89
public static class FeatureContributionCalculationTransform
910
{

docs/samples/Microsoft.ML.Samples/Dynamic/NgramExtraction.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
using System;
22
using System.Collections.Generic;
3+
using Microsoft.ML;
34
using Microsoft.ML.Data;
45

5-
namespace Microsoft.ML.Samples.Dynamic
6+
namespace Samples.Dynamic
67
{
78
public static partial class TransformSamples
89
{
@@ -13,7 +14,7 @@ public static void Example()
1314
var ml = new MLContext();
1415

1516
// Get a small dataset as an IEnumerable and convert to IDataView.
16-
IEnumerable<SamplesUtils.DatasetUtils.SampleSentimentData> data = SamplesUtils.DatasetUtils.GetSentimentData();
17+
IEnumerable<Microsoft.ML.SamplesUtils.DatasetUtils.SampleSentimentData> data = Microsoft.ML.SamplesUtils.DatasetUtils.GetSentimentData();
1718
var trainData = ml.Data.LoadFromEnumerable(data);
1819

1920
// Preview of the data.

docs/samples/Microsoft.ML.Samples/Dynamic/Normalizer.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
using System;
22
using System.Collections.Generic;
3+
using Microsoft.ML;
34
using Microsoft.ML.Data;
45

5-
namespace Microsoft.ML.Samples.Dynamic
6+
namespace Samples.Dynamic
67
{
78
public static class NormalizerTransform
89
{
@@ -13,7 +14,7 @@ public static void Example()
1314
var ml = new MLContext();
1415

1516
// Get a small dataset as an IEnumerable and convert it to an IDataView.
16-
IEnumerable<SamplesUtils.DatasetUtils.SampleInfertData> data = SamplesUtils.DatasetUtils.GetInfertData();
17+
IEnumerable<Microsoft.ML.SamplesUtils.DatasetUtils.SampleInfertData> data = Microsoft.ML.SamplesUtils.DatasetUtils.GetInfertData();
1718
var trainData = ml.Data.LoadFromEnumerable(data);
1819

1920
// Preview of the data.

docs/samples/Microsoft.ML.Samples/Dynamic/OnnxTransform.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
using System;
22
using System.Linq;
3+
using Microsoft.ML;
34
using Microsoft.ML.Data;
45
using Microsoft.ML.OnnxRuntime;
56

6-
namespace Microsoft.ML.Samples.Dynamic
7+
namespace Samples.Dynamic
78
{
89
public static class OnnxTransformExample
910
{

docs/samples/Microsoft.ML.Samples/Dynamic/PermutationFeatureImportance/PFIHelper.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
using System.Linq;
33
using Microsoft.ML.Trainers;
44
using Microsoft.ML.SamplesUtils;
5+
using Microsoft.ML;
56

6-
namespace Microsoft.ML.Samples.Dynamic.PermutationFeatureImportance
7+
namespace Samples.Dynamic.PermutationFeatureImportance
78
{
89
public static class PfiHelper
910
{

docs/samples/Microsoft.ML.Samples/Dynamic/PermutationFeatureImportance/PFIRegressionExample.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
using System;
22
using System.Linq;
3+
using Microsoft.ML;
34

4-
namespace Microsoft.ML.Samples.Dynamic.PermutationFeatureImportance
5+
namespace Samples.Dynamic.PermutationFeatureImportance
56
{
67
public static class PfiRegression
78
{

docs/samples/Microsoft.ML.Samples/Dynamic/PermutationFeatureImportance/PfiBinaryClassificationExample.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
using System;
22
using System.Linq;
3+
using Microsoft.ML;
34
using Microsoft.ML.Trainers;
45

5-
namespace Microsoft.ML.Samples.Dynamic.PermutationFeatureImportance
6+
namespace Samples.Dynamic.PermutationFeatureImportance
67
{
78
public static class PfiBinaryClassification
89
{

docs/samples/Microsoft.ML.Samples/Dynamic/ProjectionTransforms.cs

+14-11
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Linq;
4+
using Microsoft.ML;
45
using Microsoft.ML.Data;
56

6-
namespace Microsoft.ML.Samples.Dynamic
7+
namespace Samples.Dynamic
78
{
89
public static class ProjectionTransforms
910
{
@@ -14,7 +15,7 @@ public static void Example()
1415
var ml = new MLContext();
1516

1617
// Get a small dataset as an IEnumerable and convert it to an IDataView.
17-
IEnumerable<SamplesUtils.DatasetUtils.SampleVectorOfNumbersData> data = SamplesUtils.DatasetUtils.GetVectorOfNumbersData();
18+
IEnumerable<Microsoft.ML.SamplesUtils.DatasetUtils.SampleVectorOfNumbersData> data = Microsoft.ML.SamplesUtils.DatasetUtils.GetVectorOfNumbersData();
1819
var trainData = ml.Data.LoadFromEnumerable(data);
1920

2021
// Preview of the data.
@@ -37,13 +38,13 @@ public static void Example()
3738
};
3839

3940
// A pipeline to project Features column into Random fourier space.
40-
var rffPipeline = ml.Transforms.ApproximatedKernelMap(nameof(SamplesUtils.DatasetUtils.SampleVectorOfNumbersData.Features), rank: 4);
41+
var rffPipeline = ml.Transforms.ApproximatedKernelMap(nameof(Microsoft.ML.SamplesUtils.DatasetUtils.SampleVectorOfNumbersData.Features), rank: 4);
4142
// The transformed (projected) data.
4243
var transformedData = rffPipeline.Fit(trainData).Transform(trainData);
4344
// Getting the data of the newly created column, so we can preview it.
44-
var randomFourier = transformedData.GetColumn<VBuffer<float>>(transformedData.Schema[nameof(SamplesUtils.DatasetUtils.SampleVectorOfNumbersData.Features)]);
45+
var randomFourier = transformedData.GetColumn<VBuffer<float>>(transformedData.Schema[nameof(Microsoft.ML.SamplesUtils.DatasetUtils.SampleVectorOfNumbersData.Features)]);
4546

46-
printHelper(nameof(SamplesUtils.DatasetUtils.SampleVectorOfNumbersData.Features), randomFourier);
47+
printHelper(nameof(Microsoft.ML.SamplesUtils.DatasetUtils.SampleVectorOfNumbersData.Features), randomFourier);
4748

4849
// Features column obtained post-transformation.
4950
//
@@ -55,13 +56,15 @@ public static void Example()
5556
//0.165 0.117 -0.547 0.014
5657

5758
// A pipeline to project Features column into L-p normalized vector.
58-
var lpNormalizePipeline = ml.Transforms.NormalizeLpNorm(nameof(SamplesUtils.DatasetUtils.SampleVectorOfNumbersData.Features), norm: Transforms.LpNormNormalizingEstimatorBase.NormFunction.L1);
59+
var lpNormalizePipeline = ml.Transforms.NormalizeLpNorm(nameof(Microsoft.ML.SamplesUtils.DatasetUtils.SampleVectorOfNumbersData.Features),
60+
norm: Microsoft.ML.Transforms.LpNormNormalizingEstimatorBase.NormFunction.L1);
61+
5962
// The transformed (projected) data.
6063
transformedData = lpNormalizePipeline.Fit(trainData).Transform(trainData);
6164
// Getting the data of the newly created column, so we can preview it.
62-
var lpNormalize= transformedData.GetColumn<VBuffer<float>>(transformedData.Schema[nameof(SamplesUtils.DatasetUtils.SampleVectorOfNumbersData.Features)]);
65+
var lpNormalize= transformedData.GetColumn<VBuffer<float>>(transformedData.Schema[nameof(Microsoft.ML.SamplesUtils.DatasetUtils.SampleVectorOfNumbersData.Features)]);
6366

64-
printHelper(nameof(SamplesUtils.DatasetUtils.SampleVectorOfNumbersData.Features), lpNormalize);
67+
printHelper(nameof(Microsoft.ML.SamplesUtils.DatasetUtils.SampleVectorOfNumbersData.Features), lpNormalize);
6568

6669
// Features column obtained post-transformation.
6770
//
@@ -73,13 +76,13 @@ public static void Example()
7376
// 0.133 0.156 0.178 0.200 0.000 0.022 0.044 0.067 0.089 0.111
7477

7578
// A pipeline to project Features column into L-p normalized vector.
76-
var gcNormalizePipeline = ml.Transforms.NormalizeGlobalContrast(nameof(SamplesUtils.DatasetUtils.SampleVectorOfNumbersData.Features), ensureZeroMean:false);
79+
var gcNormalizePipeline = ml.Transforms.NormalizeGlobalContrast(nameof(Microsoft.ML.SamplesUtils.DatasetUtils.SampleVectorOfNumbersData.Features), ensureZeroMean:false);
7780
// The transformed (projected) data.
7881
transformedData = gcNormalizePipeline.Fit(trainData).Transform(trainData);
7982
// Getting the data of the newly created column, so we can preview it.
80-
var gcNormalize = transformedData.GetColumn<VBuffer<float>>(transformedData.Schema[nameof(SamplesUtils.DatasetUtils.SampleVectorOfNumbersData.Features)]);
83+
var gcNormalize = transformedData.GetColumn<VBuffer<float>>(transformedData.Schema[nameof(Microsoft.ML.SamplesUtils.DatasetUtils.SampleVectorOfNumbersData.Features)]);
8184

82-
printHelper(nameof(SamplesUtils.DatasetUtils.SampleVectorOfNumbersData.Features), gcNormalize);
85+
printHelper(nameof(Microsoft.ML.SamplesUtils.DatasetUtils.SampleVectorOfNumbersData.Features), gcNormalize);
8386

8487
// Features column obtained post-transformation.
8588
//

0 commit comments

Comments
 (0)