Skip to content

Commit 4dcfd80

Browse files
committed
PR feedback.
1 parent 1e91203 commit 4dcfd80

File tree

7 files changed

+30
-27
lines changed

7 files changed

+30
-27
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
### Training Algorithm Details
2+
LightGBM is an open source implementation of gradient boosting decision tree.
3+
For implementation details, please see [LightGBM's official
4+
documentation](https://lightgbm.readthedocs.io/en/latest/index.html) or this
5+
[paper](https://papers.nips.cc/paper/6907-lightgbm-a-highly-efficient-gradient-boosting-decision-tree.pdf).

src/Microsoft.ML.FastTree/FastTreeClassification.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ private static IPredictorProducing<float> Create(IHostEnvironment env, ModelLoad
119119
/// ]]>
120120
/// </format>
121121
/// </remarks>
122-
/// <seealso cref="Microsoft.ML.TreeExtensions.FastTree(Microsoft.ML.BinaryClassificationCatalog.BinaryClassificationTrainers,System.String,System.String,System.String,System.Int32,System.Int32,System.Int32,System.Double)"/>
123-
/// <seealso cref="Microsoft.ML.TreeExtensions.FastTree(Microsoft.ML.BinaryClassificationCatalog.BinaryClassificationTrainers,Microsoft.ML.Trainers.FastTree.FastTreeBinaryTrainer.Options)"/>
122+
/// <seealso cref="TreeExtensions.FastTree(BinaryClassificationCatalog.BinaryClassificationTrainers, string, string, string, int, int, int, double)"/>
123+
/// <seealso cref="TreeExtensions.FastTree(BinaryClassificationCatalog.BinaryClassificationTrainers, FastTreeBinaryTrainer.Options)"/>
124124
/// <seealso cref="Options"/>
125125
public sealed partial class FastTreeBinaryTrainer :
126126
BoostingFastTreeTrainerBase<FastTreeBinaryTrainer.Options,

src/Microsoft.ML.FastTree/FastTreeRegression.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ namespace Microsoft.ML.Trainers.FastTree
5151
/// ]]>
5252
/// </format>
5353
/// </remarks>
54-
/// <seealso cref="Microsoft.ML.TreeExtensions.FastTree(Microsoft.ML.RegressionCatalog.RegressionTrainers,System.String,System.String,System.String,System.Int32,System.Int32,System.Int32,System.Double)"/>
55-
/// <seealso cref="Microsoft.ML.TreeExtensions.FastTree(Microsoft.ML.RegressionCatalog.RegressionTrainers,Microsoft.ML.Trainers.FastTree.FastTreeRegressionTrainer.Options)"/>
54+
/// <seealso cref="TreeExtensions.FastTree(RegressionCatalog.RegressionTrainers, string, string, string, int, int, int, double)"/>
55+
/// <seealso cref="TreeExtensions.FastTree(RegressionCatalog.RegressionTrainers, FastTreeRegressionTrainer.Options)"/>
5656
/// <seealso cref="Options"/>
5757
public sealed partial class FastTreeRegressionTrainer
5858
: BoostingFastTreeTrainerBase<FastTreeRegressionTrainer.Options, RegressionPredictionTransformer<FastTreeRegressionModelParameters>, FastTreeRegressionModelParameters>

src/Microsoft.ML.FastTree/RandomForestClassification.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ private static IPredictorProducing<float> Create(IHostEnvironment env, ModelLoad
132132
/// ]]>
133133
/// </format>
134134
/// </remarks>
135-
/// <seealso cref="Microsoft.ML.TreeExtensions.FastForest(Microsoft.ML.BinaryClassificationCatalog.BinaryClassificationTrainers,System.String,System.String,System.String,System.Int32,System.Int32,System.Int32)"/>
136-
/// <seealso cref="Microsoft.ML.TreeExtensions.FastForest(Microsoft.ML.BinaryClassificationCatalog.BinaryClassificationTrainers,Microsoft.ML.Trainers.FastTree.FastForestBinaryTrainer.Options)"/>
135+
/// <seealso cref="TreeExtensions.FastForest(BinaryClassificationCatalog.BinaryClassificationTrainers, string, string, string, int, int, int)"/>
136+
/// <seealso cref="TreeExtensions.FastForest(BinaryClassificationCatalog.BinaryClassificationTrainers, FastForestBinaryTrainer.Options)"/>
137137
/// <seealso cref="Options"/>
138138
public sealed partial class FastForestBinaryTrainer :
139139
RandomForestTrainerBase<FastForestBinaryTrainer.Options, BinaryPredictionTransformer<FastForestBinaryModelParameters>, FastForestBinaryModelParameters>

src/Microsoft.ML.FastTree/RandomForestRegression.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,8 @@ ISchemaBindableMapper IQuantileRegressionPredictor.CreateMapper(Double[] quantil
263263
/// ]]>
264264
/// </format>
265265
/// </remarks>
266-
/// <seealso cref="Microsoft.ML.TreeExtensions.FastForest(Microsoft.ML.RegressionCatalog.RegressionTrainers,System.String,System.String,System.String,System.Int32,System.Int32,System.Int32)"/>
267-
/// <seealso cref="Microsoft.ML.TreeExtensions.FastForest(Microsoft.ML.RegressionCatalog.RegressionTrainers,Microsoft.ML.Trainers.FastTree.FastForestRegressionTrainer.Options)"/>
266+
/// <seealso cref="TreeExtensions.FastForest(RegressionCatalog.RegressionTrainers, string, string, string, int, int, int)"/>
267+
/// <seealso cref="TreeExtensions.FastForest(RegressionCatalog.RegressionTrainers, FastForestRegressionTrainer.Options)"/>
268268
/// <seealso cref="Options"/>
269269
public sealed partial class FastForestRegressionTrainer
270270
: RandomForestTrainerBase<FastForestRegressionTrainer.Options, RegressionPredictionTransformer<FastForestRegressionModelParameters>, FastForestRegressionModelParameters>

src/Microsoft.ML.LightGbm/LightGbmCatalog.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public static LightGbmBinaryTrainer LightGbm(this BinaryClassificationCatalog.Bi
118118
}
119119

120120
/// <summary>
121-
/// Creates <see cref="LightGbmRankingTrainer"/>, which predict a target using a gradient boosting decision tree ranking model.
121+
/// Create <see cref="LightGbmRankingTrainer"/>, which predict a target using a gradient boosting decision tree ranking model.
122122
/// </summary>
123123
/// <param name="catalog">The <see cref="RankingCatalog"/>.</param>
124124
/// <param name="labelColumnName">The name of the label column. The column data must be <see cref="System.Single"/>.</param>
@@ -153,7 +153,7 @@ public static LightGbmRankingTrainer LightGbm(this RankingCatalog.RankingTrainer
153153
}
154154

155155
/// <summary>
156-
/// Creates <see cref="LightGbmRankingTrainer"/>, which predict a target using a gradient boosting decision tree ranking model with advanced options.
156+
/// Create <see cref="LightGbmRankingTrainer"/> with advanced options, which predict a target using a gradient boosting decision tree ranking model.
157157
/// </summary>
158158
/// <param name="catalog">The <see cref="RankingCatalog"/>.</param>
159159
/// <param name="options">Trainer options.</param>

src/Microsoft.ML.LightGbm/LightGbmRankingTrainer.cs

+15-17
Original file line numberDiff line numberDiff line change
@@ -84,18 +84,16 @@ private static LightGbmRankingModelParameters Create(IHostEnvironment env, Model
8484
/// | | |
8585
/// | -- | -- |
8686
/// | Machine learning task | Ranking |
87-
/// | Is normalization required? | Yes |
87+
/// | Is normalization required? | No |
8888
/// | Is caching required? | No |
8989
/// | Required NuGet in addition to Microsoft.ML | Microsoft.ML.FastTree |
9090
///
91-
/// ### Training Algorithm Details
92-
/// LightGBM is an open source implementation of gradient boosting decision tree. For implementation details, please see LightGBM's official [documentation](https://lightgbm.readthedocs.io/en/latest/index.html) or
93-
/// [this](https://papers.nips.cc/paper/6907-lightgbm-a-highly-efficient-gradient-boosting-decision-tree.pdf) paper.
91+
/// [!include[algorithm](~/../docs/samples/docs/api-reference/algo-details-lightgbm.md)]
9492
/// ]]>
9593
/// </format>
9694
/// </remarks>
97-
/// <seealso cref="Microsoft.ML.LightGbmExtensions.LightGbm(Microsoft.ML.RankingCatalog.RankingTrainers,System.String,System.String,System.String,System.String,System.Nullable{System.Int32},System.Nullable{System.Int32},System.Nullable{System.Double},System.Int32)"/>
98-
/// <seealso cref="Microsoft.ML.LightGbmExtensions.LightGbm(Microsoft.ML.RankingCatalog.RankingTrainers,Microsoft.ML.Trainers.LightGbm.LightGbmRankingTrainer.Options)"/>
95+
/// <seealso cref="LightGbmExtensions.LightGbm(RankingCatalog.RankingTrainers, string, string, string, string, int?, int?, double?, int)"/>
96+
/// <seealso cref="LightGbmExtensions.LightGbm(RankingCatalog.RankingTrainers, LightGbmRankingTrainer.Options)"/>
9997
/// <seealso cref="Options"/>
10098
public sealed class LightGbmRankingTrainer : LightGbmTrainerBase<LightGbmRankingTrainer.Options,
10199
float,
@@ -127,7 +125,7 @@ public enum EvaluateMetricType
127125
/// </summary>
128126
[Argument(ArgumentType.AtMostOnce, HelpText = "An array of gains associated to each relevance label.", ShortName = "gains")]
129127
[TGUI(Label = "Ranking Label Gain")]
130-
public int[] CustomGains = { 0,3,7,15,31,63,127,255,511,1023,2047,4095 };
128+
public int[] CustomGains = { 0, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095 };
131129

132130
/// <summary>
133131
/// Parameter for the sigmoid function.
@@ -157,8 +155,8 @@ internal override Dictionary<string, object> ToDictionary(IHost host)
157155
{
158156
var res = base.ToDictionary(host);
159157
res[GetOptionName(nameof(Sigmoid))] = Sigmoid;
160-
res[GetOptionName(nameof(CustomGains))] = string.Join(",",CustomGains);
161-
if(EvaluationMetric != EvaluateMetricType.Default)
158+
res[GetOptionName(nameof(CustomGains))] = string.Join(",", CustomGains);
159+
if (EvaluationMetric != EvaluateMetricType.Default)
162160
res[GetOptionName(nameof(EvaluateMetricType))] = GetOptionName(EvaluationMetric.ToString());
163161

164162
return res;
@@ -195,14 +193,14 @@ internal LightGbmRankingTrainer(IHostEnvironment env,
195193
: this(env,
196194
new Options()
197195
{
198-
LabelColumnName = labelColumnName,
199-
FeatureColumnName = featureColumnName,
200-
ExampleWeightColumnName = weightsColumnName,
201-
RowGroupColumnName = rowGroupdColumnName,
202-
NumberOfLeaves = numberOfLeaves,
203-
MinimumExampleCountPerLeaf = minimumExampleCountPerLeaf,
204-
LearningRate = learningRate,
205-
NumberOfIterations = numberOfIterations
196+
LabelColumnName = labelColumnName,
197+
FeatureColumnName = featureColumnName,
198+
ExampleWeightColumnName = weightsColumnName,
199+
RowGroupColumnName = rowGroupdColumnName,
200+
NumberOfLeaves = numberOfLeaves,
201+
MinimumExampleCountPerLeaf = minimumExampleCountPerLeaf,
202+
LearningRate = learningRate,
203+
NumberOfIterations = numberOfIterations
206204
})
207205
{
208206
Host.CheckNonEmpty(rowGroupdColumnName, nameof(rowGroupdColumnName));

0 commit comments

Comments
 (0)