Skip to content

Updating .tt file due to renaming of LbfgsPoissonRegression. #3140

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

Merged
merged 3 commits into from
Apr 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Microsoft.ML.Samples.Dynamic.Trainers.Regression
{
public static class PoissonRegression
public static class LbfgsPoissonRegression
{
public static void Example()
{
Expand Down Expand Up @@ -49,7 +49,7 @@ public static void Example()
// Evaluate the overall metrics
var metrics = mlContext.Regression.Evaluate(transformedTestData);
SamplesUtils.ConsoleUtils.PrintMetrics(metrics);

// Expected output:
// Mean Absolute Error: 0.07
// Mean Squared Error: 0.01
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<#@ include file="RegressionSamplesTemplate.ttinclude"#>

<#+
string ClassName="PoissonRegression";
string Trainer = "PoissonRegression";
string ClassName="LbfgsPoissonRegression";
string Trainer = "LbfgsPoissonRegression";
string TrainerOptions = null;

string ExpectedOutputPerInstance= @"// Expected output:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Microsoft.ML.Samples.Dynamic.Trainers.Regression
{
public static class PoissonRegressionWithOptions
public static class LbfgsPoissonRegressionWithOptions
{
public static void Example()
{
Expand Down Expand Up @@ -61,7 +61,7 @@ public static void Example()
// Evaluate the overall metrics
var metrics = mlContext.Regression.Evaluate(transformedTestData);
SamplesUtils.ConsoleUtils.PrintMetrics(metrics);

// Expected output:
// Mean Absolute Error: 0.07
// Mean Squared Error: 0.01
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<#@ include file="RegressionSamplesTemplate.ttinclude"#>

<#+
string ClassName="PoissonRegressionWithOptions";
string Trainer = "PoissonRegression";
string TrainerOptions = @"PoissonRegressionTrainer.Options
string ClassName="LbfgsPoissonRegressionWithOptions";
string Trainer = "LbfgsPoissonRegression";
string TrainerOptions = @"LbfgsPoissonRegressionTrainer.Options
{
// Reduce optimization tolerance to speed up training at the cost of accuracy.
OptmizationTolerance = 1e-4f,
Expand Down
16 changes: 8 additions & 8 deletions docs/samples/Microsoft.ML.Samples/Microsoft.ML.Samples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>OnlineGradientDescentWithOptions.cs</LastGenOutput>
</None>
<None Update="Dynamic\Trainers\Regression\PoissonRegression.tt">
<None Update="Dynamic\Trainers\Regression\LbfgsPoissonRegression.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>PoissonRegression.cs</LastGenOutput>
<LastGenOutput>LbfgsPoissonRegression.cs</LastGenOutput>
</None>
<None Update="Dynamic\Trainers\Regression\PoissonRegressionWithOptions.tt">
<None Update="Dynamic\Trainers\Regression\LbfgsPoissonRegressionWithOptions.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>PoissonRegressionWithOptions.cs</LastGenOutput>
<LastGenOutput>LbfgsPoissonRegressionWithOptions.cs</LastGenOutput>
</None>
</ItemGroup>

Expand Down Expand Up @@ -153,15 +153,15 @@
<AutoGen>True</AutoGen>
<DependentUpon>OnlineGradientDescentWithOptions.tt</DependentUpon>
</Compile>
<Compile Update="Dynamic\Trainers\Regression\PoissonRegression.cs">
<Compile Update="Dynamic\Trainers\Regression\LbfgsPoissonRegression.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>PoissonRegression.tt</DependentUpon>
<DependentUpon>LbfgsPoissonRegression.tt</DependentUpon>
</Compile>
<Compile Update="Dynamic\Trainers\Regression\PoissonRegressionWithOptions.cs">
<Compile Update="Dynamic\Trainers\Regression\LbfgsPoissonRegressionWithOptions.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>PoissonRegressionWithOptions.tt</DependentUpon>
<DependentUpon>LbfgsPoissonRegressionWithOptions.tt</DependentUpon>
</Compile>
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions src/Microsoft.ML.StandardTrainers/StandardTrainersCatalog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ public static LbfgsLogisticRegressionBinaryTrainer LbfgsLogisticRegression(this
/// <example>
/// <format type="text/markdown">
/// <![CDATA[
/// [!code-csharp[PoissonRegression](~/../docs/samples/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/Regression/PoissonRegression.cs)]
/// [!code-csharp[PoissonRegression](~/../docs/samples/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/Regression/LbfgsPoissonRegression.cs)]
Copy link
Member

@abgoswam abgoswam Mar 29, 2019

Choose a reason for hiding this comment

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

PoissonRegression [](start = 27, length = 17)

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think we need to prefix this with Lbfgs.


In reply to: 270581846 [](ancestors = 270581846)

Copy link
Contributor

Choose a reason for hiding this comment

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

This is the alt-text for the link, so it should be the name of the API.


In reply to: 270973957 [](ancestors = 270973957,270581846)

/// ]]></format>
/// </example>
public static LbfgsPoissonRegressionTrainer LbfgsPoissonRegression(this RegressionCatalog.RegressionTrainers catalog,
Copy link
Member

@abgoswam abgoswam Mar 29, 2019

Choose a reason for hiding this comment

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

LbfgsPoissonRegressionTrainer [](start = 22, length = 29)

there were other renamings which accompanied this .. should we fix those too in this PR ?

#3016 (comment) #Resolved

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Rest of the examples are not using .tt or they have been converted to .tt after the above change. So, those are fine right now.


In reply to: 270582198 [](ancestors = 270582198)

Expand All @@ -593,7 +593,7 @@ public static LbfgsPoissonRegressionTrainer LbfgsPoissonRegression(this Regressi
/// <example>
/// <format type="text/markdown">
/// <![CDATA[
/// [!code-csharp[PoissonRegression](~/../docs/samples/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/Regression/PoissonRegressionWithOptions.cs)]
/// [!code-csharp[PoissonRegression](~/../docs/samples/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/Regression/LbfgsPoissonRegressionWithOptions.cs)]
/// ]]></format>
/// </example>
public static LbfgsPoissonRegressionTrainer LbfgsPoissonRegression(this RegressionCatalog.RegressionTrainers catalog, LbfgsPoissonRegressionTrainer.Options options)
Expand Down