- Timestamp:
- 04/10/17 15:48:20 (8 years ago)
- Location:
- branches/TSNE/HeuristicLab.Algorithms.DataAnalysis
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/TSNE/HeuristicLab.Algorithms.DataAnalysis
- Property svn:mergeinfo changed
-
branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithm.cs
r14558 r14836 38 38 [StorableClass] 39 39 [Creatable(CreatableAttribute.Categories.DataAnalysisRegression, Priority = 125)] 40 public class GradientBoostedTreesAlgorithm : BasicAlgorithm, IDataAnalysisAlgorithm<IRegressionProblem> { 41 public override Type ProblemType 42 { 43 get { return typeof(IRegressionProblem); } 44 } 45 public new IRegressionProblem Problem 46 { 47 get { return (IRegressionProblem)base.Problem; } 48 set { base.Problem = value; } 49 } 50 public override bool SupportsPause 51 { 52 get { return false; } 53 } 54 40 public class GradientBoostedTreesAlgorithm : FixedDataAnalysisAlgorithm<IRegressionProblem> { 55 41 #region ParameterNames 56 42 private const string IterationsParameterName = "Iterations"; … … 289 275 var classificationProblemData = new ClassificationProblemData(problemData.Dataset, 290 276 problemData.AllowedInputVariables, problemData.TargetVariable, problemData.Transformations); 291 classificationModel.RecalculateModelParameters(classificationProblemData, classificationProblemData.TrainingIndices); 277 classificationProblemData.TrainingPartition.Start = Problem.ProblemData.TrainingPartition.Start; 278 classificationProblemData.TrainingPartition.End = Problem.ProblemData.TrainingPartition.End; 279 classificationProblemData.TestPartition.Start = Problem.ProblemData.TestPartition.Start; 280 classificationProblemData.TestPartition.End = Problem.ProblemData.TestPartition.End; 281 282 classificationModel.SetThresholdsAndClassValues(new double[] { double.NegativeInfinity, 0.0 }, new []{ 0.0, 1.0 }); 283 292 284 293 285 var classificationSolution = new DiscriminantFunctionClassificationSolution(classificationModel, classificationProblemData); -
branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithmStatic.cs
r14185 r14836 148 148 // for custom stepping & termination 149 149 public static IGbmState CreateGbmState(IRegressionProblemData problemData, ILossFunction lossFunction, uint randSeed, int maxSize = 3, double r = 0.66, double m = 0.5, double nu = 0.01) { 150 // check input variables. Only double variables are allowed. 151 var invalidInputs = 152 problemData.AllowedInputVariables.Where(name => !problemData.Dataset.VariableHasType<double>(name)); 153 if (invalidInputs.Any()) 154 throw new NotSupportedException("Gradient tree boosting only supports real-valued variables. Unsupported inputs: " + string.Join(", ", invalidInputs)); 155 150 156 return new GbmState(problemData, lossFunction, randSeed, maxSize, r, m, nu); 151 157 }
Note: See TracChangeset
for help on using the changeset viewer.