Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/19/11 11:12:25 (13 years ago)
Author:
mkommend
Message:

#1592: Implemented new estimated class values view for ClassificationEnsembleSolutions.

Location:
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationEnsembleProblemData.cs

    r6666 r6672  
    2121
    2222using System.Collections.Generic;
    23 using System.Linq;
    2423using HeuristicLab.Common;
    2524using HeuristicLab.Core;
     
    3332  public class ClassificationEnsembleProblemData : ClassificationProblemData {
    3433
    35     public override IEnumerable<int> TrainingIndizes {
    36       get { return Enumerable.Range(TrainingPartition.Start, TrainingPartition.End - TrainingPartition.Start); }
    37     }
    38     public override IEnumerable<int> TestIndizes {
    39       get { return Enumerable.Range(TestPartition.Start, TestPartition.End - TestPartition.Start); }
     34    public override bool IsTrainingSample(int index) {
     35      return index >= 0 && index < Dataset.Rows &&
     36             TrainingPartition.Start <= index && index < TrainingPartition.End;
    4037    }
    4138
    42     private static ClassificationEnsembleProblemData emptyProblemData;
     39    public override bool IsTestSample(int index) {
     40      return index >= 0 && index < Dataset.Rows &&
     41             TestPartition.Start <= index && index < TestPartition.End;
     42    }
     43
     44    private static readonly ClassificationEnsembleProblemData emptyProblemData;
    4345    public static ClassificationEnsembleProblemData EmptyProblemData {
    4446      get { return emptyProblemData; }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblemData.cs

    r6666 r6672  
    171171     {1176881,7,5,3,7,4,10,7,5,5,4        }
    172172};
    173     private static Dataset defaultDataset;
    174     private static IEnumerable<string> defaultAllowedInputVariables;
    175     private static string defaultTargetVariable;
    176 
    177     private static ClassificationProblemData emptyProblemData;
     173    private static readonly Dataset defaultDataset;
     174    private static readonly IEnumerable<string> defaultAllowedInputVariables;
     175    private static readonly string defaultTargetVariable;
     176
     177    private static readonly ClassificationProblemData emptyProblemData;
    178178    public static ClassificationProblemData EmptyProblemData {
    179179      get { return EmptyProblemData; }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblemData.cs

    r6666 r6672  
    7878      get {
    7979        return Enumerable.Range(TrainingPartition.Start, TrainingPartition.End - TrainingPartition.Start)
    80                          .Where(i => i >= 0 && i < Dataset.Rows && (i < TestPartition.Start || TestPartition.End <= i));
     80                         .Where(IsTrainingSample);
    8181      }
    8282    }
     
    8484      get {
    8585        return Enumerable.Range(TestPartition.Start, TestPartition.End - TestPartition.Start)
    86            .Where(i => i >= 0 && i < Dataset.Rows);
     86           .Where(IsTestSample);
    8787      }
     88    }
     89
     90    public virtual bool IsTrainingSample(int index) {
     91      return index >= 0 && index < Dataset.Rows &&
     92        TrainingPartition.Start <= index && index < TrainingPartition.End &&
     93        (index < TestPartition.Start || TestPartition.End <= index);
     94    }
     95
     96    public virtual bool IsTestSample(int index) {
     97      return index >= 0 && index < Dataset.Rows &&
     98             TestPartition.Start <= index && index < TestPartition.End;
    8899    }
    89100    #endregion
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleProblemData.cs

    r6666 r6672  
    2121
    2222using System.Collections.Generic;
    23 using System.Linq;
    2423using HeuristicLab.Common;
    2524using HeuristicLab.Core;
     
    3332  public sealed class RegressionEnsembleProblemData : RegressionProblemData {
    3433
    35     public override IEnumerable<int> TrainingIndizes {
    36       get {
    37         return Enumerable.Range(TrainingPartition.Start, TrainingPartition.End - TrainingPartition.Start);
    38       }
     34    public override bool IsTrainingSample(int index) {
     35      return index >= 0 && index < Dataset.Rows &&
     36             TrainingPartition.Start <= index && index < TrainingPartition.End;
    3937    }
    4038
    41     public override IEnumerable<int> TestIndizes {
    42       get {
    43         return Enumerable.Range(TestPartition.Start, TestPartition.End - TestPartition.Start);
    44       }
     39    public override bool IsTestSample(int index) {
     40      return index >= 0 && index < Dataset.Rows &&
     41             TestPartition.Start <= index && index < TestPartition.End;
    4542    }
    4643
    47     private static RegressionEnsembleProblemData emptyProblemData;
     44    private static readonly RegressionEnsembleProblemData emptyProblemData;
    4845    public new static RegressionEnsembleProblemData EmptyProblemData {
    4946      get { return emptyProblemData; }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs

    r6666 r6672  
    6464          {0.83763905,  0.468046718}
    6565    };
    66     private static Dataset defaultDataset;
    67     private static IEnumerable<string> defaultAllowedInputVariables;
    68     private static string defaultTargetVariable;
     66    private static readonly Dataset defaultDataset;
     67    private static readonly IEnumerable<string> defaultAllowedInputVariables;
     68    private static readonly string defaultTargetVariable;
    6969
    70     private static RegressionProblemData emptyProblemData;
     70    private static readonly RegressionProblemData emptyProblemData;
    7171    public static RegressionProblemData EmptyProblemData {
    7272      get { return emptyProblemData; }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisProblemData.cs

    r6666 r6672  
    3939    IEnumerable<int> TestIndizes { get; }
    4040
     41    bool IsTrainingSample(int index);
     42    bool IsTestSample(int index);
     43
    4144    event EventHandler Changed;
    4245  }
Note: See TracChangeset for help on using the changeset viewer.