Skip to content

Commit cc5cf79

Browse files
author
Ivan Matantsev
committed
Merge remote-tracking branch 'upstream/master' into Ivanidze/LockdownHAL
2 parents 7806211 + b863ac2 commit cc5cf79

File tree

321 files changed

+2402
-2716
lines changed

Some content is hidden

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

321 files changed

+2402
-2716
lines changed

Microsoft.ML.sln

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.TestFramework"
3333
EndProject
3434
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.Predictor.Tests", "test\Microsoft.ML.Predictor.Tests\Microsoft.ML.Predictor.Tests.csproj", "{6B047E09-39C9-4583-96F3-685D84CA4117}"
3535
EndProject
36+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.Functional.Tests", "test\Microsoft.ML.Functional.Tests\Microsoft.ML.Functional.Tests.csproj", "{CFED9F0C-FF81-4C96-8D5E-0436264CA7B5}"
37+
EndProject
3638
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.ResultProcessor", "src\Microsoft.ML.ResultProcessor\Microsoft.ML.ResultProcessor.csproj", "{3769FCC3-9AFF-4C37-97E9-6854324681DF}"
3739
EndProject
3840
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.FastTree", "src\Microsoft.ML.FastTree\Microsoft.ML.FastTree.csproj", "{B7B593C5-FB8C-4ADA-A638-5B53B47D087E}"
@@ -928,6 +930,18 @@ Global
928930
{5E920CAC-5A28-42FB-936E-49C472130953}.Release-Intrinsics|Any CPU.Build.0 = Release-Intrinsics|Any CPU
929931
{5E920CAC-5A28-42FB-936E-49C472130953}.Release-netfx|Any CPU.ActiveCfg = Release-netfx|Any CPU
930932
{5E920CAC-5A28-42FB-936E-49C472130953}.Release-netfx|Any CPU.Build.0 = Release-netfx|Any CPU
933+
{CFED9F0C-FF81-4C96-8D5E-0436264CA7B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
934+
{CFED9F0C-FF81-4C96-8D5E-0436264CA7B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
935+
{CFED9F0C-FF81-4C96-8D5E-0436264CA7B5}.Debug-Intrinsics|Any CPU.ActiveCfg = Debug-Intrinsics|Any CPU
936+
{CFED9F0C-FF81-4C96-8D5E-0436264CA7B5}.Debug-Intrinsics|Any CPU.Build.0 = Debug-Intrinsics|Any CPU
937+
{CFED9F0C-FF81-4C96-8D5E-0436264CA7B5}.Debug-netfx|Any CPU.ActiveCfg = Debug-netfx|Any CPU
938+
{CFED9F0C-FF81-4C96-8D5E-0436264CA7B5}.Debug-netfx|Any CPU.Build.0 = Debug-netfx|Any CPU
939+
{CFED9F0C-FF81-4C96-8D5E-0436264CA7B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
940+
{CFED9F0C-FF81-4C96-8D5E-0436264CA7B5}.Release|Any CPU.Build.0 = Release|Any CPU
941+
{CFED9F0C-FF81-4C96-8D5E-0436264CA7B5}.Release-Intrinsics|Any CPU.ActiveCfg = Release-Intrinsics|Any CPU
942+
{CFED9F0C-FF81-4C96-8D5E-0436264CA7B5}.Release-Intrinsics|Any CPU.Build.0 = Release-Intrinsics|Any CPU
943+
{CFED9F0C-FF81-4C96-8D5E-0436264CA7B5}.Release-netfx|Any CPU.ActiveCfg = Release-netfx|Any CPU
944+
{CFED9F0C-FF81-4C96-8D5E-0436264CA7B5}.Release-netfx|Any CPU.Build.0 = Release-netfx|Any CPU
931945
EndGlobalSection
932946
GlobalSection(SolutionProperties) = preSolution
933947
HideSolutionNode = FALSE
@@ -1011,6 +1025,7 @@ Global
10111025
{85D0CAFD-2FE8-496A-88C7-585D35B94243} = {09EADF06-BE25-4228-AB53-95AE3E15B530}
10121026
{31D38B21-102B-41C0-9E0A-2FE0BF68D123} = {D3D38B03-B557-484D-8348-8BADEE4DF592}
10131027
{5E920CAC-5A28-42FB-936E-49C472130953} = {AED9C836-31E3-4F3F-8ABC-929555D3F3C4}
1028+
{CFED9F0C-FF81-4C96-8D5E-0436264CA7B5} = {AED9C836-31E3-4F3F-8ABC-929555D3F3C4}
10141029
EndGlobalSection
10151030
GlobalSection(ExtensibilityGlobals) = postSolution
10161031
SolutionGuid = {41165AF1-35BB-4832-A189-73060F82B01D}

build/Dependencies.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
<PropertyGroup>
4444
<BenchmarkDotNetVersion>0.11.3</BenchmarkDotNetVersion>
4545
<MicrosoftMLTestModelsPackageVersion>0.0.3-test</MicrosoftMLTestModelsPackageVersion>
46+
<MicrosoftMLTensorFlowTestModelsVersion>0.0.10-test</MicrosoftMLTensorFlowTestModelsVersion>
47+
<MicrosoftMLOnnxTestModelsVersion>0.0.4-test</MicrosoftMLOnnxTestModelsVersion>
4648
</PropertyGroup>
4749

4850
</Project>

docs/code/MlNetCookBook.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -688,11 +688,11 @@ var catColumns = data.GetColumn<string[]>(mlContext, "CategoricalFeatures").Take
688688
// Build several alternative featurization pipelines.
689689
var pipeline =
690690
// Convert each categorical feature into one-hot encoding independently.
691-
mlContext.Transforms.Categorical.OneHotEncoding("CategoricalFeatures", "CategoricalOneHot")
691+
mlContext.Transforms.Categorical.OneHotEncoding("CategoricalOneHot", "CategoricalFeatures")
692692
// Convert all categorical features into indices, and build a 'word bag' of these.
693-
.Append(mlContext.Transforms.Categorical.OneHotEncoding("CategoricalFeatures", "CategoricalBag", CategoricalTransform.OutputKind.Bag))
693+
.Append(mlContext.Transforms.Categorical.OneHotEncoding("CategoricalBag", "CategoricalFeatures", CategoricalTransform.OutputKind.Bag))
694694
// One-hot encode the workclass column, then drop all the categories that have fewer than 10 instances in the train set.
695-
.Append(mlContext.Transforms.Categorical.OneHotEncoding("Workclass", "WorkclassOneHot"))
695+
.Append(mlContext.Transforms.Categorical.OneHotEncoding("WorkclassOneHot", "Workclass"))
696696
.Append(mlContext.Transforms.FeatureSelection.CountFeatureSelectingEstimator("WorkclassOneHot", "WorkclassOneHotTrimmed", count: 10));
697697

698698
// Let's train our pipeline, and then apply it to the same data.

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

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,9 @@ public static void IidChangePointDetectorTransform()
5454
// Setup IidSpikeDetector arguments
5555
string outputColumnName = nameof(ChangePointPrediction.Prediction);
5656
string inputColumnName = nameof(IidChangePointData.Value);
57-
var args = new IidChangePointDetector.Arguments()
58-
{
59-
Source = inputColumnName,
60-
Name = outputColumnName,
61-
Confidence = 95, // The confidence for spike detection in the range [0, 100]
62-
ChangeHistoryLength = Size / 4, // The length of the sliding window on p-values for computing the martingale score.
63-
};
6457

6558
// The transformed data.
66-
var transformedData = new IidChangePointEstimator(ml, args).Fit(dataView).Transform(dataView);
59+
var transformedData = ml.Transforms.IidChangePointEstimator(outputColumnName, inputColumnName, 95, Size / 4).Fit(dataView).Transform(dataView);
6760

6861
// Getting the data of the newly created column as an IEnumerable of ChangePointPrediction.
6962
var predictionColumn = ml.CreateEnumerable<ChangePointPrediction>(transformedData, reuseRowObject: false);
@@ -119,16 +112,9 @@ public static void IidChangePointDetectorPrediction()
119112
// Setup IidSpikeDetector arguments
120113
string outputColumnName = nameof(ChangePointPrediction.Prediction);
121114
string inputColumnName = nameof(IidChangePointData.Value);
122-
var args = new IidChangePointDetector.Arguments()
123-
{
124-
Source = inputColumnName,
125-
Name = outputColumnName,
126-
Confidence = 95, // The confidence for spike detection in the range [0, 100]
127-
ChangeHistoryLength = Size / 4, // The length of the sliding window on p-values for computing the martingale score.
128-
};
129115

130116
// Time Series model.
131-
ITransformer model = new IidChangePointEstimator(ml, args).Fit(dataView);
117+
ITransformer model = ml.Transforms.IidChangePointEstimator(outputColumnName, inputColumnName, 95, Size / 4).Fit(dataView);
132118

133119
// Create a time series prediction engine from the model.
134120
var engine = model.CreateTimeSeriesPredictionFunction<IidChangePointData, ChangePointPrediction>(ml);

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

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,9 @@ public static void IidSpikeDetectorTransform()
5151
// Setup IidSpikeDetector arguments
5252
string outputColumnName = nameof(IidSpikePrediction.Prediction);
5353
string inputColumnName = nameof(IidSpikeData.Value);
54-
var args = new IidSpikeDetector.Arguments()
55-
{
56-
Source = inputColumnName,
57-
Name = outputColumnName,
58-
Confidence = 95, // The confidence for spike detection in the range [0, 100]
59-
PvalueHistoryLength = Size / 4 // The size of the sliding window for computing the p-value; shorter windows are more sensitive to spikes.
60-
};
6154

6255
// The transformed data.
63-
var transformedData = new IidSpikeEstimator(ml, args).Fit(dataView).Transform(dataView);
56+
var transformedData = ml.Transforms.IidSpikeEstimator(outputColumnName, inputColumnName, 95, Size / 4).Fit(dataView).Transform(dataView);
6457

6558
// Getting the data of the newly created column as an IEnumerable of IidSpikePrediction.
6659
var predictionColumn = ml.CreateEnumerable<IidSpikePrediction>(transformedData, reuseRowObject: false);
@@ -108,16 +101,8 @@ public static void IidSpikeDetectorPrediction()
108101
// Setup IidSpikeDetector arguments
109102
string outputColumnName = nameof(IidSpikePrediction.Prediction);
110103
string inputColumnName = nameof(IidSpikeData.Value);
111-
var args = new IidSpikeDetector.Arguments()
112-
{
113-
Source = inputColumnName,
114-
Name = outputColumnName,
115-
Confidence = 95, // The confidence for spike detection in the range [0, 100]
116-
PvalueHistoryLength = Size / 4 // The size of the sliding window for computing the p-value; shorter windows are more sensitive to spikes.
117-
};
118-
119104
// The transformed model.
120-
ITransformer model = new IidSpikeEstimator(ml, args).Fit(dataView);
105+
ITransformer model = ml.Transforms.IidChangePointEstimator(outputColumnName, inputColumnName, 95, Size).Fit(dataView);
121106

122107
// Create a time series prediction engine from the model.
123108
var engine = model.CreateTimeSeriesPredictionFunction<IidSpikeData, IidSpikePrediction>(ml);

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
using System;
22
using System.Linq;
33
using Microsoft.Data.DataView;
4-
using Microsoft.ML.Learners;
4+
using Microsoft.ML.Data;
5+
using Microsoft.ML.Trainers;
56
using Microsoft.ML.SamplesUtils;
67
using Microsoft.ML.Trainers.HalLearners;
78

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System;
22
using System.Linq;
3-
using Microsoft.ML.Learners;
3+
using Microsoft.ML.Trainers;
44

55
namespace Microsoft.ML.Samples.Dynamic.PermutationFeatureImportance
66
{

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

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,9 @@ public static void SsaChangePointDetectorTransform()
4949
// Setup SsaChangePointDetector arguments
5050
var inputColumnName = nameof(SsaChangePointData.Value);
5151
var outputColumnName = nameof(ChangePointPrediction.Prediction);
52-
var args = new SsaChangePointDetector.Arguments()
53-
{
54-
Source = inputColumnName,
55-
Name = outputColumnName,
56-
Confidence = 95, // The confidence for spike detection in the range [0, 100]
57-
ChangeHistoryLength = 8, // The length of the window for detecting a change in trend; shorter windows are more sensitive to spikes.
58-
TrainingWindowSize = TrainingSize, // The number of points from the beginning of the sequence used for training.
59-
SeasonalWindowSize = SeasonalitySize + 1 // An upper bound on the largest relevant seasonality in the input time series."
60-
61-
};
6252

6353
// The transformed data.
64-
var transformedData = new SsaChangePointEstimator(ml, args).Fit(dataView).Transform(dataView);
54+
var transformedData = ml.Transforms.SsaChangePointEstimator(outputColumnName, inputColumnName, 95, 8, TrainingSize, SeasonalitySize + 1).Fit(dataView).Transform(dataView);
6555

6656
// Getting the data of the newly created column as an IEnumerable of ChangePointPrediction.
6757
var predictionColumn = ml.CreateEnumerable<ChangePointPrediction>(transformedData, reuseRowObject: false);
@@ -120,19 +110,9 @@ public static void SsaChangePointDetectorPrediction()
120110
// Setup SsaChangePointDetector arguments
121111
var inputColumnName = nameof(SsaChangePointData.Value);
122112
var outputColumnName = nameof(ChangePointPrediction.Prediction);
123-
var args = new SsaChangePointDetector.Arguments()
124-
{
125-
Source = inputColumnName,
126-
Name = outputColumnName,
127-
Confidence = 95, // The confidence for spike detection in the range [0, 100]
128-
ChangeHistoryLength = 8, // The length of the window for detecting a change in trend; shorter windows are more sensitive to spikes.
129-
TrainingWindowSize = TrainingSize, // The number of points from the beginning of the sequence used for training.
130-
SeasonalWindowSize = SeasonalitySize + 1 // An upper bound on the largest relevant seasonality in the input time series."
131-
132-
};
133113

134114
// Train the change point detector.
135-
ITransformer model = new SsaChangePointEstimator(ml, args).Fit(dataView);
115+
ITransformer model = ml.Transforms.SsaChangePointEstimator(outputColumnName, inputColumnName, 95, 8, TrainingSize, SeasonalitySize + 1).Fit(dataView);
136116

137117
// Create a prediction engine from the model for feeding new data.
138118
var engine = model.CreateTimeSeriesPredictionFunction<SsaChangePointData, ChangePointPrediction>(ml);

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

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,9 @@ public static void SsaSpikeDetectorTransform()
5656
// Setup IidSpikeDetector arguments
5757
var inputColumnName = nameof(SsaSpikeData.Value);
5858
var outputColumnName = nameof(SsaSpikePrediction.Prediction);
59-
var args = new SsaSpikeDetector.Arguments()
60-
{
61-
Source = inputColumnName,
62-
Name = outputColumnName,
63-
Confidence = 95, // The confidence for spike detection in the range [0, 100]
64-
PvalueHistoryLength = 8, // The size of the sliding window for computing the p-value; shorter windows are more sensitive to spikes.
65-
TrainingWindowSize = TrainingSize, // The number of points from the beginning of the sequence used for training.
66-
SeasonalWindowSize = SeasonalitySize + 1 // An upper bound on the largest relevant seasonality in the input time series."
67-
};
6859

6960
// The transformed data.
70-
var transformedData = new SsaSpikeEstimator(ml, args).Fit(dataView).Transform(dataView);
61+
var transformedData = ml.Transforms.SsaSpikeEstimator(outputColumnName, inputColumnName, 95, 8, TrainingSize, SeasonalitySize + 1).Fit(dataView).Transform(dataView);
7162

7263
// Getting the data of the newly created column as an IEnumerable of SsaSpikePrediction.
7364
var predictionColumn = ml.CreateEnumerable<SsaSpikePrediction>(transformedData, reuseRowObject: false);
@@ -127,18 +118,9 @@ public static void SsaSpikeDetectorPrediction()
127118
// Setup IidSpikeDetector arguments
128119
var inputColumnName = nameof(SsaSpikeData.Value);
129120
var outputColumnName = nameof(SsaSpikePrediction.Prediction);
130-
var args = new SsaSpikeDetector.Arguments()
131-
{
132-
Source = inputColumnName,
133-
Name = outputColumnName,
134-
Confidence = 95, // The confidence for spike detection in the range [0, 100]
135-
PvalueHistoryLength = 8, // The size of the sliding window for computing the p-value; shorter windows are more sensitive to spikes.
136-
TrainingWindowSize = TrainingSize, // The number of points from the beginning of the sequence used for training.
137-
SeasonalWindowSize = SeasonalitySize + 1 // An upper bound on the largest relevant seasonality in the input time series."
138-
};
139121

140122
// Train the change point detector.
141-
ITransformer model = new SsaSpikeEstimator(ml, args).Fit(dataView);
123+
ITransformer model = ml.Transforms.SsaChangePointEstimator(outputColumnName, inputColumnName, 95, 8, TrainingSize, SeasonalitySize + 1).Fit(dataView);
142124

143125
// Create a prediction engine from the model for feeding new data.
144126
var engine = model.CreateTimeSeriesPredictionFunction<SsaSpikeData, SsaSpikePrediction>(ml);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using Microsoft.ML.Data;
3-
using Microsoft.ML.Learners;
43
using Microsoft.ML.StaticPipe;
4+
using Microsoft.ML.Trainers;
55

66
namespace Microsoft.ML.Samples.Static
77
{

0 commit comments

Comments
 (0)