- Timestamp:
- 08/10/08 12:44:27 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.StructureIdentification/Evaluation/MCCEvaluator.cs
r480 r482 35 35 private double[] original = new double[1]; 36 36 private double[] estimated = new double[1]; 37 private DoubleData mcc; 37 38 public override string Description { 38 39 get { 39 return @" TASK";40 return @"Calculates the matthews correlation coefficient for a given model and class separation threshold"; 40 41 } 41 42 } … … 43 44 : base() { 44 45 AddVariableInfo(new VariableInfo("ClassSeparation", "The value of separation between negative and positive target classification values (for instance 0.5 if negative=0 and positive=1).", typeof(DoubleData), VariableKind.In)); 46 AddVariableInfo(new VariableInfo("MCC", "The matthews correlation coefficient of the model", typeof(DoubleData), VariableKind.New)); 45 47 } 46 48 47 49 public override IOperation Apply(IScope scope) { 50 mcc = GetVariableValue<DoubleData>("MCC", scope, false, false); 51 if(mcc == null) { 52 mcc = new DoubleData(); 53 scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("MCC"), mcc)); 54 } 48 55 limit = GetVariableValue<DoubleData>("ClassSeparation", scope, true).Data; 49 56 return base.Apply(scope); 50 57 } 51 58 52 public override doubleEvaluate(int start, int end) {59 public override void Evaluate(int start, int end) { 53 60 int nSamples = end - start; 54 61 if(estimated.Length != nSamples) { … … 85 92 } 86 93 } 87 returnbest_mcc;94 this.mcc.Data = best_mcc; 88 95 } 89 96 }
Note: See TracChangeset
for help on using the changeset viewer.