Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/07/13 17:33:56 (12 years ago)
Author:
sforsten
Message:

#1998:

  • added OneRClassificationModelView
  • added ClassificationSolutionComparisonView
  • added several calculators (ConfusionMatrixCalculator, FOneScoreCalculator, MatthewsCorrelationCoefficientCalculator)
  • fixed bug in OneR
  • added StorableClass and Item attribute to several classes
Location:
branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/OneR
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/OneR/OneRClassificationModel.cs

    r9074 r9119  
    2929
    3030namespace HeuristicLab.Algorithms.DataAnalysis {
     31  [StorableClass]
     32  [Item("1R Classification Model", "A model that uses intervals for one variable to determine the class.")]
    3133  public class OneRClassificationModel : NamedItem, IClassificationModel {
    3234    [Storable]
     
    5254    protected OneRClassificationModel(OneRClassificationModel original, Cloner cloner)
    5355      : base(original, cloner) {
    54       this.splits = original.splits;
     56      this.variable = (string)original.variable;
     57      this.splits = (double[])original.splits.Clone();
     58      this.classes = (double[])original.classes.Clone();
    5559    }
    5660    public override IDeepCloneable Clone(Cloner cloner) { return new OneRClassificationModel(this, cloner); }
     
    5862    public OneRClassificationModel(string variable, double[] splits, double[] classes)
    5963      : base() {
     64      if (splits.Length != classes.Length) {
     65        throw new ArgumentException("Number of splits and classes has to be equal.");
     66      }
    6067      if (!Double.IsPositiveInfinity(splits[splits.Length - 1])) {
    6168        throw new ArgumentException("Last split has to be double.PositiveInfinity, so that all values are covered.");
  • branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/OneR/OneRClassificationSolution.cs

    r9074 r9119  
    2121
    2222using HeuristicLab.Common;
     23using HeuristicLab.Core;
    2324using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2425using HeuristicLab.Problems.DataAnalysis;
    2526
    2627namespace HeuristicLab.Algorithms.DataAnalysis {
     28  [StorableClass]
     29  [Item(Name = "1R Classification Solution", Description = "Represents a 1R classification solution (model + data).")]
    2730  public class OneRClassificationSolution : ClassificationSolution {
    28     public new ConstantClassificationModel Model {
    29       get { return (ConstantClassificationModel)base.Model; }
     31    public new OneRClassificationModel Model {
     32      get { return (OneRClassificationModel)base.Model; }
    3033      set { base.Model = value; }
    3134    }
Note: See TracChangeset for help on using the changeset viewer.