Changeset 9119 for branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/OneR
- Timestamp:
- 01/07/13 17:33:56 (12 years ago)
- 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 29 29 30 30 namespace HeuristicLab.Algorithms.DataAnalysis { 31 [StorableClass] 32 [Item("1R Classification Model", "A model that uses intervals for one variable to determine the class.")] 31 33 public class OneRClassificationModel : NamedItem, IClassificationModel { 32 34 [Storable] … … 52 54 protected OneRClassificationModel(OneRClassificationModel original, Cloner cloner) 53 55 : 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(); 55 59 } 56 60 public override IDeepCloneable Clone(Cloner cloner) { return new OneRClassificationModel(this, cloner); } … … 58 62 public OneRClassificationModel(string variable, double[] splits, double[] classes) 59 63 : base() { 64 if (splits.Length != classes.Length) { 65 throw new ArgumentException("Number of splits and classes has to be equal."); 66 } 60 67 if (!Double.IsPositiveInfinity(splits[splits.Length - 1])) { 61 68 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 21 21 22 22 using HeuristicLab.Common; 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 24 25 using HeuristicLab.Problems.DataAnalysis; 25 26 26 27 namespace HeuristicLab.Algorithms.DataAnalysis { 28 [StorableClass] 29 [Item(Name = "1R Classification Solution", Description = "Represents a 1R classification solution (model + data).")] 27 30 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; } 30 33 set { base.Model = value; } 31 34 }
Note: See TracChangeset
for help on using the changeset viewer.