Skip to content
Closed
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
4 changes: 2 additions & 2 deletions src/Microsoft.ML.LightGbm/LightGbmBinaryTrainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,15 @@ public enum EvaluateMetricType
/// </summary>
[Argument(ArgumentType.AtMostOnce, HelpText = "Parameter for the sigmoid function.", ShortName = "sigmoid")]
[TGUI(Label = "Sigmoid", SuggestedSweeps = "0.5,1")]
public double Sigmoid = 0.5;
public double Sigmoid = 1;

/// <summary>
/// Determines what evaluation metric to use.
/// </summary>
[Argument(ArgumentType.AtMostOnce,
HelpText = "Evaluation metrics.",
ShortName = "em")]
public EvaluateMetricType EvaluationMetric = EvaluateMetricType.Logloss;
public EvaluateMetricType EvaluationMetric = EvaluateMetricType.None;

static Options()
{
Expand Down
8 changes: 6 additions & 2 deletions src/Microsoft.ML.LightGbm/LightGbmTrainerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ public class OptionsBase : TrainerInputBaseWithGroupId
{nameof(CategoricalSmoothing), "cat_smooth" },
{nameof(L2CategoricalRegularization), "cat_l2" },
{nameof(HandleMissingValue), "use_missing" },
{nameof(UseZeroAsMissingValue), "zero_as_missing" }
{nameof(UseZeroAsMissingValue), "zero_as_missing" },
{nameof(NumberOfIterations), "num_iterations" }
};

private protected string GetOptionName(string name)
Expand Down Expand Up @@ -264,7 +265,9 @@ internal virtual Dictionary<string, object> ToDictionary(IHost host)
if (NumberOfThreads.HasValue)
res["nthread"] = NumberOfThreads.Value;

res["seed"] = (Seed.HasValue) ? Seed : host.Rand.Next();
// keep lightgbm default seed if it has not been specified in Seed property
if (Seed.HasValue)
res["seed"] = Seed;

res[GetOptionName(nameof(MaximumBinCountPerFeature))] = MaximumBinCountPerFeature;
res[GetOptionName(nameof(HandleMissingValue))] = HandleMissingValue;
Expand All @@ -273,6 +276,7 @@ internal virtual Dictionary<string, object> ToDictionary(IHost host)
res[GetOptionName(nameof(MaximumCategoricalSplitPointCount))] = MaximumCategoricalSplitPointCount;
res[GetOptionName(nameof(CategoricalSmoothing))] = CategoricalSmoothing;
res[GetOptionName(nameof(L2CategoricalRegularization))] = L2CategoricalRegularization;
res[GetOptionName(nameof(NumberOfIterations))] = NumberOfIterations;

return res;
}
Expand Down