Skip to content

Commit

Permalink
Merge pull request #2067 from shauheen/release/v09rc2
Browse files Browse the repository at this point in the history
Update release for 0.9
  • Loading branch information
shauheen authored Jan 8, 2019
2 parents c6b1612 + 30dd0c2 commit 941d9fc
Show file tree
Hide file tree
Showing 303 changed files with 6,965 additions and 34,300 deletions.
13 changes: 1 addition & 12 deletions Microsoft.ML.sln
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.StandardLearne
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.Transforms", "src\Microsoft.ML.Transforms\Microsoft.ML.Transforms.csproj", "{2911A286-ECA4-4730-97A9-DA1FEE2DED97}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.Legacy", "src\Microsoft.ML.Legacy\Microsoft.ML.Legacy.csproj", "{7288C084-11C0-43BE-AC7F-45DCFEAEEBF6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.KMeansClustering", "src\Microsoft.ML.KMeansClustering\Microsoft.ML.KMeansClustering.csproj", "{F1CAE3AB-4F86-4BC0-BBA8-C4A58E7E8A4A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.PCA", "src\Microsoft.ML.PCA\Microsoft.ML.PCA.csproj", "{58E06735-1129-4DD5-86E0-6BBFF049AAD9}"
Expand Down Expand Up @@ -147,7 +145,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.HalLearners.St
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.OnnxTransform.StaticPipe", "src\Microsoft.ML.OnnxTransform.StaticPipe\Microsoft.ML.OnnxTransform.StaticPipe.csproj", "{D1324668-9568-40F4-AA55-30A9A516C230}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.ML.LightGBM.StaticPipe", "src\Microsoft.ML.LightGBM.StaticPipe\Microsoft.ML.LightGBM.StaticPipe.csproj", "{22C51B08-ACAE-47B2-A312-462DC239A23B}"
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}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -213,14 +211,6 @@ Global
{2911A286-ECA4-4730-97A9-DA1FEE2DED97}.Release|Any CPU.Build.0 = Release|Any CPU
{2911A286-ECA4-4730-97A9-DA1FEE2DED97}.Release-Intrinsics|Any CPU.ActiveCfg = Release-Intrinsics|Any CPU
{2911A286-ECA4-4730-97A9-DA1FEE2DED97}.Release-Intrinsics|Any CPU.Build.0 = Release-Intrinsics|Any CPU
{7288C084-11C0-43BE-AC7F-45DCFEAEEBF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7288C084-11C0-43BE-AC7F-45DCFEAEEBF6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7288C084-11C0-43BE-AC7F-45DCFEAEEBF6}.Debug-Intrinsics|Any CPU.ActiveCfg = Debug-Intrinsics|Any CPU
{7288C084-11C0-43BE-AC7F-45DCFEAEEBF6}.Debug-Intrinsics|Any CPU.Build.0 = Debug-Intrinsics|Any CPU
{7288C084-11C0-43BE-AC7F-45DCFEAEEBF6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7288C084-11C0-43BE-AC7F-45DCFEAEEBF6}.Release|Any CPU.Build.0 = Release|Any CPU
{7288C084-11C0-43BE-AC7F-45DCFEAEEBF6}.Release-Intrinsics|Any CPU.ActiveCfg = Release-Intrinsics|Any CPU
{7288C084-11C0-43BE-AC7F-45DCFEAEEBF6}.Release-Intrinsics|Any CPU.Build.0 = Release-Intrinsics|Any CPU
{F1CAE3AB-4F86-4BC0-BBA8-C4A58E7E8A4A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F1CAE3AB-4F86-4BC0-BBA8-C4A58E7E8A4A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F1CAE3AB-4F86-4BC0-BBA8-C4A58E7E8A4A}.Debug-Intrinsics|Any CPU.ActiveCfg = Debug-Intrinsics|Any CPU
Expand Down Expand Up @@ -593,7 +583,6 @@ Global
{65D0603E-B96C-4DFC-BDD1-705891B88C18} = {09EADF06-BE25-4228-AB53-95AE3E15B530}
{707BB22C-7E5F-497A-8C2F-74578F675705} = {09EADF06-BE25-4228-AB53-95AE3E15B530}
{2911A286-ECA4-4730-97A9-DA1FEE2DED97} = {09EADF06-BE25-4228-AB53-95AE3E15B530}
{7288C084-11C0-43BE-AC7F-45DCFEAEEBF6} = {09EADF06-BE25-4228-AB53-95AE3E15B530}
{F1CAE3AB-4F86-4BC0-BBA8-C4A58E7E8A4A} = {09EADF06-BE25-4228-AB53-95AE3E15B530}
{58E06735-1129-4DD5-86E0-6BBFF049AAD9} = {09EADF06-BE25-4228-AB53-95AE3E15B530}
{64BC22D3-1E76-41EF-94D8-C79E471FF2DD} = {AED9C836-31E3-4F3F-8ABC-929555D3F3C4}
Expand Down
2 changes: 1 addition & 1 deletion build/Dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<PropertyGroup>
<GoogleProtobufPackageVersion>3.5.1</GoogleProtobufPackageVersion>
<LightGBMPackageVersion>2.2.1.1</LightGBMPackageVersion>
<MicrosoftMLOnnxRuntimePackageVersion>0.1.5</MicrosoftMLOnnxRuntimePackageVersion>
<MicrosoftMLOnnxRuntimeGpuPackageVersion>0.1.5</MicrosoftMLOnnxRuntimeGpuPackageVersion>
<MlNetMklDepsPackageVersion>0.0.0.7</MlNetMklDepsPackageVersion>
<ParquetDotNetPackageVersion>2.1.3</ParquetDotNetPackageVersion>
<SystemDrawingCommonPackageVersion>4.5.0</SystemDrawingCommonPackageVersion>
Expand Down
51 changes: 51 additions & 0 deletions docs/release-notes/0.9/release-0.9.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# ML.NET 0.9 Release Notes

Welcome to 2019! For the past 9 months we have been adding features and improving [ML.NET](https://aka.ms/mlnet). In the forthcoming 0.10, 0.11, and 0.12 releases before we reach 1.0, we will focus on the overall stability of the package, continue to refine the API, increase test coverage and improve documentation. 0.9 release packs multiple fixes as well as significant clean up to the internal code of the package.

### Installation

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.

You can install ML.NET NuGet from the CLI using:
```
dotnet add package Microsoft.ML
```

From package manager:
```
Install-Package Microsoft.ML
```

### Release Notes

Below are a few of the highlights from this release. There are many other improvements in the API.

* Added Feature Contribution Calculation
([#1847](https://github.com/dotnet/machinelearning/pull/1847))

* FCC can be used to compute feature contributions in addition to the overall prediction when models are evaluated.

* Removed Legacy namespace that was marked obsolete
([#2043](https://github.com/dotnet/machinelearning/pull/2043))

* GPU support for ONNX Transform
([#1922](https://github.com/dotnet/machinelearning/pull/1922))

* GPU is currently supported on 64 bit Windows
* Cross platform support is still being developed for this feature

* `Permutation Feature Importance` now supports confidence intervals
([#1844](https://github.com/dotnet/machinelearning/pull/1844))

* Introducing `PredictionEngine` instead of `PredictionFunction`
([#1920](https://github.com/dotnet/machinelearning/pull/1920))

### Acknowledgements

Shoutout to [dhilmathy](https://github.com/dhilmathy),
[mnboos](https://github.com/mnboos),
[robosek](https://github.com/robosek), and the [ML.NET](https://aka.ms/mlnet) team for their
contributions as part of this release!
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class FeatureContributionCalculationTransform_RegressionExample
public static void FeatureContributionCalculationTransform_Regression()
{
// Downloading the dataset from github.com/dotnet/machinelearning.
// This will create a sentiment.tsv file in the filesystem.
// This will create a housing.txt file in the filesystem.
// You can open this file, if you want to see the data.
string dataFile = SamplesUtils.DatasetUtils.DownloadHousingRegressionDataset();

Expand Down Expand Up @@ -59,20 +59,20 @@ public static void FeatureContributionCalculationTransform_Regression()
// Create a Feature Contribution Calculator
// Calculate the feature contributions for all features given trained model parameters
// And don't normalize the contribution scores
var featureContributionCalculator = mlContext.Model.Explainability.FeatureContributionCalculation(model.Model, model.FeatureColumn, top: 11, normalize: false);
var featureContributionCalculator = mlContext.Model.Explainability.FeatureContributionCalculation(model.Model, model.FeatureColumn, numPositiveContributions: 11, normalize: false);
var outputData = featureContributionCalculator.Fit(scoredData).Transform(scoredData);

// FeatureContributionCalculatingEstimator can be use as an intermediary step in a pipeline.
// The features retained by FeatureContributionCalculatingEstimator will be in the FeatureContribution column.
var pipeline = mlContext.Model.Explainability.FeatureContributionCalculation(model.Model, model.FeatureColumn, top: 11)
var pipeline = mlContext.Model.Explainability.FeatureContributionCalculation(model.Model, model.FeatureColumn, numPositiveContributions: 11)
.Append(mlContext.Regression.Trainers.OrdinaryLeastSquares(featureColumn: "FeatureContributions"));
var outData = featureContributionCalculator.Fit(scoredData).Transform(scoredData);

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

// Let's now walk through the first ten reconds and see which feature drove the values the most
// Let's now walk through the first ten records and see which feature drove the values the most
// Get prediction scores and contributions
var scoringEnumerator = outputData.AsEnumerable<HousingRegressionScoreAndContribution>(mlContext, true).GetEnumerator();
int index = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static void AveragedPerceptronBinaryClassification()
var mlContext = new MLContext();

// Creating Data Reader with the initial schema based on the format of the data
var reader = TextLoader.CreateReader(
var reader = TextLoaderStatic.CreateReader(
mlContext,
c => (
Age: c.LoadFloat(0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static void FastTreeBinaryClassification()
var mlContext = new MLContext();

// Creating Data Reader with the initial schema based on the format of the data
var reader = TextLoader.CreateReader(
var reader = TextLoaderStatic.CreateReader(
mlContext,
c => (
Age: c.LoadFloat(0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static void FastTreeRegression()
var mlContext = new MLContext();

// Creating a data reader, based on the format of the data
var reader = TextLoader.CreateReader(mlContext, c => (
var reader = TextLoaderStatic.CreateReader(mlContext, c => (
label: c.LoadFloat(0),
features: c.LoadFloat(1, 6)
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static void FeatureSelectionTransform()

// First, we define the reader: specify the data columns and where to find them in the text file. Notice that we combine entries from
// all the feature columns into entries of a vector of a single column named "Features".
var reader = TextLoader.CreateReader(ml, c => (
var reader = TextLoaderStatic.CreateReader(ml, c => (
Label: c.LoadBool(0),
Features: c.LoadFloat(1, 9)
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static void LightGbmBinaryClassification()
var mlContext = new MLContext();

// Creating Data Reader with the initial schema based on the format of the data
var reader = TextLoader.CreateReader(
var reader = TextLoaderStatic.CreateReader(
mlContext,
c => (
Age: c.LoadFloat(0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Microsoft.ML.Data;
using Microsoft.ML.LightGBM;
using Microsoft.ML.LightGBM.StaticPipe;
using Microsoft.ML.StaticPipe;

namespace Microsoft.ML.Samples.Static
{
Expand All @@ -19,7 +20,7 @@ public static void LightGbmRegression()
var mlContext = new MLContext();

// Creating a data reader, based on the format of the data
var reader = TextLoader.CreateReader(mlContext, c => (
var reader = TextLoaderStatic.CreateReader(mlContext, c => (
label: c.LoadFloat(0),
features: c.LoadFloat(1, 6)
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static void SdcaBinaryClassification()
var mlContext = new MLContext();

// Creating Data Reader with the initial schema based on the format of the data
var reader = TextLoader.CreateReader(
var reader = TextLoaderStatic.CreateReader(
mlContext,
c => (
Age: c.LoadFloat(0),
Expand Down
2 changes: 1 addition & 1 deletion docs/samples/Microsoft.ML.Samples/Static/SDCARegression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static void SdcaRegression()
var mlContext = new MLContext();

// Creating a data reader, based on the format of the data
var reader = TextLoader.CreateReader(mlContext, c => (
var reader = TextLoaderStatic.CreateReader(mlContext, c => (
label: c.LoadFloat(0),
features: c.LoadFloat(1, 6)
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<ItemGroup>
<ProjectReference Include="../Microsoft.ML/Microsoft.ML.nupkgproj" />
<PackageReference Include="Microsoft.ML.OnnxRuntime" Version="$(MicrosoftMLOnnxRuntimePackageVersion)"/>
<PackageReference Include="Microsoft.ML.OnnxRuntime.Gpu" Version="$(MicrosoftMLOnnxRuntimeGpuPackageVersion)"/>
</ItemGroup>

</Project>
14 changes: 14 additions & 0 deletions pkg/Microsoft.ML.StaticPipe/Microsoft.ML.StaticPipe.nupkgproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<PackageDescription>ML.NET component for a statically typed API.</PackageDescription>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="../Microsoft.ML/Microsoft.ML.nupkgproj" />
<ProjectReference Include="../Microsoft.ML.ImageAnalytics/Microsoft.ML.ImageAnalytics.nupkgproj" />
<ProjectReference Include="../Microsoft.ML.MatrixFactorization/Microsoft.ML.MatrixFactorization.nupkgproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project DefaultTargets="Pack">

<Import Project="Microsoft.ML.StaticPipe.nupkgproj" />

</Project>
61 changes: 1 addition & 60 deletions src/Microsoft.ML.Core/Data/ColumnType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ public abstract class ColumnType : IEquatable<ColumnType>
// This private constructor sets all the IsXxx flags. It is invoked by other ctors.
private ColumnType()
{
IsPrimitive = this is PrimitiveType;
IsVector = this is VectorType;
IsNumber = this is NumberType;
IsKey = this is KeyType;
}

Expand Down Expand Up @@ -73,58 +71,6 @@ private protected ColumnType(Type rawType, DataKind rawKind)
[BestFriend]
internal DataKind RawKind { get; }

/// <summary>
/// Whether this is a primitive type. External code should use <c>is <see cref="PrimitiveType"/></c>.
/// </summary>
[BestFriend]
internal bool IsPrimitive { get; }

/// <summary>
/// Whether this type is a standard numeric type. External code should use <c>is <see cref="NumberType"/></c>.
/// </summary>
[BestFriend]
internal bool IsNumber { get; }

/// <summary>
/// Whether this type is the standard text type. External code should use <c>is <see cref="TextType"/></c>.
/// </summary>
[BestFriend]
internal bool IsText
{
get
{
if (!(this is TextType))
return false;
// TextType is a singleton.
Contracts.Assert(this == TextType.Instance);
return true;
}
}

/// <summary>
/// Whether this type is the standard boolean type. External code should use <c>is <see cref="BoolType"/></c>.
/// </summary>
[BestFriend]
internal bool IsBool
{
get
{
if (!(this is BoolType))
return false;
// BoolType is a singleton.
Contracts.Assert(this == BoolType.Instance);
return true;
}
}

/// <summary>
/// Whether this type is a standard scalar type completely determined by its <see cref="RawType"/>
/// (not a <see cref="KeyType"/> or <see cref="StructuredType"/>, etc).
/// </summary>
[BestFriend]
internal bool IsStandardScalar => IsNumber || IsText || IsBool ||
(this is TimeSpanType) || (this is DateTimeType) || (this is DateTimeOffsetType);

/// <summary>
/// Whether this type is a key type, which implies that the order of values is not significant,
/// and arithmetic is non-sensical. A key type can define a cardinality.
Expand Down Expand Up @@ -230,13 +176,11 @@ public abstract class StructuredType : ColumnType
protected StructuredType(Type rawType)
: base(rawType)
{
Contracts.Assert(!IsPrimitive);
}

private protected StructuredType(Type rawType, DataKind rawKind)
: base(rawType, rawKind)
{
Contracts.Assert(!IsPrimitive);
}
}

Expand All @@ -249,15 +193,13 @@ public abstract class PrimitiveType : ColumnType
protected PrimitiveType(Type rawType)
: base(rawType)
{
Contracts.Assert(IsPrimitive);
Contracts.CheckParam(!typeof(IDisposable).IsAssignableFrom(RawType), nameof(rawType),
"A " + nameof(PrimitiveType) + " cannot have a disposable " + nameof(RawType));
}

private protected PrimitiveType(Type rawType, DataKind rawKind)
: base(rawType, rawKind)
{
Contracts.Assert(IsPrimitive);
Contracts.Assert(!typeof(IDisposable).IsAssignableFrom(RawType));
}

Expand Down Expand Up @@ -322,7 +264,6 @@ private NumberType(DataKind kind, string name)
{
Contracts.AssertNonEmpty(name);
_name = name;
Contracts.Assert(IsNumber);
}

private static volatile NumberType _instI1;
Expand Down Expand Up @@ -496,7 +437,7 @@ public override bool Equals(ColumnType other)
{
if (other == this)
return true;
Contracts.Assert(other == null || !other.IsNumber || other.RawKind != RawKind);
Contracts.Assert(other == null || !(other is NumberType) || other.RawKind != RawKind);
return false;
}

Expand Down
21 changes: 21 additions & 0 deletions src/Microsoft.ML.Core/Data/ColumnTypeExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace Microsoft.ML.Data
{
/// <summary>
/// Extension methods related to the ColumnType class.
/// </summary>
[BestFriend]
internal static class ColumnTypeExtensions
{
/// <summary>
/// Whether this type is a standard scalar type completely determined by its <see cref="ColumnType.RawType"/>
/// (not a <see cref="KeyType"/> or <see cref="StructuredType"/>, etc).
/// </summary>
public static bool IsStandardScalar(this ColumnType columnType) =>
(columnType is NumberType) || (columnType is TextType) || (columnType is BoolType) ||
(columnType is TimeSpanType) || (columnType is DateTimeType) || (columnType is DateTimeOffsetType);
}
}
Loading

0 comments on commit 941d9fc

Please sign in to comment.