Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/03/09 12:26:42 (15 years ago)
Author:
gkronber
Message:

Merged changes from GP-refactoring branch back into the trunk #713.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/MulticlassOneVsOneAnalyzer.cs

    r2034 r2222  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Text;
    25 using System.Xml;
    2623using HeuristicLab.Core;
    2724using HeuristicLab.Data;
    2825using HeuristicLab.DataAnalysis;
    29 using HeuristicLab.GP.StructureIdentification;
     26using HeuristicLab.GP.Interfaces;
    3027
    3128namespace HeuristicLab.GP.StructureIdentification.Classification {
     
    4542    private const string VOTES = "Votes";
    4643    private const string ACCURACY = "Accuracy";
     44    private const string TREEEVALUATOR = "TreeEvaluator";
    4745
    4846    private const double EPSILON = 1E-6;
     
    6361      AddVariableInfo(new VariableInfo(SAMPLESEND, "The end of samples in the original dataset", typeof(IntData), VariableKind.In));
    6462      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));
    6665      AddVariableInfo(new VariableInfo(VOTES, "Array with the votes for each instance", typeof(IntMatrixData), VariableKind.New));
    6766      AddVariableInfo(new VariableInfo(ACCURACY, "Accuracy of the one-vs-one multi-cass classifier", typeof(DoubleData), VariableKind.New));
     
    8281        double classBValue = GetVariableValue<DoubleData>(CLASSBVALUE, childScope, true).Data;
    8382        IScope bestScope = GetVariableValue<IScope>(BESTMODELLSCOPE, childScope, true);
    84         BakedFunctionTree functionTree = GetVariableValue<BakedFunctionTree>(BESTMODELL, bestScope, true);
     83        IGeneticProgrammingModel gpModel = GetVariableValue<IGeneticProgrammingModel>(BESTMODELL, bestScope, true);
    8584
    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);
    8887        for(int i = 0; i < (samplesEnd - samplesStart); i++) {
    8988          double est = evaluator.Evaluate(i + samplesStart);
Note: See TracChangeset for help on using the changeset viewer.