Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/05/19 11:08:57 (5 years ago)
Author:
gkronber
Message:

#2847: more changes for renaming the M5 plugin

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/DecisionTreeRegression.cs

    r17079 r17080  
    3838  [StorableType("FC8D8E5A-D16D-41BB-91CF-B2B35D17ADD7")]
    3939  [Creatable(CreatableAttribute.Categories.DataAnalysisRegression, Priority = 95)]
    40   [Item("M5RegressionTree", "A M5 regression tree / rule set")]
    41   public sealed class M5Regression : FixedDataAnalysisAlgorithm<IRegressionProblem> {
     40  [Item("Decision tree regression", "A regression tree / rule set learner")]
     41  public sealed class DecisionTreeRegression : FixedDataAnalysisAlgorithm<IRegressionProblem> {
    4242    public override bool SupportsPause {
    4343      get { return true; }
     
    135135    #region Constructors and Cloning
    136136    [StorableConstructor]
    137     private M5Regression(StorableConstructorFlag _) : base(_) { }
    138     private M5Regression(M5Regression original, Cloner cloner) : base(original, cloner) {
     137    private DecisionTreeRegression(StorableConstructorFlag _) : base(_) { }
     138    private DecisionTreeRegression(DecisionTreeRegression original, Cloner cloner) : base(original, cloner) {
    139139      stateScope = cloner.Clone(stateScope);
    140140    }
    141     public M5Regression() {
     141    public DecisionTreeRegression() {
    142142      var modelSet = new ItemSet<ILeafModel>(ApplicationManager.Manager.GetInstances<ILeafModel>());
    143143      var pruningSet = new ItemSet<IPruning>(ApplicationManager.Manager.GetInstances<IPruning>());
     
    145145      Parameters.Add(new FixedValueParameter<BoolValue>(GenerateRulesParameterName, "Whether a set of rules or a decision tree shall be created (default=false)", new BoolValue(false)));
    146146      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='M5Splitter').", 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<M5Splitter>().First()));
    148148      Parameters.Add(new FixedValueParameter<IntValue>(MinimalNodeSizeParameterName, "The minimal number of samples in a leaf node (default=1).", new IntValue(1)));
    149149      Parameters.Add(new ConstrainedValueParameter<ILeafModel>(LeafModelParameterName, "The type of model used for the nodes (default='LinearLeaf').", modelSet, modelSet.OfType<LinearLeaf>().First()));
     
    155155    }
    156156    public override IDeepCloneable Clone(Cloner cloner) {
    157       return new M5Regression(this, cloner);
     157      return new DecisionTreeRegression(this, cloner);
    158158    }
    159159    #endregion
     
    204204      var doubleVars = new HashSet<string>(problemData.Dataset.DoubleVariables);
    205205      var vars = problemData.AllowedInputVariables.Concat(new[] {problemData.TargetVariable}).ToArray();
    206       if (vars.Any(v => !doubleVars.Contains(v))) throw new NotSupportedException("M5 regression supports only double valued input or output features.");
     206      if (vars.Any(v => !doubleVars.Contains(v))) throw new NotSupportedException("Decision tree regression supports only double valued input or output features.");
    207207      var doubles = vars.Select(v => problemData.Dataset.GetDoubleValues(v, problemData.TrainingIndices).ToArray()).ToArray();
    208208      if (doubles.Any(v => v.Any(x => double.IsNaN(x) || double.IsInfinity(x))))
    209         throw new NotSupportedException("M5 regression does not support NaN or infinity values in the input dataset.");
     209        throw new NotSupportedException("Decision tree regression does not support NaN or infinity values in the input dataset.");
    210210      var trainingData = new Dataset(vars, doubles);
    211211      var pd = new RegressionProblemData(trainingData, problemData.AllowedInputVariables, problemData.TargetVariable);
     
    283283      var ruleSet = solution.Model as RegressionRuleSetModel;
    284284      if (ruleSet != null) {
    285         results.Add(RegressionTreeAnalyzer.CreateRulesResult(ruleSet, problemData, "M5Rules", true));
     285        results.Add(RegressionTreeAnalyzer.CreateRulesResult(ruleSet, problemData, "Rules", true));
    286286        frequencies = RegressionTreeAnalyzer.GetRuleVariableFrequences(ruleSet);
    287287        results.Add(RegressionTreeAnalyzer.CreateCoverageDiagram(ruleSet, problemData));
Note: See TracChangeset for help on using the changeset viewer.