Changeset 15280 for branches/Async/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/DiscriminantFunctionClassificationModel.cs
- Timestamp:
- 07/23/17 00:52:14 (7 years ago)
- Location:
- branches/Async
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Async
- Property svn:mergeinfo changed
-
branches/Async/HeuristicLab.Problems.DataAnalysis
-
branches/Async/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/DiscriminantFunctionClassificationModel.cs
r12509 r15280 33 33 [StorableClass] 34 34 [Item("DiscriminantFunctionClassificationModel", "Represents a classification model that uses a discriminant function and classification thresholds.")] 35 public class DiscriminantFunctionClassificationModel : NamedItem, IDiscriminantFunctionClassificationModel { 35 public class DiscriminantFunctionClassificationModel : ClassificationModel, IDiscriminantFunctionClassificationModel { 36 public override IEnumerable<string> VariablesUsedForPrediction { 37 get { return model.VariablesUsedForPrediction; } 38 } 39 36 40 [Storable] 37 41 private IRegressionModel model; … … 73 77 74 78 public DiscriminantFunctionClassificationModel(IRegressionModel model, IDiscriminantFunctionThresholdCalculator thresholdCalculator) 75 : base( ) {79 : base(model.TargetVariable) { 76 80 this.name = ItemName; 77 81 this.description = ItemDescription; 82 78 83 this.model = model; 79 84 this.classValues = new double[0]; … … 115 120 } 116 121 117 public IEnumerable<double> GetEstimatedClassValues(IDataset dataset, IEnumerable<int> rows) {122 public override IEnumerable<double> GetEstimatedClassValues(IDataset dataset, IEnumerable<int> rows) { 118 123 if (!Thresholds.Any() && !ClassValues.Any()) throw new ArgumentException("No thresholds and class values were set for the current classification model."); 119 124 foreach (var x in GetEstimatedValues(dataset, rows)) { … … 135 140 #endregion 136 141 137 public virtual IDiscriminantFunctionClassificationSolution CreateDiscriminantFunctionClassificationSolution(IClassificationProblemData problemData) { 142 public override IClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData) { 143 return CreateDiscriminantFunctionClassificationSolution(problemData); 144 } 145 public virtual IDiscriminantFunctionClassificationSolution CreateDiscriminantFunctionClassificationSolution( 146 IClassificationProblemData problemData) { 138 147 return new DiscriminantFunctionClassificationSolution(this, new ClassificationProblemData(problemData)); 139 }140 141 public virtual IClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData) {142 return CreateDiscriminantFunctionClassificationSolution(problemData);143 148 } 144 149 }
Note: See TracChangeset
for help on using the changeset viewer.