Changeset 2222 for trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/MulticlassOneVsOneAnalyzer.cs
- Timestamp:
- 08/03/09 12:26:42 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/MulticlassOneVsOneAnalyzer.cs
r2034 r2222 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.Text;25 using System.Xml;26 23 using HeuristicLab.Core; 27 24 using HeuristicLab.Data; 28 25 using HeuristicLab.DataAnalysis; 29 using HeuristicLab.GP. StructureIdentification;26 using HeuristicLab.GP.Interfaces; 30 27 31 28 namespace HeuristicLab.GP.StructureIdentification.Classification { … … 45 42 private const string VOTES = "Votes"; 46 43 private const string ACCURACY = "Accuracy"; 44 private const string TREEEVALUATOR = "TreeEvaluator"; 47 45 48 46 private const double EPSILON = 1E-6; … … 63 61 AddVariableInfo(new VariableInfo(SAMPLESEND, "The end of samples in the original dataset", typeof(IntData), VariableKind.In)); 64 62 AddVariableInfo(new VariableInfo(BESTMODELLSCOPE, "The variable containing the scope of the model (incl. meta data)", typeof(IScope), VariableKind.In)); 65 AddVariableInfo(new VariableInfo(BESTMODELL, "The variable in the scope of the model that contains the actual model", typeof(BakedFunctionTree), VariableKind.In)); 63 AddVariableInfo(new VariableInfo(BESTMODELL, "The variable in the scope of the model that contains the actual model", typeof(IGeneticProgrammingModel), VariableKind.In)); 64 AddVariableInfo(new VariableInfo(TREEEVALUATOR, "The evaluator to apply to the function tree", typeof(ITreeEvaluator), VariableKind.In)); 66 65 AddVariableInfo(new VariableInfo(VOTES, "Array with the votes for each instance", typeof(IntMatrixData), VariableKind.New)); 67 66 AddVariableInfo(new VariableInfo(ACCURACY, "Accuracy of the one-vs-one multi-cass classifier", typeof(DoubleData), VariableKind.New)); … … 82 81 double classBValue = GetVariableValue<DoubleData>(CLASSBVALUE, childScope, true).Data; 83 82 IScope bestScope = GetVariableValue<IScope>(BESTMODELLSCOPE, childScope, true); 84 BakedFunctionTree functionTree = GetVariableValue<BakedFunctionTree>(BESTMODELL, bestScope, true);83 IGeneticProgrammingModel gpModel = GetVariableValue<IGeneticProgrammingModel>(BESTMODELL, bestScope, true); 85 84 86 BakedTreeEvaluator evaluator = new BakedTreeEvaluator();87 evaluator.PrepareForEvaluation(dataset, targetVariable, trainingSamplesStart, trainingSamplesEnd, 1.0, functionTree);85 ITreeEvaluator evaluator = GetVariableValue<ITreeEvaluator>(TREEEVALUATOR, bestScope, true); 86 evaluator.PrepareForEvaluation(dataset, targetVariable, trainingSamplesStart, trainingSamplesEnd, 1.0, gpModel.FunctionTree); 88 87 for(int i = 0; i < (samplesEnd - samplesStart); i++) { 89 88 double est = evaluator.Evaluate(i + samplesStart);
Note: See TracChangeset
for help on using the changeset viewer.