Skip to content

Commit 2a1bb29

Browse files
committed
Resolved merged conflicts.
2 parents 51b2028 + 09f40d0 commit 2a1bb29

File tree

106 files changed

+1112
-676
lines changed

Some content is hidden

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

106 files changed

+1112
-676
lines changed

.vsts-dotnet-ci.yml

+18
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ phases:
3131
parameters:
3232
name: Centos
3333
buildScript: ./build.sh
34+
customMatrixes:
35+
Build_Debug_Intrinsics:
36+
_configuration: Debug-Intrinsics
37+
_config_short: DI
38+
_includeBenchmarkData: false
39+
Build_Release:
40+
_configuration: Release
41+
_config_short: R
42+
_includeBenchmarkData: true
3443
queue:
3544
name: Hosted Ubuntu 1604
3645
container: CentosContainer
@@ -39,6 +48,15 @@ phases:
3948
parameters:
4049
name: Ubuntu
4150
buildScript: ./build.sh
51+
customMatrixes:
52+
Build_Debug:
53+
_configuration: Debug
54+
_config_short: D
55+
_includeBenchmarkData: false
56+
Build_Release_Intrinsics:
57+
_configuration: Release-Intrinsics
58+
_config_short: RI
59+
_includeBenchmarkData: true
4260
queue:
4361
name: Hosted Ubuntu 1604
4462
container: UbuntuContainer

BuildToolsVersion.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.0-preview1-03129-01
1+
3.0.0-preview1-03721-01

Microsoft.ML.sln

+5-5
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Microsoft.ML.FSharp.Tests",
100100
EndProject
101101
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.ImageAnalytics", "src\Microsoft.ML.ImageAnalytics\Microsoft.ML.ImageAnalytics.csproj", "{00E38F77-1E61-4CDF-8F97-1417D4E85053}"
102102
EndProject
103-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.HalLearners", "src\Microsoft.ML.HalLearners\Microsoft.ML.HalLearners.csproj", "{A7222F41-1CF0-47D9-B80C-B4D77B027A61}"
103+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.Mkl.Components", "src\Microsoft.ML.Mkl.Components\Microsoft.ML.Mkl.Components.csproj", "{A7222F41-1CF0-47D9-B80C-B4D77B027A61}"
104104
EndProject
105105
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.TensorFlow", "src\Microsoft.ML.TensorFlow\Microsoft.ML.TensorFlow.csproj", "{570A0B8A-5463-44D2-8521-54C0CA4CACA9}"
106106
EndProject
@@ -142,18 +142,18 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.StaticPipe", "
142142
EndProject
143143
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.TensorFlow.StaticPipe", "src\Microsoft.ML.TensorFlow.StaticPipe\Microsoft.ML.TensorFlow.StaticPipe.csproj", "{F95F7AFB-03AF-4D20-BD75-1740B5FF71D3}"
144144
EndProject
145-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.HalLearners.StaticPipe", "src\Microsoft.ML.HalLearners.StaticPipe\Microsoft.ML.HalLearners.StaticPipe.csproj", "{2F25EF6A-C754-45BE-AD9E-7DDF46A1B51A}"
145+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.Mkl.Components.StaticPipe", "src\Microsoft.ML.Mkl.Components.StaticPipe\Microsoft.ML.Mkl.Components.StaticPipe.csproj", "{2F25EF6A-C754-45BE-AD9E-7DDF46A1B51A}"
146146
EndProject
147147
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.OnnxTransformer.StaticPipe", "src\Microsoft.ML.OnnxTransformer.StaticPipe\Microsoft.ML.OnnxTransformer.StaticPipe.csproj", "{D1324668-9568-40F4-AA55-30A9A516C230}"
148148
EndProject
149149
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.LightGBM.StaticPipe", "src\Microsoft.ML.LightGBM.StaticPipe\Microsoft.ML.LightGBM.StaticPipe.csproj", "{22C51B08-ACAE-47B2-A312-462DC239A23B}"
150150
EndProject
151151
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.TimeSeries.StaticPipe", "src\Microsoft.ML.TimeSeries.StaticPipe\Microsoft.ML.TimeSeries.StaticPipe.csproj", "{06A147ED-15EA-4106-9105-9B745125B470}"
152152
EndProject
153-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Microsoft.ML.HalLearners", "Microsoft.ML.HalLearners", "{63006A14-B924-48C5-83C9-CFE9DA22B01F}"
153+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Microsoft.ML.Mkl.Components", "Microsoft.ML.Mkl.Components", "{63006A14-B924-48C5-83C9-CFE9DA22B01F}"
154154
ProjectSection(SolutionItems) = preProject
155-
pkg\Microsoft.ML.HalLearners\Microsoft.ML.HalLearners.nupkgproj = pkg\Microsoft.ML.HalLearners\Microsoft.ML.HalLearners.nupkgproj
156-
pkg\Microsoft.ML.HalLearners\Microsoft.ML.HalLearners.symbols.nupkgproj = pkg\Microsoft.ML.HalLearners\Microsoft.ML.HalLearners.symbols.nupkgproj
155+
pkg\Microsoft.ML.Mkl.Components\Microsoft.ML.Mkl.Components.nupkgproj = pkg\Microsoft.ML.Mkl.Components\Microsoft.ML.Mkl.Components.nupkgproj
156+
pkg\Microsoft.ML.Mkl.Components\Microsoft.ML.Mkl.Components.symbols.nupkgproj = pkg\Microsoft.ML.Mkl.Components\Microsoft.ML.Mkl.Components.symbols.nupkgproj
157157
EndProjectSection
158158
EndProject
159159
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Microsoft.ML.ImageAnalytics", "Microsoft.ML.ImageAnalytics", "{1229F799-37F0-4282-B9F0-74BFA97CC362}"

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

+2-3
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ public static void Example()
4444
var outData = featureContributionCalculator.Fit(scoredData).Transform(scoredData);
4545

4646
// Let's extract the weights from the linear model to use as a comparison
47-
var weights = new VBuffer<float>();
48-
model.Model.GetFeatureWeights(ref weights);
47+
var weights = model.Model.Weights;
4948

5049
// Let's now walk through the first ten records and see which feature drove the values the most
5150
// Get prediction scores and contributions
@@ -63,7 +62,7 @@ public static void Example()
6362
var value = row.Features[featureOfInterest];
6463
var contribution = row.FeatureContributions[featureOfInterest];
6564
var name = data.Schema[featureOfInterest + 1].Name;
66-
var weight = weights.GetValues()[featureOfInterest];
65+
var weight = weights[featureOfInterest];
6766

6867
Console.WriteLine("{0:0.00}\t{1:0.00}\t{2}\t{3:0.00}\t{4:0.00}\t{5:0.00}",
6968
row.MedianHomeValue,

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

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using Microsoft.Data.DataView;
44
using Microsoft.ML.Trainers;
55
using Microsoft.ML.SamplesUtils;
6-
using Microsoft.ML.Trainers.HalLearners;
76

87
namespace Microsoft.ML.Samples.Dynamic.PermutationFeatureImportance
98
{

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

-43
This file was deleted.

docs/samples/Microsoft.ML.Samples/Dynamic/TensorFlow/ImageClassification.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ public static void Example()
2020
var idv = mlContext.Data.LoadFromEnumerable(data);
2121

2222
// Create a ML pipeline.
23-
var pipeline = mlContext.Transforms.ScoreTensorFlowModel(
24-
modelLocation,
23+
var pipeline = mlContext.Model.LoadTensorFlowModel(modelLocation).ScoreTensorFlowModel(
2524
new[] { nameof(OutputScores.output) },
2625
new[] { nameof(TensorData.input) });
2726

docs/samples/Microsoft.ML.Samples/Dynamic/TensorFlow/TextClassification.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ public static void Example()
4545
// Load the TensorFlow model once.
4646
// - Use it for quering the schema for input and output in the model
4747
// - Use it for prediction in the pipeline.
48-
var modelInfo = TensorFlowUtils.LoadTensorFlowModel(mlContext, modelLocation);
49-
var schema = modelInfo.GetModelSchema();
48+
var tensorFlowModel = mlContext.Model.LoadTensorFlowModel(modelLocation);
49+
var schema = tensorFlowModel.GetModelSchema();
5050
var featuresType = (VectorType)schema["Features"].Type;
5151
Console.WriteLine("Name: {0}, Type: {1}, Shape: (-1, {2})", "Features", featuresType.ItemType.RawType, featuresType.Dimensions[0]);
5252
var predictionType = (VectorType)schema["Prediction/Softmax"].Type;
@@ -72,7 +72,7 @@ public static void Example()
7272
var engine = mlContext.Transforms.Text.TokenizeWords("TokenizedWords", "Sentiment_Text")
7373
.Append(mlContext.Transforms.Conversion.ValueMap(lookupMap, "Words", "Ids", new ColumnOptions[] { ("VariableLenghtFeatures", "TokenizedWords") }))
7474
.Append(mlContext.Transforms.CustomMapping(ResizeFeaturesAction, "Resize"))
75-
.Append(mlContext.Transforms.ScoreTensorFlowModel(modelInfo, new[] { "Prediction/Softmax" }, new[] { "Features" }))
75+
.Append(tensorFlowModel.ScoreTensorFlowModel(new[] { "Prediction/Softmax" }, new[] { "Features" }))
7676
.Append(mlContext.Transforms.CopyColumns(("Prediction", "Prediction/Softmax")))
7777
.Fit(dataView)
7878
.CreatePredictionEngine<IMDBSentiment, OutputScores>(mlContext);

docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/PriorTrainerSample.cs renamed to docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/PriorTrainerSample.cs

+27-22
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ public class PriorTrainer
77
{
88
public static void Example()
99
{
10-
// Downloading the dataset from github.com/dotnet/machinelearning.
11-
// This will create a sentiment.tsv file in the filesystem.
12-
// You can open this file, if you want to see the data.
13-
string dataFile = SamplesUtils.DatasetUtils.DownloadSentimentDataset()[0];
10+
// Create a new context for ML.NET operations. It can be used for exception tracking and logging,
11+
// as a catalog of available operations and as the source of randomness.
12+
var mlContext = new MLContext();
13+
14+
// Download and featurize the dataset.
15+
var dataFiles = SamplesUtils.DatasetUtils.DownloadSentimentDataset();
16+
var trainFile = dataFiles[0];
17+
var testFile = dataFiles[1];
1418

1519
// A preview of the data.
1620
// Sentiment SentimentText
1721
// 0 " :Erm, thank you. "
1822
// 1 ==You're cool==
1923

20-
// Create a new context for ML.NET operations. It can be used for exception tracking and logging,
21-
// as a catalog of available operations and as the source of randomness.
22-
var mlContext = new MLContext();
23-
24-
// Step 1: Load the data as an IDataView.
25-
// First, we define the loader: specify the data columns and where to find them in the text file.
24+
// Step 1: Read the data as an IDataView.
25+
// First, we define the reader: specify the data columns and where to find them in the text file.
2626
var loader = mlContext.Data.CreateTextLoader(
2727
columns: new[]
2828
{
@@ -31,12 +31,9 @@ public static void Example()
3131
},
3232
hasHeader: true
3333
);
34-
35-
// Load the data
36-
var data = loader.Load(dataFile);
3734

38-
// Split it between training and test data
39-
var trainTestData = mlContext.BinaryClassification.TrainTestSplit(data);
35+
// Load the data
36+
var trainData = loader.Load(trainFile);
4037

4138
// Step 2: Pipeline
4239
// Featurize the text column through the FeaturizeText API.
@@ -47,19 +44,27 @@ public static void Example()
4744
.Append(mlContext.BinaryClassification.Trainers.Prior(labelColumnName: "Sentiment"));
4845

4946
// Step 3: Train the pipeline
50-
var trainedPipeline = pipeline.Fit(trainTestData.TrainSet);
47+
var trainedPipeline = pipeline.Fit(trainData);
5148

5249
// Step 4: Evaluate on the test set
53-
var transformedData = trainedPipeline.Transform(trainTestData.TestSet);
50+
var transformedData = trainedPipeline.Transform(loader.Load(testFile));
5451
var evalMetrics = mlContext.BinaryClassification.Evaluate(transformedData, label: "Sentiment");
55-
56-
// Step 5: Inspect the output
57-
Console.WriteLine("Accuracy: " + evalMetrics.Accuracy);
52+
SamplesUtils.ConsoleUtils.PrintMetrics(evalMetrics);
5853

5954
// The Prior trainer outputs the proportion of a label in the dataset as the probability of that label.
60-
// In this case it means that there is a split of around 64%-36% of positive and negative labels in the dataset.
55+
// In this case 'Accuracy: 0.50' means that there is a split of around 50%-50% of positive and negative labels in the test dataset.
6156
// Expected output:
62-
// Accuracy: 0.647058823529412
57+
58+
// Accuracy: 0.50
59+
// AUC: 0.50
60+
// F1 Score: 0.67
61+
// Negative Precision: 0.00
62+
// Negative Recall: 0.00
63+
// Positive Precision: 0.50
64+
// Positive Recall: 1.00
65+
// LogLoss: 1.05
66+
// LogLossReduction: -4.89
67+
// Entropy: 1.00
6368
}
6469
}
6570
}

docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/RandomTrainerSample.cs renamed to docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/RandomTrainerSample.cs

+29-24
Original file line numberDiff line numberDiff line change
@@ -7,59 +7,64 @@ public static class RandomTrainer
77
{
88
public static void Example()
99
{
10-
// Downloading the dataset from github.com/dotnet/machinelearning.
11-
// This will create a sentiment.tsv file in the filesystem.
12-
// You can open this file, if you want to see the data.
13-
string dataFile = SamplesUtils.DatasetUtils.DownloadSentimentDataset()[0];
10+
// Create a new context for ML.NET operations. It can be used for exception tracking and logging,
11+
// as a catalog of available operations and as the source of randomness.
12+
var mlContext = new MLContext(seed: 1);
13+
14+
// Download and featurize the dataset.
15+
var dataFiles = SamplesUtils.DatasetUtils.DownloadSentimentDataset();
16+
var trainFile = dataFiles[0];
17+
var testFile = dataFiles[1];
1418

1519
// A preview of the data.
1620
// Sentiment SentimentText
1721
// 0 " :Erm, thank you. "
1822
// 1 ==You're cool==
1923

20-
// Create a new context for ML.NET operations. It can be used for exception tracking and logging,
21-
// as a catalog of available operations and as the source of randomness.
22-
var mlContext = new MLContext(seed: 1);
23-
24-
// Step 1: Load the data as an IDataView.
25-
// First, we define the loader: specify the data columns and where to find them in the text file.
26-
var loader = mlContext.Data.CreateTextLoader(
24+
// Step 1: Read the data as an IDataView.
25+
// First, we define the reader: specify the data columns and where to find them in the text file.
26+
var reader = mlContext.Data.CreateTextLoader(
2727
columns: new[]
2828
{
2929
new TextLoader.Column("Sentiment", DataKind.Single, 0),
3030
new TextLoader.Column("SentimentText", DataKind.String, 1)
3131
},
3232
hasHeader: true
3333
);
34-
35-
// Load the data
36-
var data = loader.Load(dataFile);
3734

38-
// Split it between training and test data
39-
var trainTestData = mlContext.BinaryClassification.TrainTestSplit(data);
35+
// Read the data
36+
var trainData = reader.Load(trainFile);
4037

4138
// Step 2: Pipeline
4239
// Featurize the text column through the FeaturizeText API.
4340
// Then append a binary classifier, setting the "Label" column as the label of the dataset, and
4441
// the "Features" column produced by FeaturizeText as the features column.
4542
var pipeline = mlContext.Transforms.Text.FeaturizeText("Features", "SentimentText")
46-
.AppendCacheCheckpoint(mlContext) // Add a data-cache step within a pipeline.
43+
.AppendCacheCheckpoint(mlContext)
4744
.Append(mlContext.BinaryClassification.Trainers.Random());
4845

4946
// Step 3: Train the pipeline
50-
var trainedPipeline = pipeline.Fit(trainTestData.TrainSet);
47+
var trainedPipeline = pipeline.Fit(trainData);
5148

5249
// Step 4: Evaluate on the test set
53-
var transformedData = trainedPipeline.Transform(trainTestData.TestSet);
50+
var transformedData = trainedPipeline.Transform(reader.Load(testFile));
5451
var evalMetrics = mlContext.BinaryClassification.Evaluate(transformedData, label: "Sentiment");
55-
56-
// Step 5: Inspect the output
57-
Console.WriteLine("Accuracy: " + evalMetrics.Accuracy);
52+
SamplesUtils.ConsoleUtils.PrintMetrics(evalMetrics);
5853

5954
// We expect an output probability closet to 0.5 as the Random trainer outputs a random prediction.
6055
// Regardless of the input features, the trainer will predict either positive or negative label with equal probability.
61-
// Expected output (close to 0.5):
62-
// Accuracy: 0.588235294117647
56+
// Expected output: (close to 0.5):
57+
58+
// Accuracy: 0.56
59+
// AUC: 0.57
60+
// F1 Score: 0.60
61+
// Negative Precision: 0.57
62+
// Negative Recall: 0.44
63+
// Positive Precision: 0.55
64+
// Positive Recall: 0.67
65+
// LogLoss: 1.53
66+
// LogLossReduction: -53.37
67+
// Entropy: 1.00
6368
}
6469
}
6570
}

docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/SDCALogisticRegression.cs renamed to docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/StochasticDualCoordinateAscent.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace Microsoft.ML.Samples.Dynamic.Trainers.BinaryClassification
77
{
8-
public static class SDCALogisticRegression
8+
public static class StochasticDualCoordinateAscent
99
{
1010
public static void Example()
1111
{

docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/SDCASupportVectorMachine.cs renamed to docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/StochasticDualCoordinateAscentNonCalibrated.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Microsoft.ML.Samples.Dynamic.Trainers.BinaryClassification
66
{
7-
public static class SDCASupportVectorMachine
7+
public static class StochasticDualCoordinateAscentNonCalibrated
88
{
99
public static void Example()
1010
{

0 commit comments

Comments
 (0)