-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add Code Gen piece for Recommendation task #4360
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
Add Code Gen piece for Recommendation task #4360
Conversation
Trains Recommendation models able to predict rating for existing users Conflicts: pkg/Microsoft.ML.AutoML/Microsoft.ML.AutoML.nupkgproj src/Microsoft.ML.AutoML/Microsoft.ML.AutoML.csproj test/Microsoft.ML.AutoML.Tests/AutoFitTests.cs test/Microsoft.ML.AutoML.Tests/ColumnInferenceTests.cs test/Microsoft.ML.AutoML.Tests/ColumnInformationUtilTests.cs test/Microsoft.ML.AutoML.Tests/Microsoft.ML.AutoML.Tests.csproj test/Microsoft.ML.AutoML.Tests/TrainerExtensionsTests.cs test/Microsoft.ML.AutoML.Tests/TransformInferenceTests.cs test/Microsoft.ML.AutoML.Tests/UserInputValidationTests.cs
<PackageReference Include="Microsoft.ML.Mkl.Components" Version="$(MlDotNetPackageVersion)" /> | ||
<PackageReference Include="Microsoft.ML.Recommender" Version="$(MlDotNetPackageVersion)" /> | ||
<PackageReference Include="Microsoft.ML" Version="1.4.0-preview3-28218-2" /> | ||
<PackageReference Include="Microsoft.ML.LightGBM" Version="1.4.0-preview3-28218-2" /> |
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.
Should it be LightGbm
?
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.
note: LightGbm in all uppercasing is also in nupkgproj files (pkg..AutoML and pkg\mlnet)
@@ -1,6 +1,6 @@ | |||
Microsoft Visual Studio Solution File, Format Version 12.00 | |||
# Visual Studio 15 | |||
VisualStudioVersion = 15.0.28010.2050 | |||
# Visual Studio Version 16 |
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.
Is this change necessary?
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.
no it's not. I can remove this
@@ -18,6 +18,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools-local", "tools-local" | |||
EndProject | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.CodeGenerator", "src\Microsoft.ML.CodeGen\Microsoft.ML.CodeGenerator.csproj", "{3148A8CF-A686-4A9C-A5C6-C3E41CAAD64D}" | |||
EndProject | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.Recommender", "src\Microsoft.ML.Recommender\Microsoft.ML.Recommender.csproj", "{19D6A195-657E-42D9-A5D4-ECB289BB6FDA}" | |||
EndProject |
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.
Why Recommender
appears in AutoML solution?
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.
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Microsoft.ML.Recommender\Microsoft.ML.Recommender.csproj" /> |
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.
Why aren't you using a PackageReference
to Recommender here, same as the other 3?
@@ -15,98 +18,10 @@ | |||
<ItemGroup> | |||
<ProjectReference Include="..\Microsoft.ML.AutoML\Microsoft.ML.AutoML.csproj" /> | |||
</ItemGroup> | |||
|
|||
<ItemGroup> |
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 don't think you want these to be removed, do you?
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.
bringing back
@@ -4,11 +4,11 @@ | |||
<TargetFramework>netstandard2.0</TargetFramework> | |||
<PackageDescription>ML.NET AutoML: Optimizes an ML pipeline for your dataset, by automatically locating the best feature engineering, model, and hyperparameters</PackageDescription> | |||
</PropertyGroup> | |||
|
|||
<ItemGroup> | |||
<PackageReference Include="Microsoft.ML" Version="1.3.1" /> | |||
<PackageReference Include="Microsoft.ML.LightGBM" Version="1.3.1" /> |
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.
shouldn't it be LightGbm
?
{ | ||
{"MatrixColumnIndexColumnName","matrixColumnIndexColumnName" }, | ||
{"MatrixRowIndexColumnName","matrixRowIndexColumnName" }, | ||
{"FeatureColumnName","featureColumnName" }, |
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 don't see a FeatureColumnName
on MatrixFactorization
@@ -9,5 +9,6 @@ internal enum TaskKind | |||
BinaryClassification, | |||
MulticlassClassification, | |||
Regression, | |||
Recommendation |
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.
Please add trail comma :)
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.
To keep the code style in format
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.
note: I could change but this is cherry pick though. it is without trail comma in master branch as well.
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.
This is code in master
. We shouldn't be changing it here. If we want a change like that, make it in the master
branch.
Honestly, the only thing this branch should be used for is Code Gen and mlnet.csproj going forward. Until they are merged into master
. Then this branch should go away.
@@ -7,6 +7,9 @@ | |||
|
|||
<ItemGroup> | |||
<PackageReference Include="Microsoft.CodeAnalysis" Version="2.10.0" /> | |||
<!--<PackageReference Include="Microsoft.ML.AutoML" Version="0.16.0-preview3-28218-2" />--> | |||
<PackageReference Include="Microsoft.ML" Version="1.4.0-preview3-28218-2" /> |
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.
Why we need Microsoft.ML
package in CodeGen
.
Please remove comment BTW
@@ -15,98 +18,10 @@ | |||
<ItemGroup> | |||
<ProjectReference Include="..\Microsoft.ML.AutoML\Microsoft.ML.AutoML.csproj" /> | |||
</ItemGroup> | |||
|
|||
<ItemGroup> |
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.
Why we remove tt file in this case
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.
bringing back
@@ -273,6 +273,11 @@ internal static class Defaults | |||
|
|||
PredictionKind ITrainer.PredictionKind => PredictionKind.Recommendation; | |||
|
|||
/// <summary> | |||
/// The <see cref="TrainerInfo"/> contains general parameters for this trainer. |
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.
Seems that you just do a useless copy-paste here (see the change below). Could you just recover it back since it's unnecessary
@@ -2,9 +2,11 @@ | |||
// The .NET Foundation licenses this file to you under the MIT license. | |||
// See the LICENSE file in the project root for more information. | |||
|
|||
using System; | |||
using System.IO; |
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 import order seems not right,,, doesn't StyleCop not grumble about it?
@@ -60,5 +62,92 @@ public void AutoFitRegressionTest() | |||
|
|||
Assert.IsTrue(result.RunDetails.Max(i => i.ValidationMetrics.RSquared > 0.9)); | |||
} | |||
|
|||
[TestMethod] | |||
public void AutoFitRecommendationTest() |
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 this end-to-end test, seems really insightful.
Thanks for the review. Halting progress on the PR and could reopen it once the blockers for this work item have been identified. |
|
||
namespace Microsoft.ML.AutoML | ||
{ | ||
using ITrainerEsitmator = ITrainerEstimator<IPredictionTransformer<object>, object>; |
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.
typo ITrainerEsitmator
cc: @LittleLittleCloud @eerhardt