Ejemplo n.º 1
0
 ///<param name="scoreTracker"></param>
 /// <param name="resultType">1: L1, 2: L2. Otherwise, return all.</param>
 public RegressionTest(ScoreTracker scoreTracker, int?resultType = null)
     : base(scoreTracker)
 {
     _labels = FastTreeRegressionTrainer.GetDatasetRegressionLabels(scoreTracker.Dataset);
     Contracts.Check(scoreTracker.Dataset.NumDocs == _labels.Length, "Mismatch between dataset and labels");
     _resultType = resultType;
 }
        private protected override TreeEnsembleModelParameters PrepareModel(IDataView input)
        {
            var trainer = new FastTreeRegressionTrainer(Env, _trainerOptions);
            var trained = trainer.Fit(input);

            return(trained.Model);
        }
 private ObjectiveFunctionImplBase(Dataset trainData, Arguments args)
     : base(trainData, args, double.MaxValue) // No notion of maximum step size.
 {
     _labels = FastTreeRegressionTrainer.GetDatasetRegressionLabels(trainData);
     Contracts.Assert(_labels.Length == trainData.NumDocs);
 }