-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Splitting OLS to a separate package called AdditionalLearners #611
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
9b7eab3
fa3370c
ba40ba4
83a737f
61cdb66
188bd4b
c2b87e7
2efe7bc
ede5c72
c666ad7
eeba577
1255e01
dee8b65
dc34085
3588e9b
05909c6
0f91d17
7d3bbab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>netstandard2.0</TargetFramework> | ||
| <PackageDescription>ML.NET additional learners. They depend on other packages, like MlNetMklDeps. </PackageDescription> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <ProjectReference Include="../Microsoft.ML/Microsoft.ML.nupkgproj" /> | ||
| <PackageReference Include="MlNetMklDeps" Version="$(MlNetMklDepsPackageVersion)" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| <Project DefaultTargets="Pack"> | ||
|
|
||
| <Import Project="Microsoft.ML.AdditionalLearners.nupkgproj" /> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
MklDependentLearners maybe? it just separation of standard/additional learner is unclear from the names #Closed
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. was thinking that we could use it for other learners, that we don;t want on the core package because of other dependencies. We could bundle them all in one package.. In reply to: 206356744 [](ancestors = 206356744)
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggest we continue the discussion in the other comment (Learners.nupkgproj) and close this one In reply to: 206357569 [](ancestors = 206357569,206356744) |
||
|
|
||
| </Project> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>netstandard2.0</TargetFramework> | ||
| <IncludeInPackage>Microsoft.ML.AdditionalLearners</IncludeInPackage> | ||
| <AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
HERESY! #Resolved
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. on top right corner next to (show both) (on right side) is "a.b" button. click on it :) In reply to: 206356725 [](ancestors = 206356725,206356521) |
||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <ProjectReference Include="..\Microsoft.ML.Core\Microsoft.ML.Core.csproj" /> | ||
| <ProjectReference Include="..\Microsoft.ML.Data\Microsoft.ML.Data.csproj" /> | ||
| <ProjectReference Include="..\Microsoft.ML.StandardLearners\Microsoft.ML.StandardLearners.csproj" /> | ||
| <ProjectReference Include="..\Microsoft.ML\Microsoft.ML.csproj" /> | ||
| <PackageReference Include="MlNetMklDeps" Version="$(MlNetMklDepsPackageVersion)" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,14 +7,15 @@ | |
| using System; | ||
| using System.Collections.Generic; | ||
| using System.IO; | ||
| using Microsoft.ML.Runtime.Internal.Internallearn; | ||
| using Microsoft.ML.Runtime; | ||
| using Microsoft.ML.Runtime.AdditionalLearners; | ||
| using Microsoft.ML.Runtime.Internal.Internallearn; | ||
| using Microsoft.ML.Runtime.Internal.Utilities; | ||
| using Microsoft.ML.Runtime.CommandLine; | ||
| using Microsoft.ML.Runtime.Data; | ||
| using Microsoft.ML.Runtime.EntryPoints; | ||
| using Microsoft.ML.Runtime.Learners; | ||
| using Microsoft.ML.Runtime.Model; | ||
| using Microsoft.ML.Runtime.Internal.Utilities; | ||
| using Microsoft.ML.Runtime.Training; | ||
| using System.Runtime.InteropServices; | ||
|
|
||
|
|
@@ -30,7 +31,7 @@ | |
|
|
||
| [assembly: LoadableClass(typeof(void), typeof(OlsLinearRegressionTrainer), null, typeof(SignatureEntryPointModule), OlsLinearRegressionTrainer.LoadNameValue)] | ||
|
|
||
| namespace Microsoft.ML.Runtime.Learners | ||
| namespace Microsoft.ML.Runtime.AdditionalLearners | ||
| { | ||
| /// <include file='doc.xml' path='doc/members/member[@name="OLS"]/*' /> | ||
| public sealed class OlsLinearRegressionTrainer : TrainerBase<OlsLinearRegressionPredictor> | ||
|
|
@@ -220,7 +221,7 @@ private OlsLinearRegressionPredictor TrainCore(IChannel ch, FloatLabelCursor.Fac | |
| catch (DllNotFoundException) | ||
| { | ||
| // REVIEW: Is there no better way? | ||
| throw ch.ExceptNotSupp("The MKL library (Microsoft.ML.MklImports.dll) or one of its dependencies is missing."); | ||
| throw ch.ExceptNotSupp("The MKL library (Microsoft.ML.MklImports) or one of its dependencies is missing."); | ||
| } | ||
| // Solve for beta in (LL')beta = X'y: | ||
| Mkl.Pptrs(Mkl.Layout.RowMajor, Mkl.UpLo.Lo, m, 1, xtx, xty, 1); | ||
|
|
@@ -466,7 +467,7 @@ public static void Pptri(Layout layout, UpLo uplo, int n, Double[] ap) | |
| Desc = "Train an OLS regression model.", | ||
| UserName = UserNameValue, | ||
| ShortName = ShortName, | ||
| XmlInclude = new[] { @"<include file='../Microsoft.ML.StandardLearners/Standard/doc.xml' path='doc/members/member[@name=""OLS""]/*' />" })] | ||
| XmlInclude = new[] { @"<include file='../Microsoft.ML.AdditionalLearners/Standard/doc.xml' path='doc/members/member[@name=""OLS""]/*' />" })] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this the right path?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The reference is relative to the CSharpApi.cs file, in Microsoft.ML. This line of xml comment will appear atop the OrdinaryLeastSqaresregressor in the C#api, and from there make its way in the XML. In reply to: 206638688 [](ancestors = 206638688) |
||
| public static CommonOutputs.RegressionOutput TrainRegression(IHostEnvironment env, Arguments input) | ||
| { | ||
| Contracts.CheckValue(env, nameof(env)); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <doc> | ||
| <members> | ||
|
|
||
| <member name="OLS"> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we also remove the doc from |
||
| <summary> | ||
| Train an OLS regression model. | ||
| </summary> | ||
| <remarks> | ||
| <a href='https://en.wikipedia.org/wiki/Ordinary_least_squares'>Ordinary least squares (OLS)</a> is a parameterized regression method. | ||
| It assumes that the conditional mean of the dependent variable follows a linear function of the dependent variables. | ||
| The parameters of the regressor can be estimated by minimizing the squares of the difference between observed values and the predictions. | ||
| </remarks> | ||
| <example> | ||
| <code language="csharp"> | ||
| new OrdinaryLeastSquaresRegressor | ||
| { | ||
| L2Weight = 0.1, | ||
| PerParameterSignificance = false, | ||
| NormalizeFeatures = Microsoft.ML.Models.NormalizeOption.Yes | ||
| } | ||
| </code> | ||
| </example> | ||
| </member> | ||
|
|
||
| </members> | ||
| </doc> | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name "additional learners" is something we might want to reconsider, since in future as we publish more wrappers we will surely want descriptive names.
I think naming it
OrdinaryLeastSquaresis probably a fine choice since that's literally all it is? #PendingThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking that maybe we can have SymSGD here too, and other learners that need to drag dependencies?
@Ivanidzo4ka didn't like it either and suggested MklDepsLearners.
In reply to: 206582236 [](ancestors = 206582236)
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MklDeps also doesn't feel good, but it's better. Can we have a name that conveys 'these learners use MKL's optimized linear algebra', without actually saying 'MKL' in the name?
I don't think this should be 'all learners with big dependencies', because it doesn't actually improve the experience too much (if you need one of these learners, you have to grab all). I'd much rather have 'learners depending on MKL' and 'learners depending on OtherHeaveDependency' separate
In reply to: 206584367 [](ancestors = 206584367,206582236)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renaming it to HalLearners. If that doesn's sound good, please suggest a name :)
In reply to: 206634151 [](ancestors = 206634151,206584367,206582236)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like HAL learners.
In reply to: 206661889 [](ancestors = 206661889,206634151,206584367,206582236)