Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/21/12 18:48:12 (12 years ago)
Author:
gkronber
Message:

#1902 changed DiscriminantFunctionClassificationModel and DiscriminantFunctionClassificationSolution to non-abstract. Classification based on GPR uses these classes to create a classification solution from a GaussianProcessRegressionModel.
Also added view classes for DiscriminantFunctionClassificationModel

Location:
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification
Files:
2 edited

Legend:

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

    r8623 r8679  
    3333  [StorableClass]
    3434  [Item("DiscriminantFunctionClassificationModel", "Represents a classification model that uses a discriminant function and classification thresholds.")]
    35   public abstract class DiscriminantFunctionClassificationModel : NamedItem, IDiscriminantFunctionClassificationModel {
     35  public class DiscriminantFunctionClassificationModel : NamedItem, IDiscriminantFunctionClassificationModel {
    3636    [Storable]
    3737    private IRegressionModel model;
     38    public IRegressionModel Model {
     39      get { return model; }
     40      private set { model = value; }
     41    }
    3842
    3943    [Storable]
     
    8387    }
    8488
     89    public override IDeepCloneable Clone(Cloner cloner) {
     90      return new DiscriminantFunctionClassificationModel(this, cloner);
     91    }
     92
    8593    public void SetThresholdsAndClassValues(IEnumerable<double> thresholds, IEnumerable<double> classValues) {
    8694      var classValuesArr = classValues.ToArray();
     
    127135    #endregion
    128136
    129     public abstract IDiscriminantFunctionClassificationSolution CreateDiscriminantFunctionClassificationSolution(IClassificationProblemData problemData);
    130     public abstract IClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData);
     137    public virtual IDiscriminantFunctionClassificationSolution CreateDiscriminantFunctionClassificationSolution(IClassificationProblemData problemData) {
     138      return new DiscriminantFunctionClassificationSolution(this, problemData);
     139    }
     140
     141    public virtual IClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData) {
     142      return CreateDiscriminantFunctionClassificationSolution(problemData);
     143    }
    131144  }
    132145}
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/DiscriminantFunctionClassificationSolution.cs

    r8531 r8679  
    3232  [StorableClass]
    3333  [Item("DiscriminantFunctionClassificationSolution", "Represents a classification solution that uses a discriminant function and classification thresholds.")]
    34   public abstract class DiscriminantFunctionClassificationSolution : DiscriminantFunctionClassificationSolutionBase {
     34  public class DiscriminantFunctionClassificationSolution : DiscriminantFunctionClassificationSolutionBase {
    3535    protected readonly Dictionary<int, double> valueEvaluationCache;
    3636    protected readonly Dictionary<int, double> classValueEvaluationCache;
     
    4747      classValueEvaluationCache = new Dictionary<int, double>(original.classValueEvaluationCache);
    4848    }
    49     protected DiscriminantFunctionClassificationSolution(IDiscriminantFunctionClassificationModel model, IClassificationProblemData problemData)
     49    public DiscriminantFunctionClassificationSolution(IDiscriminantFunctionClassificationModel model, IClassificationProblemData problemData)
    5050      : base(model, problemData) {
    5151      valueEvaluationCache = new Dictionary<int, double>();
    5252      classValueEvaluationCache = new Dictionary<int, double>();
     53      RecalculateResults();
    5354    }
    5455
     
    112113      base.OnProblemDataChanged();
    113114    }
     115
     116    protected override void RecalculateResults() {
     117      CalculateResults();
     118      CalculateRegressionResults();
     119    }
    114120  }
    115121}
Note: See TracChangeset for help on using the changeset viewer.