- Timestamp:
- 05/25/09 17:46:17 (16 years ago)
- Location:
- trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/AccuracyEvaluator.cs
r1796 r1891 43 43 } 44 44 45 public override void Evaluate(IScope scope, ITreeEvaluator evaluator, IFunctionTree tree,Dataset dataset, int targetVariable, double[] classes, double[] thresholds, int start, int end) {45 public override void Evaluate(IScope scope, ITreeEvaluator evaluator, Dataset dataset, int targetVariable, double[] classes, double[] thresholds, int start, int end) { 46 46 DoubleData accuracy = GetVariableValue<DoubleData>("Accuracy", scope, false, false); 47 47 if (accuracy == null) { … … 53 53 int nCorrect = 0; 54 54 for (int sample = start; sample < end; sample++) { 55 double est = evaluator.Evaluate( tree,sample);55 double est = evaluator.Evaluate(sample); 56 56 double origClass = dataset.GetValue(sample, targetVariable); 57 57 double estClass = double.NaN; -
trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/ClassificationMeanSquaredErrorEvaluator.cs
r1796 r1891 43 43 } 44 44 45 public override void Evaluate(IScope scope, ITreeEvaluator evaluator, IFunctionTree tree,HeuristicLab.DataAnalysis.Dataset dataset, int targetVariable, double[] classes, double[] thresholds, int start, int end) {45 public override void Evaluate(IScope scope, ITreeEvaluator evaluator, HeuristicLab.DataAnalysis.Dataset dataset, int targetVariable, double[] classes, double[] thresholds, int start, int end) { 46 46 double errorsSquaredSum = 0; 47 47 for (int sample = start; sample < end; sample++) { 48 double estimated = evaluator.Evaluate( tree,sample);48 double estimated = evaluator.Evaluate(sample); 49 49 double original = dataset.GetValue(sample, targetVariable); 50 50 if (!double.IsNaN(original) && !double.IsInfinity(original)) { -
trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/ConfusionMatrixEvaluator.cs
r1796 r1891 41 41 } 42 42 43 public override void Evaluate(IScope scope, ITreeEvaluator evaluator, IFunctionTree tree,HeuristicLab.DataAnalysis.Dataset dataset, int targetVariable, double[] classes, double[] thresholds, int start, int end) {43 public override void Evaluate(IScope scope, ITreeEvaluator evaluator, HeuristicLab.DataAnalysis.Dataset dataset, int targetVariable, double[] classes, double[] thresholds, int start, int end) { 44 44 IntMatrixData matrix = GetVariableValue<IntMatrixData>("ConfusionMatrix", scope, false, false); 45 45 if (matrix == null) { … … 50 50 int nSamples = end - start; 51 51 for (int sample = start; sample < end; sample++) { 52 double est = evaluator.Evaluate( tree,sample);52 double est = evaluator.Evaluate(sample); 53 53 double origClass = dataset.GetValue(sample, targetVariable); 54 54 int estClassIndex = -1; -
trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/GPClassificationEvaluatorBase.cs
r1796 r1891 37 37 } 38 38 39 public override void Evaluate(IScope scope, ITreeEvaluator evaluator, IFunctionTree tree,Dataset dataset, int targetVariable, int start, int end, bool updateTargetValues) {39 public override void Evaluate(IScope scope, ITreeEvaluator evaluator, Dataset dataset, int targetVariable, int start, int end, bool updateTargetValues) { 40 40 41 41 ItemList<DoubleData> classes = GetVariableValue<ItemList<DoubleData>>("TargetClassValues", scope, true); … … 48 48 } 49 49 50 Evaluate(scope, evaluator, tree,dataset, targetVariable, classesArr, thresholds, start, end);50 Evaluate(scope, evaluator, dataset, targetVariable, classesArr, thresholds, start, end); 51 51 } 52 52 53 public abstract void Evaluate(IScope scope, ITreeEvaluator evaluator, IFunctionTree tree,Dataset dataset, int targetVariable, double[] classes, double[] thresholds, int start, int end);53 public abstract void Evaluate(IScope scope, ITreeEvaluator evaluator, Dataset dataset, int targetVariable, double[] classes, double[] thresholds, int start, int end); 54 54 } 55 55 } -
trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/MulticlassOneVsOneAnalyzer.cs
r1796 r1891 86 86 BakedTreeEvaluator evaluator = new BakedTreeEvaluator(); 87 87 evaluator.ResetEvaluator(dataset, targetVariable, trainingSamplesStart, trainingSamplesEnd, 1.0); 88 88 evaluator.PrepareForEvaluation(functionTree); 89 89 for(int i = 0; i < (samplesEnd - samplesStart); i++) { 90 double est = evaluator.Evaluate( functionTree,i + samplesStart);90 double est = evaluator.Evaluate(i + samplesStart); 91 91 if(est < 0.5) { 92 92 CastVote(votes, i, classAValue, classValues);
Note: See TracChangeset
for help on using the changeset viewer.