Changeset 17081 for trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/DecisionTreeRegression.cs
- Timestamp:
- 07/05/19 11:14:32 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/DecisionTreeRegression.cs
r17080 r17081 145 145 Parameters.Add(new FixedValueParameter<BoolValue>(GenerateRulesParameterName, "Whether a set of rules or a decision tree shall be created (default=false)", new BoolValue(false))); 146 146 Parameters.Add(new FixedValueParameter<PercentValue>(HoldoutSizeParameterName, "How much of the training set shall be reserved for pruning (default=20%).", new PercentValue(0.2))); 147 Parameters.Add(new ConstrainedValueParameter<ISplitter>(SplitterParameterName, "The type of split function used to create node splits (default='Splitter').", splitterSet, splitterSet.OfType< M5Splitter>().First()));147 Parameters.Add(new ConstrainedValueParameter<ISplitter>(SplitterParameterName, "The type of split function used to create node splits (default='Splitter').", splitterSet, splitterSet.OfType<Splitter>().First())); 148 148 Parameters.Add(new FixedValueParameter<IntValue>(MinimalNodeSizeParameterName, "The minimal number of samples in a leaf node (default=1).", new IntValue(1))); 149 149 Parameters.Add(new ConstrainedValueParameter<ILeafModel>(LeafModelParameterName, "The type of model used for the nodes (default='LinearLeaf').", modelSet, modelSet.OfType<LinearLeaf>().First())); … … 178 178 bool useHoldout = false, double holdoutSize = 0.2, int minimumLeafSize = 1, bool generateRules = false, ResultCollection results = null, CancellationToken? cancellationToken = null) { 179 179 if (leafModel == null) leafModel = new LinearLeaf(); 180 if (splitter == null) splitter = new M5Splitter();180 if (splitter == null) splitter = new Splitter(); 181 181 if (cancellationToken == null) cancellationToken = CancellationToken.None; 182 182 if (pruning == null) pruning = new ComplexityPruning(); … … 187 187 } 188 188 189 public static void UpdateModel(I M5Model model, IRegressionProblemData problemData, IRandom random, ILeafModel leafModel, CancellationToken? cancellationToken = null) {189 public static void UpdateModel(IDecisionTreeModel model, IRegressionProblemData problemData, IRandom random, ILeafModel leafModel, CancellationToken? cancellationToken = null) { 190 190 if (cancellationToken == null) cancellationToken = CancellationToken.None; 191 191 var regressionTreeParameters = new RegressionTreeParameters(leafModel, problemData, random); … … 244 244 private static IRegressionModel Build(IScope stateScope, ResultCollection results, CancellationToken cancellationToken) { 245 245 var regressionTreeParams = (RegressionTreeParameters)stateScope.Variables[RegressionTreeParameterVariableName].Value; 246 var model = (I M5Model)stateScope.Variables[ModelVariableName].Value;246 var model = (IDecisionTreeModel)stateScope.Variables[ModelVariableName].Value; 247 247 var trainingRows = (IntArray)stateScope.Variables[TrainingSetVariableName].Value; 248 248 var pruningRows = (IntArray)stateScope.Variables[PruningSetVariableName].Value;
Note: See TracChangeset
for help on using the changeset viewer.