Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/15/13 11:18:06 (12 years ago)
Author:
sforsten
Message:

#1980:

  • added training and test partition to ConditionActionClassificationProblemData
  • ClassifierFetcher only uses training partition
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/Reinforcement/ClassifierFetcher.cs

    r9154 r9161  
    2020#endregion
    2121
     22using System.Linq;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
     
    4445    #endregion
    4546
    46     public override IDeepCloneable Clone(Cloner cloner) {
    47       return new ClassifierFetcher(this, cloner);
     47    private IConditionActionProblemData ProblemData {
     48      get { return ProblemDataParameter.ActualValue; }
    4849    }
     50
    4951    protected ClassifierFetcher(ClassifierFetcher original, Cloner cloner)
    5052      : base(original, cloner) {
     
    5860      Parameters.Add(new LookupParameter<IntValue>("Iteration"));
    5961    }
     62    public override IDeepCloneable Clone(Cloner cloner) {
     63      return new ClassifierFetcher(this, cloner);
     64    }
    6065
    6166    public override IOperation Apply() {
    62       Dataset dataset = ProblemDataParameter.ActualValue.Dataset;
    63       int row = IterationParameter.ActualValue.Value % dataset.Rows;
    64       CurrentClassifierToMatchParameter.ActualValue = ProblemDataParameter.ActualValue.FetchClassifier(row);
     67      Dataset dataset = ProblemData.Dataset;
     68      var trainingIndices = ProblemData.TrainingIndices.ToList();
     69      int index = IterationParameter.ActualValue.Value % trainingIndices.Count;
     70      CurrentClassifierToMatchParameter.ActualValue = ProblemDataParameter.ActualValue.FetchClassifier(trainingIndices[index]);
    6571      return base.Apply();
    6672    }
Note: See TracChangeset for help on using the changeset viewer.