Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/29/16 10:36:52 (8 years ago)
Author:
pfleck
Message:

#2597

  • Merged recent trunk changes.
  • Adapted VariablesUsedForPrediction property for RegressionSolutionTargetResponseGradientView.
  • Fixed a reference (.dll to project ref).
Location:
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis

  • branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/ConstantRegressionModel.cs

    r13100 r13948  
    3232  [Item("Constant Regression Model", "A model that always returns the same constant value regardless of the presented input data.")]
    3333  [Obsolete]
    34   public class ConstantRegressionModel : NamedItem, IRegressionModel, IStringConvertibleValue {
     34  public class ConstantRegressionModel : RegressionModel, IStringConvertibleValue {
     35    public override IEnumerable<string> VariablesUsedForPrediction { get { return Enumerable.Empty<string>(); } }
     36
    3537    [Storable]
    3638    private double constant;
     
    4648      this.constant = original.constant;
    4749    }
     50
    4851    public override IDeepCloneable Clone(Cloner cloner) { return new ConstantRegressionModel(this, cloner); }
    4952
    50     public ConstantRegressionModel(double constant)
    51       : base() {
     53    public ConstantRegressionModel(double constant, string targetVariable = "Target")
     54      : base(targetVariable) {
    5255      this.name = ItemName;
    5356      this.description = ItemDescription;
     
    5659    }
    5760
    58     public IEnumerable<double> GetEstimatedValues(IDataset dataset, IEnumerable<int> rows) {
     61    public override IEnumerable<double> GetEstimatedValues(IDataset dataset, IEnumerable<int> rows) {
    5962      return rows.Select(row => Constant);
    6063    }
    6164
    62     public IRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData) {
     65    public override IRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData) {
    6366      return new ConstantRegressionSolution(new ConstantModel(constant), new RegressionProblemData(problemData));
    6467    }
Note: See TracChangeset for help on using the changeset viewer.