Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/10/08 12:44:27 (16 years ago)
Author:
gkronber
Message:

made a few more improvements in the GP evaluators (ticket #242 All GP evaluators should support the 'UseEstimatedTargetValues' switch for autoregressive modelling)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.StructureIdentification/Evaluation/MCCEvaluator.cs

    r480 r482  
    3535    private double[] original = new double[1];
    3636    private double[] estimated = new double[1];
     37    private DoubleData mcc;
    3738    public override string Description {
    3839      get {
    39         return @"TASK";
     40        return @"Calculates the matthews correlation coefficient for a given model and class separation threshold";
    4041      }
    4142    }
     
    4344      : base() {
    4445      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));
    4547    }
    4648
    4749    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      }
    4855      limit = GetVariableValue<DoubleData>("ClassSeparation", scope, true).Data;
    4956      return base.Apply(scope);
    5057    }
    5158
    52     public override double Evaluate(int start, int end) {
     59    public override void Evaluate(int start, int end) {
    5360      int nSamples = end - start;
    5461      if(estimated.Length != nSamples) {
     
    8592        }
    8693      }
    87       return best_mcc;
     94      this.mcc.Data = best_mcc;
    8895    }
    8996  }
Note: See TracChangeset for help on using the changeset viewer.