public void TestObjectiveParametersDefault() { var x = new ObjectiveParameters(); var result = new Dictionary <string, string>(); x.AddParameters(result); Assert.Empty(result); }
private protected TrainerBase(LearningParameters lp, ObjectiveParameters op) { Learning = lp; Objective = op; //ParallelTraining = Args.ParallelTrainer != null ? Args.ParallelTrainer.CreateComponent(env) : new SingleTrainer(); //InitParallelTraining(); }
public RankingTrainer(LearningParameters lp, ObjectiveParameters op) : base(lp, op) { if (op.Objective != ObjectiveType.LambdaRank) { throw new Exception("Require Objective == ObjectiveType.LambdaRank"); } if (op.Metric == MetricType.DefaultMetric) { op.Metric = MetricType.Ndcg; } }
public BinaryTrainer(LearningParameters lp, ObjectiveParameters op) : base(lp, op) { if (op.Objective != ObjectiveType.Binary) { throw new Exception("Require Objective == ObjectiveType.Binary"); } if (op.Metric == MetricType.DefaultMetric) { op.Metric = MetricType.BinaryLogLoss; } }
public MulticlassTrainer(LearningParameters lp, ObjectiveParameters op) : base(lp, op) { if (!(op.Objective == ObjectiveType.MultiClass || op.Objective == ObjectiveType.MultiClassOva)) { throw new Exception("Require Objective == MultiClass or MultiClassOva"); } if (op.NumClass <= 1) { throw new Exception("Require NumClass > 1"); } if (op.Metric == MetricType.DefaultMetric) { op.Metric = MetricType.MultiLogLoss; // TODO: why was this MultiError????? } }
public RegressionTrainer(LearningParameters lp, ObjectiveParameters op) : base(lp, op) { if (!(op.Objective == ObjectiveType.Regression || op.Objective == ObjectiveType.RegressionL1 || op.Objective == ObjectiveType.Huber || op.Objective == ObjectiveType.Fair || op.Objective == ObjectiveType.Poisson || op.Objective == ObjectiveType.Quantile || op.Objective == ObjectiveType.Mape || op.Objective == ObjectiveType.Gamma || op.Objective == ObjectiveType.Tweedie )) { throw new Exception("Require regression ObjectiveType"); } if (op.Metric == MetricType.DefaultMetric) { op.Metric = MetricType.Mse; } }