Skip to content

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

Closed

Conversation

maryamariyan
Copy link
Member

  • Adds CodeGen piece for recommendation task
  • Cherry-picks changes in AutoML Add Recommendation Task #4246 into features/automl branch
  • Cross check mlnet tests build and run fine
  • confirm AutoML project tests build and run fine

cc: @LittleLittleCloud @eerhardt

LittleLittleCloud and others added 4 commits October 21, 2019 13:29
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
@maryamariyan maryamariyan changed the title Codegen recommendation Add Code Gen piece for Recommendation task Oct 21, 2019
<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" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be LightGbm?

Copy link
Member Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change necessary?

Copy link
Member Author

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
Copy link
Contributor

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?

Copy link
Member Author

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" />
Copy link
Member

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>
Copy link
Member

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?

Copy link
Member Author

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" />
Copy link
Contributor

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" },
Copy link
Member

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add trail comma :)

Copy link
Contributor

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

Copy link
Member Author

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.

Copy link
Member

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" />
Copy link
Contributor

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>
Copy link
Contributor

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

Copy link
Member Author

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.
Copy link
Contributor

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;
Copy link
Contributor

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()
Copy link
Contributor

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.

@maryamariyan
Copy link
Member Author

maryamariyan commented Oct 21, 2019

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>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo ITrainerEsitmator

@ghost ghost locked as resolved and limited conversation to collaborators Mar 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants