Skip to content

Commit 0793182

Browse files
authored
Merge pull request #7 from dotnet/master
Merge
2 parents 5992842 + e14db27 commit 0793182

File tree

162 files changed

+3208
-2456
lines changed

Some content is hidden

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

162 files changed

+3208
-2456
lines changed

BuildToolsVersion.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.0-preview1-03721-01
1+
3.0.0-preview1-03801-01

README.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Along with these ML capabilities, this first release of ML.NET also brings the f
1818

1919
ML.NET runs on Windows, Linux, and macOS using [.NET Core](https://github.com/dotnet/core), or Windows using .NET Framework. 64 bit is supported on all platforms. 32 bit is supported on Windows, except for TensorFlow, LightGBM, and ONNX related functionality.
2020

21-
The current release is 0.10. Check out the [release notes](docs/release-notes/0.10/release-0.10.md) to see what's new.
21+
The current release is 0.11. Check out the [release notes](docs/release-notes/0.11/release-0.11.md) to see what's new.
2222

2323
First, ensure you have installed [.NET Core 2.1](https://www.microsoft.com/net/learn/get-started) or later. ML.NET also works on the .NET Framework 4.6.1 or later, but 4.7.2 or later is recommended.
2424

@@ -46,7 +46,7 @@ To build ML.NET from source please visit our [developers guide](docs/project-doc
4646

4747
| | Debug | Release |
4848
|:---|----------------:|------------------:|
49-
|**Linux**|[![x64-debug](https://dnceng.visualstudio.com/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=master&jobname=Linux&configuration=Build_Debug)](https://dnceng.visualstudio.com/DotNet-Public/_build/latest?definitionId=104&branch=master)|[![x64-release](https://dnceng.visualstudio.com/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=master&jobname=Linux&configuration=Build_Release)](https://dnceng.visualstudio.com/DotNet-Public/_build/latest?definitionId=104&branch=master)|
49+
|**CentOS**|[![x64-debug](https://dnceng.visualstudio.com/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=master&jobname=CentOS&configuration=Build_Debug_Intrinsics)](https://dnceng.visualstudio.com/DotNet-Public/_build/latest?definitionId=104&branch=master)|[![x64-release](https://dnceng.visualstudio.com/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=master&jobname=CentOS&configuration=Build_Release)](https://dnceng.visualstudio.com/DotNet-Public/_build/latest?definitionId=104&branch=master)|
5050
|**macOS**|[![x64-debug](https://dnceng.visualstudio.com/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=master&jobname=macOS&configuration=Build_Debug)](https://dnceng.visualstudio.com/DotNet-Public/_build/latest?definitionId=104&branch=master)|[![x64-release](https://dnceng.visualstudio.com/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=master&jobname=macOS&configuration=Build_Release)](https://dnceng.visualstudio.com/DotNet-Public/_build/latest?definitionId=104&branch=master)|
5151
|**Windows x64**|[![x64-debug](https://dnceng.visualstudio.com/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=master&jobname=Windows_x64&configuration=Build_Debug)](https://dnceng.visualstudio.com/DotNet-Public/_build/latest?definitionId=104&branch=master)|[![x64-release](https://dnceng.visualstudio.com/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=master&jobname=Windows_x64&configuration=Build_Release)](https://dnceng.visualstudio.com/DotNet-Public/_build/latest?definitionId=104&branch=master)|
5252
|**Windows x86**|[![Build Status](https://dnceng.visualstudio.com/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=master&jobName=Windows_x86&configuration=Build_Debug)](https://dnceng.visualstudio.com/public/_build/latest?definitionId=104?branchName=master)|[![Build Status](https://dnceng.visualstudio.com/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=master&jobName=Windows_x86&configuration=Build_Release)](https://dnceng.visualstudio.com/public/_build/latest?definitionId=104?branchName=master)|
@@ -69,16 +69,14 @@ Here's an example of code to train a model to predict sentiment from text sample
6969

7070
```C#
7171
var mlContext = new MLContext();
72-
var reader = mlContext.Data.CreateTextLoader(new TextLoader.Arguments
73-
{
74-
Column = new[] {
75-
new TextLoader.Column("SentimentText", DataKind.Text, 1),
76-
new TextLoader.Column("Label", DataKind.Bool, 0),
77-
},
78-
HasHeader = true,
79-
Separator = ","
80-
});
81-
var data = reader.Read(dataPath);
72+
var loader = mlContext.Data.CreateTextLoader(new[]
73+
{
74+
new TextLoader.Column("SentimentText", DataKind.String, 1),
75+
new TextLoader.Column("Label", DataKind.Boolean, 0),
76+
},
77+
hasHeader: true,
78+
separatorChar: ',');
79+
var data = loader.Load(dataPath);
8280
var learningPipeline = mlContext.Transforms.Text.FeaturizeText("Features", "SentimentText")
8381
.Append(mlContext.BinaryClassification.Trainers.FastTree());
8482
var model = learningPipeline.Fit(data);
@@ -116,4 +114,3 @@ ML.NET is a [.NET Foundation](https://www.dotnetfoundation.org/projects) project
116114
There are many .NET related projects on GitHub.
117115

118116
- [.NET home repo](https://github.com/Microsoft/dotnet) - links to 100s of .NET projects, from Microsoft and the community.
119-

docs/building/MlNetMklDeps/MlNetMklDeps.nuspec

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,22 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2013/01/nuspec.xsd">
33
<metadata>
44
<id>MlNetMklDeps</id>
5-
<version>0.0.0.7</version>
5+
<version>0.0.0.9</version>
66
<title>This NuGet package provides Intel(R) MKL dependencies for ML.NET</title>
77
<authors>Intel Corporation</authors>
88
<owners>Microsoft</owners>
99
<projectUrl>https://dot.net/ml</projectUrl>
10-
<licenseUrl>https://software.intel.com/en-us/license/intel-simplified-software-license</licenseUrl>
1110
<requireLicenseAcceptance>true</requireLicenseAcceptance>
1211
<description>
1312
Intel(R) MKL Dependencies for Microsoft ML.NET.
1413
</description>
15-
<copyright>Copyright (c) 2018 Intel Corporation.</copyright>
14+
<copyright>Copyright (c) 2019 Intel Corporation.</copyright>
1615
<tags>ML.Net Mkl Deps</tags>
16+
<license type="file">license.txt</license>
1717
</metadata>
18+
<files>
19+
<file src="licensing\license.txt" target="" />
20+
<file src="licensing\third-party-programs.txt" target="" />
21+
<file src="runtimes\**" target="runtimes" />
22+
</files>
1823
</package>

docs/building/MlNetMklDeps/README.md

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,48 @@ Windows (32 and 64 bit):
77
- Open an admin command prompt and run the following commands, CAREFULLY INSPECTING THE COMMAND OUTPUT FOR ERRORS.
88
- TLCROOT should be the root of your TLC_Resources folder.
99

10+
Directory layout for nuget file is as follows:
11+
* licensing (contains Intel's license.txt they ship MKL with along with any third party licenses)
12+
* runtimes
13+
** linux-x64
14+
*** native (contains linux binaries)
15+
** osx-x64
16+
*** native (cntains osx binaries)
17+
** win-x64
18+
*** native (contains windows x64 binaries)
19+
** win-x86
20+
*** native (contains windows ia32 binaries)
21+
1022
##Windows
11-
1. Modify user_example_list file in directory to contain all required functions, that are present in the [mlnetmkl.list](mlnetmkl.list) file
12-
2. "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
13-
3. nmake libia32 name=MklImports (add threading=sequential if you are building without openmp)
14-
4. copy /Y Microsoft.ML.MklImports.* to the folder that will host the x86 binaries.
15-
5. del Microsoft.ML.MklImports.*
16-
6. "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
17-
7. nmake intel64 name=MklImports (add threading=sequential if you are building without openmp)
18-
8. copy /Y Microsoft.ML.MklImports.* to the folder that will host the x64 binaries.
23+
1. In the Intel install directory, go to compilers_and_libraries\windows\mkl\tools\builder
24+
2. Modify user_example_list file in directory to contain all required functions, that are present in the [mlnetmkl.list
25+
](mlnetmkl.list) file
26+
3. "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
27+
4. nmake libia32 name=MklImports (add threading=sequential if you are building without openmp)
28+
5. Copy MKL library: copy /Y MklImports.* to the folder that will host the x86 binaries.
29+
6. Copy openmp library: copy /Y ..\..\..\redist\ia32_win\compiler\libiomp5md* to the folder for x86 binaries.
30+
7. del MklImports.*
31+
8. "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
32+
9. nmake intel64 name=MklImports (add threading=sequential if you are building without openmp)
33+
10. Copy mkl library: copy /Y MklImports.* to the folder that will host the x64 binaries.
34+
11. Copy openmp library: copy /Y ..\..\..\redist\intel64_win\compiler\libiomp5md* to the folder for x86 binaries.
1935

2036
##Linux
37+
NOTE: Do not copy the libiomp5 file for Linux builds as this relies on OpenMP to be installed on the system.
2138
1. untar the linux sdk (tar -zxvf name_of_downloaded_file)
2239
2. Run installation script and follow the instuctions in the dialog screens that are presented ./install.sh
23-
3. Go to /opt/mkl/tools/builder.
40+
3. Go to /opt/intel/mkl/tools/builder.
2441
4. Modify makefile add -Wl,-rpath,'$$ORIGIN' \ -Wl,-z,origin \ after -Wl,--end-group \
2542
5. Modify user_example_list file in directory to contain all the required functions, that are present in the [mlnetmkl.list](mlnetmkl.list) file
2643
6. Run make intel64 name=libMklImports (add threading=sequential if you are building without openmp)
27-
7. Copy libMklImports.so the folder containing the Linux binaries.
2844

2945
##OSX
46+
NOTE: Do not copy the libiomp5 file for OSX builds as this relies on OpenMP to be installed on the system.
3047
1. extract and install the dmg (double-click and drag it in the Applications folder)
3148
2. Go to /opt/mkl/tools/builder.
3249
3. Modify user_example_list file in directory to contain all the required functions, that are present in the [mlnetmkl.list](mlnetmkl.list) file
33-
4. Run make intel64 name=libMklImports (add threading=sequential if you are building without openmp)
50+
4. Run make libintel64 name=libMklImports (add threading=sequential if you are building without openmp)
3451
5. Copy libMklImports.dylib from the builder directory to the folder containign the OSX binaries.
3552
6. Fix the id and the rpath running the following commands:
3653
sudo install_name_tool -id "@loader_path/libMklImports.dylib" libMklImports.dylib
37-
sudo install_name_tool -id "@rpath/libMklImports.dylib" libMklImports.dylib
54+
sudo install_name_tool -id "@rpath/libMklImports.dylib" libMklImports.dylib

docs/building/MlNetMklDeps/version.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,10 @@ mac: mkl 2018 update 1
77
##Exact versions, including minors
88
mac: 2018.1.126
99
linux: 2018.3.222
10-
windows: 2018.3.210
10+
windows: 2018.3.210
11+
12+
#Intel MKl SDK versions used to build the MlNetMklDeps v0.0.0.9
13+
mkl 2019 Update 2
14+
mac:2019.2.187
15+
linux:2019.2.187
16+
windows:2019.2.187

docs/code/MlNetCookBook.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -944,9 +944,9 @@ public static IDataView PrepareData(MLContext mlContext, IDataView data)
944944
{
945945
// Define the operation code.
946946
Action<InputRow, OutputRow> mapping = (input, output) => output.Label = input.Income > 50000;
947-
// Make a custom transformer and transform the data.
948-
var transformer = mlContext.Transforms.CustomMappingTransformer(mapping, null);
949-
return transformer.Transform(data);
947+
// Make a custom estimator and transform the data.
948+
var estimator = mlContext.Transforms.CustomMapping(mapping, null);
949+
return estimator.Fit(data).Transform(data);
950950
}
951951
```
952952

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# ML.NET 0.11 Release Notes
2+
3+
[ML.NET](https://aka.ms/mlnet) 0.11 will be the last preview release before we reach `Release Candidate` for v1. We continue to push for creating a coherent and clean API surface for [ML.NET](https://aka.ms/mlnet) users. This release includes several bug fixes as well as extensive work on reducing the public API surface. The work on the API is tracked via [this project](https://github.com/dotnet/machinelearning/projects/13). In the upcoming 0.12 (RC1) releases before we reach 1.0, we will continue on refining the API and improving documentation.
4+
5+
### Installation
6+
7+
ML.NET supports Windows, MacOS, and Linux. See [supported OS versions of .NET Core 2.0](https://github.com/dotnet/core/blob/master/release-notes/2.0/2.0-supported-os.md) for more details.
8+
9+
You can install ML.NET NuGet from the CLI using:
10+
```
11+
dotnet add package Microsoft.ML
12+
```
13+
14+
From package manager:
15+
```
16+
Install-Package Microsoft.ML
17+
```
18+
19+
### Release Notes
20+
21+
Below are a few of the highlights from this release. There are many other improvements in the API.
22+
23+
* Creation of components through MLContext: advanced options and other feedback. ([#1798](https://github.coalsom/dotnet/machinelearning/issues/1798))
24+
* Several issues closed on internalizing public surface. ([19 issues](https://github.com/dotnet/machinelearning/issues?q=is%3Aissue+lockdown+is%3Aclosed))
25+
* Stop using MEF as part of the public API. ([#2422](https://github.com/dotnet/machinelearning/issues/2422))
26+
* Several `NameSpace` changes. ([#2326](https://github.com/dotnet/machinelearning/issues/2326))
27+
* `ONNX` is now `ONNXConverter`. ([#2625](https://github.com/dotnet/machinelearning/pull/2625))
28+
* `ONNXTransform` is now `ONNXTransformer`. ([#2544](https://github.com/dotnet/machinelearning/pull/2544))
29+
* `FastTree` has it's own package now. ([#2752](https://github.com/dotnet/machinelearning/issues/2752))
30+
* `Ensemble` has been moved out of `Microsoft.ML` package. ([#2717](https://github.com/dotnet/machinelearning/issues/2717))
31+
* Add support for string types in TensorFlowTransformer. ([#2545](https://github.com/dotnet/machinelearning/issues/2545))
32+
* Make FastTree/LightGBM learned model suitable for public consumption. ([#1960](https://github.com/dotnet/machinelearning/issues/1960))
33+
34+
35+
### Acknowledgements
36+
37+
Shoutout to [PaulTFreedman](https://github.com/PaulTFreedman),
38+
[kant2002](https://github.com/kant2002),
39+
[jwood803](https://github.com/jwood803), [mareklinka](https://github.com/mareklinka), [elbruno](https://github.com/elbruno) and the [ML.NET](https://aka.ms/mlnet) team for their
40+
contributions as part of this release!

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

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,12 @@ public static void Example()
3030
// We will train a FastTreeRegression model with 1 tree on these two columns to predict Age.
3131
string outputColumnName = "Features";
3232
var pipeline = ml.Transforms.Concatenate(outputColumnName, new[] { "Parity", "Induced" })
33-
.Append(ml.Regression.Trainers.FastTree(labelColumnName: "Age", featureColumnName: outputColumnName, numTrees: 1, numLeaves: 2, minDatapointsInLeaves: 1));
33+
.Append(ml.Regression.Trainers.FastTree(labelColumnName: "Age", featureColumnName: outputColumnName, numberOfTrees: 1, numberOfLeaves: 2, minimumExampleCountPerLeaf: 1));
3434

3535
var model = pipeline.Fit(trainData);
3636

3737
// Get the trained model parameters.
3838
var modelParams = model.LastTransformer.Model;
39-
40-
// Let's see where an example with Parity = 1 and Induced = 1 would end up in the single trained tree.
41-
var testRow = new VBuffer<float>(2, new[] { 1.0f, 1.0f });
42-
// Use the path object to pass to GetLeaf, which will populate path with the IDs of th nodes from root to leaf.
43-
List<int> path = default;
44-
// Get the ID of the leaf this example ends up in tree 0.
45-
var leafID = modelParams.GetLeaf(0, in testRow, ref path);
46-
// Get the leaf value for this leaf ID in tree 0.
47-
var leafValue = modelParams.GetLeafValue(0, leafID);
48-
Console.WriteLine("The leaf value in tree 0 is: " + leafValue);
4939
}
5040
}
5141
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public static void Example()
5555
// specify the parameter `numBins', which controls the number of bins used in the approximation of the mutual information
5656
// between features and label.
5757
var mutualInfoEst = ml.Transforms.FeatureSelection.SelectFeaturesBasedOnMutualInformation(
58-
outputColumnName: "FeaturesMISelect", inputColumnName: "FeaturesCountSelect", labelColumn: "Label", slotsInOutput: 5);
58+
outputColumnName: "FeaturesMISelect", inputColumnName: "FeaturesCountSelect", labelColumnName: "Label", slotsInOutput: 5);
5959

6060
// Now, we can put the previous two transformations together in a pipeline.
6161
var pipeline = countSelectEst.Append(mutualInfoEst);

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public static void Example()
2828
.ToArray();
2929
var pipeline = mlContext.Transforms.Concatenate("Features", featureNames)
3030
.Append(mlContext.Regression.Trainers.GeneralizedAdditiveModels(
31-
labelColumnName: labelName, featureColumnName: "Features", maxBins: 16));
31+
labelColumnName: labelName, featureColumnName: "Features", maximumBinCountPerFeature: 16));
3232
var fitPipeline = pipeline.Fit(data);
3333

3434
// Extract the model from the pipeline
@@ -37,7 +37,7 @@ public static void Example()
3737
// Now investigate the properties of the Generalized Additive Model: The intercept and shape functions.
3838

3939
// The intercept for the GAM models represent the average prediction for the training data
40-
var intercept = gamModel.Intercept;
40+
var intercept = gamModel.Bias;
4141
// Expected output: Average predicted cost: 22.53
4242
Console.WriteLine($"Average predicted cost: {intercept:0.00}");
4343

@@ -93,7 +93,7 @@ public static void Example()
9393
// Distillation." <a href='https://arxiv.org/abs/1710.06169'>arXiv:1710.06169</a>."
9494
Console.WriteLine();
9595
Console.WriteLine("Student-Teacher Ratio");
96-
for (int i = 0; i < teacherRatioBinUpperBounds.Length; i++)
96+
for (int i = 0; i < teacherRatioBinUpperBounds.Count; i++)
9797
{
9898
Console.WriteLine($"x < {teacherRatioBinUpperBounds[i]:0.00} => {teacherRatioBinEffects[i]:0.000}");
9999
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public static IDataView GetHousingRegressionIDataView(MLContext mlContext, out s
1919
if (binaryPrediction)
2020
{
2121
labelColumn = nameof(BinaryOutputRow.AboveAverage);
22-
data = mlContext.Transforms.CustomMappingTransformer(GreaterThanAverage, null).Transform(data);
22+
data = mlContext.Transforms.CustomMapping(GreaterThanAverage, null).Fit(data).Transform(data);
2323
data = mlContext.Transforms.DropColumns("MedianHomeValue").Fit(data).Transform(data);
2424
}
2525

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ public static void Example()
3737
var permutationMetrics = mlContext.BinaryClassification.PermutationFeatureImportance(
3838
linearPredictor, transformedData, label: labelName, features: "Features", permutationCount: 3);
3939

40-
// Now let's look at which features are most important to the model overall
41-
// Get the feature indices sorted by their impact on AUC
42-
var sortedIndices = permutationMetrics.Select((metrics, index) => new { index, metrics.Auc })
43-
.OrderByDescending(feature => Math.Abs(feature.Auc.Mean))
40+
// Now let's look at which features are most important to the model overall.
41+
// Get the feature indices sorted by their impact on AreaUnderRocCurve.
42+
var sortedIndices = permutationMetrics.Select((metrics, index) => new { index, metrics.AreaUnderRocCurve })
43+
.OrderByDescending(feature => Math.Abs(feature.AreaUnderRocCurve.Mean))
4444
.Select(feature => feature.index);
4545

4646
// Print out the permutation results, with the model weights, in order of their impact:
@@ -66,7 +66,7 @@ public static void Example()
6666
// Third, some features show an *increase* in AUC. This means that the model actually improved
6767
// when these features were shuffled. This is a sign to investigate these features further.
6868
Console.WriteLine("Feature\tModel Weight\tChange in AUC\t95% Confidence in the Mean Change in AUC");
69-
var auc = permutationMetrics.Select(x => x.Auc).ToArray(); // Fetch AUC as an array
69+
var auc = permutationMetrics.Select(x => x.AreaUnderRocCurve).ToArray(); // Fetch AUC as an array
7070
foreach (int i in sortedIndices)
7171
{
7272
Console.WriteLine($"{featureNames[i]}\t{weights[i]:0.00}\t{auc[i].Mean:G4}\t{1.96 * auc[i].StandardError:G4}");

0 commit comments

Comments
 (0)