Changeset 14000


Ignore:
Timestamp:
07/05/16 14:05:46 (5 years ago)
Author:
mkommend
Message:

#2604: Removed default ctor arguments for the target variable in regression and classification models.

Location:
trunk/sources
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithmStatic.cs

    r13157 r14000  
    9696        weights = new List<double>();
    9797        // add constant model
    98         models.Add(new ConstantModel(f0));
     98        models.Add(new ConstantModel(f0, problemData.TargetVariable));
    9999        weights.Add(1.0);
    100100      }
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/RegressionTreeModel.cs

    r13992 r14000  
    160160    }
    161161
    162     internal RegressionTreeModel(TreeNode[] tree, string target = "Target")
    163       : base(target, "RegressionTreeModel", "Represents a decision tree for regression.") {
     162    internal RegressionTreeModel(TreeNode[] tree, string targetVariable)
     163      : base(targetVariable, "RegressionTreeModel", "Represents a decision tree for regression.") {
    164164      this.tree = tree;
    165165    }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/ConstantModel.cs

    r13941 r14000  
    5151    public override IDeepCloneable Clone(Cloner cloner) { return new ConstantModel(this, cloner); }
    5252
    53     public ConstantModel(double constant, string targetVariable = "Target")
     53    public ConstantModel(double constant, string targetVariable)
    5454      : base(targetVariable) {
    5555      this.name = ItemName;
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/ConstantRegressionModel.cs

    r13992 r14000  
    5151    public override IDeepCloneable Clone(Cloner cloner) { return new ConstantRegressionModel(this, cloner); }
    5252
    53     public ConstantRegressionModel(double constant, string targetVariable = "Target")
     53    public ConstantRegressionModel(double constant, string targetVariable)
    5454      : base(targetVariable) {
    5555      this.name = ItemName;
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/Models/ConstantTimeSeriesPrognosisModel.cs

    r13993 r14000  
    3939    }
    4040
    41     public ConstantTimeSeriesPrognosisModel(double constant, string targetVariable = "Target") : base(constant, targetVariable) { }
     41    public ConstantTimeSeriesPrognosisModel(double constant, string targetVariable) : base(constant, targetVariable) { }
    4242
    4343    public IEnumerable<IEnumerable<double>> GetPrognosedValues(IDataset dataset, IEnumerable<int> rows, IEnumerable<int> horizons) {
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/TimeSeriesPrognosisResults.cs

    r13100 r14000  
    373373      //mean model
    374374      double trainingMean = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, problemData.TrainingIndices).Average();
    375       var meanModel = new ConstantModel(trainingMean);
     375      var meanModel = new ConstantModel(trainingMean, problemData.TargetVariable);
    376376
    377377      //AR1 model
     
    395395      PrognosisTrainingMeanAbsoluteError = errorState == OnlineCalculatorError.None ? trainingMAE : double.NaN;
    396396      double trainingR = OnlinePearsonsRCalculator.Calculate(originalTrainingValues, estimatedTrainingValues, out errorState);
    397       PrognosisTrainingRSquared = errorState == OnlineCalculatorError.None ? trainingR*trainingR : double.NaN;
     397      PrognosisTrainingRSquared = errorState == OnlineCalculatorError.None ? trainingR * trainingR : double.NaN;
    398398      double trainingRelError = OnlineMeanAbsolutePercentageErrorCalculator.Calculate(originalTrainingValues, estimatedTrainingValues, out errorState);
    399399      PrognosisTrainingRelativeError = errorState == OnlineCalculatorError.None ? trainingRelError : double.NaN;
     
    431431      PrognosisTestMeanAbsoluteError = errorState == OnlineCalculatorError.None ? testMAE : double.NaN;
    432432      double testR = OnlinePearsonsRCalculator.Calculate(originalTestValues, estimatedTestValues, out errorState);
    433       PrognosisTestRSquared = errorState == OnlineCalculatorError.None ? testR*testR : double.NaN;
     433      PrognosisTestRSquared = errorState == OnlineCalculatorError.None ? testR * testR : double.NaN;
    434434      double testRelError = OnlineMeanAbsolutePercentageErrorCalculator.Calculate(originalTestValues, estimatedTestValues, out errorState);
    435435      PrognosisTestRelativeError = errorState == OnlineCalculatorError.None ? testRelError : double.NaN;
     
    448448        //mean model
    449449        double trainingMean = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, problemData.TrainingIndices).Average();
    450         var meanModel = new ConstantModel(trainingMean);
     450        var meanModel = new ConstantModel(trainingMean, problemData.TargetVariable);
    451451
    452452        //AR1 model
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionBase.cs

    r13100 r14000  
    150150      OnlineCalculatorError errorState;
    151151      double trainingMean = ProblemData.TrainingIndices.Any() ? ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices).Average() : double.NaN;
    152       var meanModel = new ConstantModel(trainingMean);
     152      var meanModel = new ConstantModel(trainingMean,ProblemData.TargetVariable);
    153153
    154154      double alpha, beta;
Note: See TracChangeset for help on using the changeset viewer.