Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/19/16 19:56:11 (8 years ago)
Author:
bburlacu
Message:

#2604: Revert changes to DataAnalysisSolution and IDataAnalysisSolution and implement the desired properties in model classes that implement IDataAnalysisModel, IRegressionModel and IClassificationModel.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/ConstantModel.cs

    r13154 r13921  
    3232  [Item("Constant Model", "A model that always returns the same constant value regardless of the presented input data.")]
    3333  public class ConstantModel : NamedItem, IRegressionModel, IClassificationModel, ITimeSeriesPrognosisModel, IStringConvertibleValue {
     34    public IEnumerable<string> VariablesUsedForPrediction { get { return Enumerable.Empty<string>(); } }
     35
    3436    [Storable]
    35     private double constant;
     37    private readonly string targetVariable;
     38    public string TargetVariable {
     39      get { return targetVariable; }
     40    }
     41
     42    [Storable]
     43    private readonly double constant;
    3644    public double Constant {
    3745      get { return constant; }
     
    4452      : base(original, cloner) {
    4553      this.constant = original.constant;
     54      this.targetVariable = original.targetVariable;
    4655    }
     56
    4757    public override IDeepCloneable Clone(Cloner cloner) { return new ConstantModel(this, cloner); }
    4858
    49     public ConstantModel(double constant)
     59    public ConstantModel(double constant, string targetVariable = "Target")
    5060      : base() {
    5161      this.name = ItemName;
     
    5363      this.constant = constant;
    5464      this.ReadOnly = true; // changing a constant regression model is not supported
     65      this.targetVariable = targetVariable;
    5566    }
    5667
Note: See TracChangeset for help on using the changeset viewer.