Changeset 170
- Timestamp:
- 04/23/08 12:06:58 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.StructureIdentification/Evaluation/MCCEvaluator.cs
r169 r170 38 38 } 39 39 40 double limit = 50.0;41 40 public MCCEvaluator() 42 41 : base() { 42 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)); 43 43 } 44 44 45 45 public override double Evaluate(IScope scope, IFunctionTree functionTree, int targetVariable, Dataset dataset) { 46 double limit = GetVariableValue<DoubleData>("ClassSeparation", scope, false).Data; 46 47 double[] estimated = new double[dataset.Rows]; 47 48 double[] original = new double[dataset.Rows]; … … 65 66 } 66 67 Array.Sort(estimated, original); 67 double best_mcc = 0.0;68 double best_mcc = -1.0; 68 69 double tp = 0; 69 70 double fn = positive; … … 76 77 tn--; fp++; 77 78 } 78 double mcc = (tp * tn - fp * fn) / Math.Sqrt( (tp + fp) * (tp + fn) * (tn + fp) * (tn + fn));79 double mcc = (tp * tn - fp * fn) / Math.Sqrt(positive * (tp + fn) * (tn + fp) * negative); 79 80 if(best_mcc < mcc) { 80 81 best_mcc = mcc;
Note: See TracChangeset
for help on using the changeset viewer.