Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/23/13 13:31:29 (11 years ago)
Author:
sforsten
Message:

#1980:

  • several small bug fixes
  • added windowing technique ILAS to GAssist
  • GAssist and XCS work now with real-valued features
  • severely improved the performance of XCS
Location:
branches/LearningClassifierSystems/HeuristicLab.Encodings.DecisionList/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/LearningClassifierSystems/HeuristicLab.Encodings.DecisionList/3.3

    • Property svn:ignore
      •  

        old new  
        11*.user
        22Plugin.cs
         3obj
  • branches/LearningClassifierSystems/HeuristicLab.Encodings.DecisionList/3.3/DecisionListSolution.cs

    r9334 r9392  
    2727using HeuristicLab.Data;
    2828using HeuristicLab.Optimization;
     29using HeuristicLab.Optimization.Operators.LCS;
    2930using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3031
     
    3839    private const string TestAccuracyResultName = "Accuracy (test)";
    3940    private const string TrainingNumberOfAliveRulesName = "Number of alive rules (training)";
     41    private const string TrainingAliveRulesName = "Alive Rules (training)";
    4042    //private const string TestNumberOfAliveRules = "Number of alive rules (test)";
    4143    private const string TrainingTheoryLengthName = "Theory Length (training)";
     
    5456      private set { ((IntValue)this[TrainingNumberOfAliveRulesName].Value).Value = value; }
    5557    }
     58    public ItemSet<Rule> TrainingAliveRules {
     59      get { return (ItemSet<Rule>)this[TrainingAliveRulesName].Value; }
     60      private set { this[TrainingAliveRulesName].Value = value; }
     61    }
    5662    public double TrainingTheoryLength {
    5763      get { return ((DoubleValue)this[TrainingTheoryLengthName].Value).Value; }
     
    6167      get { return ((DoubleValue)this[TrainingExceptionsLengthName].Value).Value; }
    6268      private set { ((DoubleValue)this[TrainingExceptionsLengthName].Value).Value = value; }
     69    }
     70
     71    public int Classes {
     72      get { return ProblemData.Classes; }
    6373    }
    6474
     
    7989    }
    8090
    81     public IDecisionListClassificationProblemData ProblemData {
    82       get { return (IDecisionListClassificationProblemData)this[ProblemDataResultName].Value; }
     91    public IGAssistNichesProblemData ProblemData {
     92      get { return (IGAssistNichesProblemData)this[ProblemDataResultName].Value; }
    8393      set {
    8494        if (this[ProblemDataResultName].Value != value) {
     
    100110      description = original.Description;
    101111    }
    102     public DecisionListSolution(DecisionList model, IDecisionListClassificationProblemData problemData)
     112    public DecisionListSolution(DecisionList model, IGAssistNichesProblemData problemData)
    103113      : base() {
    104114      name = ItemName;
     
    109119      Add(new Result(TestAccuracyResultName, "Accuracy of the model on the test partition (percentage of correctly classified instances).", new PercentValue()));
    110120      Add(new Result(TrainingNumberOfAliveRulesName, "", new IntValue()));
     121      Add(new Result(TrainingAliveRulesName, "", new ItemSet<Rule>()));
    111122      Add(new Result(TrainingTheoryLengthName, "", new DoubleValue()));
    112123      Add(new Result(TrainingExceptionsLengthName, "", new DoubleValue()));
     
    123134      var originalTrainingCondition = ProblemData.FetchInput(ProblemData.TrainingIndices);
    124135      var originalTestCondition = ProblemData.FetchInput(ProblemData.TestIndices);
    125       int numberOfAliveRules;
     136      ItemSet<Rule> aliveRules;
    126137      double theoryLength;
    127       var estimatedTraining = Model.Evaluate(originalTrainingCondition, out numberOfAliveRules, out theoryLength);
    128       TrainingNumberOfAliveRules = numberOfAliveRules;
     138      var estimatedTraining = Model.Evaluate(originalTrainingCondition, out aliveRules, out theoryLength);
     139      TrainingNumberOfAliveRules = aliveRules.Count;
     140      TrainingAliveRules = aliveRules;
    129141      TrainingTheoryLength = theoryLength;
    130142      var estimatedTest = Model.Evaluate(originalTestCondition);
     
    139151    }
    140152
    141     private double CalculateAccuracy(IEnumerable<IAction> original, IEnumerable<IAction> estimated) {
     153    public static double CalculateAccuracy(IEnumerable<IGAssistNiche> original, IEnumerable<IGAssistNiche> estimated) {
    142154      double correctClassified = 0;
    143155
     
    147159
    148160      while (originalEnumerator.MoveNext() && estimatedActionEnumerator.MoveNext()) {
    149         if (originalEnumerator.Current.Match(estimatedActionEnumerator.Current)) {
     161        if (originalEnumerator.Current != null && estimatedActionEnumerator.Current != null
     162          && originalEnumerator.Current.SameNiche(estimatedActionEnumerator.Current)) {
    150163          correctClassified++;
    151164        }
Note: See TracChangeset for help on using the changeset viewer.