Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/08/09 11:11:50 (15 years ago)
Author:
gkronber
Message:

Extended IAnalyzerModel and the default implementation AnalyzerModel to hold a dictionary of result values and extended GP algorithms for time-series prognosis and classification to store specific results (TheilInequalityCoefficient and Accuracy in the model) (#736). Also prepared IAnalyzerModel and AnalyzerModel and modeling algorithms to store meta-information about models (#731).

Location:
trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3
Files:
3 edited

Legend:

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

    r2341 r2344  
    5555      testAccuracy.GetVariableInfo("SamplesEnd").ActualName = "TestSamplesEnd";
    5656
    57       ConfusionMatrixEvaluator trainingConfusionMatrix = new ConfusionMatrixEvaluator();
    58       trainingConfusionMatrix.Name = "TrainingConfusionMatrixEvaluator";
    59       trainingConfusionMatrix.GetVariableInfo("ConfusionMatrix").ActualName = "TrainingConfusionMatrix";
    60       trainingConfusionMatrix.GetVariableInfo("SamplesStart").ActualName = "TrainingSamplesStart";
    61       trainingConfusionMatrix.GetVariableInfo("SamplesEnd").ActualName = "TrainingSamplesEnd";
    62 
    63       ConfusionMatrixEvaluator validationConfusionMatrix = new ConfusionMatrixEvaluator();
    64       validationConfusionMatrix.Name = "ValidationConfusionMatrixEvaluator";
    65       validationConfusionMatrix.GetVariableInfo("ConfusionMatrix").ActualName = "ValidationConfusionMatrix";
    66       validationConfusionMatrix.GetVariableInfo("SamplesStart").ActualName = "ValidationSamplesStart";
    67       validationConfusionMatrix.GetVariableInfo("SamplesEnd").ActualName = "ValidationSamplesEnd";
    68 
    69       ConfusionMatrixEvaluator testConfusionMatrix = new ConfusionMatrixEvaluator();
    70       testConfusionMatrix.Name = "TestConfusionMatrixEvaluator";
    71       testConfusionMatrix.GetVariableInfo("ConfusionMatrix").ActualName = "TestConfusionMatrix";
    72       testConfusionMatrix.GetVariableInfo("SamplesStart").ActualName = "TestSamplesStart";
    73       testConfusionMatrix.GetVariableInfo("SamplesEnd").ActualName = "TestSamplesEnd";
    74 
    7557      individualProc.AddSubOperator(trainingAccuracy);
    7658      individualProc.AddSubOperator(validationAccuracy);
    7759      individualProc.AddSubOperator(testAccuracy);
    78       individualProc.AddSubOperator(trainingConfusionMatrix);
    79       individualProc.AddSubOperator(validationConfusionMatrix);
    80       individualProc.AddSubOperator(testConfusionMatrix);
    8160      return seq;
    8261    }
     
    9271      return op;
    9372    }
     73
     74    internal static void SetModelData(IAnalyzerModel model, IScope scope) {
     75      model.SetResult("TrainingAccuracy", scope.GetVariableValue<DoubleData>("TrainingAccuracy", true).Data);
     76      model.SetResult("ValidationAccuracy", scope.GetVariableValue<DoubleData>("ValidationAccuracy", true).Data);
     77      model.SetResult("TestAccuracy", scope.GetVariableValue<DoubleData>("TestAccuracy", true).Data);
     78    }
    9479  }
    9580}
  • trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/OffspringSelectionGP.cs

    r2341 r2344  
    3434      return DefaultClassificationAlgorithmOperators.CreatePostProcessingOperator();
    3535    }
     36
     37    protected override IAnalyzerModel CreateGPModel() {
     38      IAnalyzerModel model = base.CreateGPModel();
     39      DefaultClassificationAlgorithmOperators.SetModelData(model, Engine.GlobalScope.SubScopes[0]);
     40      return model;
     41    }
    3642  }
    3743}
  • trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/StandardGP.cs

    r2341 r2344  
    2727namespace HeuristicLab.GP.StructureIdentification.Classification {
    2828  public class StandardGP : HeuristicLab.GP.StructureIdentification.StandardGP, IClassificationAlgorithm {
     29    protected override IOperator CreateProblemInjector() {
     30      return DefaultClassificationAlgorithmOperators.CreateProblemInjector();
     31    }
     32   
    2933    protected override IOperator CreatePostProcessingOperator() {
    3034      return DefaultClassificationAlgorithmOperators.CreatePostProcessingOperator();
     35    }
     36
     37    protected override IAnalyzerModel CreateGPModel() {
     38      IAnalyzerModel model = base.CreateGPModel();
     39      DefaultClassificationAlgorithmOperators.SetModelData(model, Engine.GlobalScope.SubScopes[0]);
     40      return model;
    3141    }
    3242  }
Note: See TracChangeset for help on using the changeset viewer.