Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/19/11 02:22:45 (14 years ago)
Author:
mkommend
Message:

#1418:

  • Worked on IntRange and DoubleRange
  • Updated evaluators, analyzers, problems and problem data to use IntRanges
  • Removed properties to access the value of LookupParameter
  • Corrected files.txt
Location:
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblemData.cs

    r5730 r5759  
    3535    private const string DatasetParameterName = "Dataset";
    3636    private const string InputVariablesParameterName = "InputVariables";
    37     private const string TrainingPartitionStartParameterName = "TrainingPartitionStart";
    38     private const string TrainingPartitionEndParameterName = "TrainingPartitionEnd";
    39     private const string TestPartitionStartParameterName = "TestPartitionStart";
    40     private const string TestPartitionEndParameterName = "TestPartitionEnd";
     37    private const string TrainingPartitionParameterName = "TrainingPartition";
     38    private const string TestPartitionParameterName = "TestPartition";
    4139
    4240    #region parameter properites
     
    4745      get { return (IFixedValueParameter<ICheckedItemList<StringValue>>)Parameters[InputVariablesParameterName]; }
    4846    }
    49     public IFixedValueParameter<IntValue> TrainingPartitionStartParameter {
    50       get { return (IFixedValueParameter<IntValue>)Parameters[TrainingPartitionStartParameterName]; }
     47    public IFixedValueParameter<IntRange> TrainingPartitionParameter {
     48      get { return (IFixedValueParameter<IntRange>)Parameters[TrainingPartitionParameterName]; }
    5149    }
    52     public IFixedValueParameter<IntValue> TrainingPartitionEndParameter {
    53       get { return (IFixedValueParameter<IntValue>)Parameters[TrainingPartitionEndParameterName]; }
    54     }
    55     public IFixedValueParameter<IntValue> TestPartitionStartParameter {
    56       get { return (IFixedValueParameter<IntValue>)Parameters[TestPartitionStartParameterName]; }
    57     }
    58     public IFixedValueParameter<IntValue> TestPartitionEndParameter {
    59       get { return (IFixedValueParameter<IntValue>)Parameters[TestPartitionEndParameterName]; }
     50    public IFixedValueParameter<IntRange> TestPartitionParameter {
     51      get { return (IFixedValueParameter<IntRange>)Parameters[TestPartitionParameterName]; }
    6052    }
    6153    #endregion
     
    7264    }
    7365
    74     public IntValue TrainingPartitionStart {
    75       get { return TrainingPartitionStartParameter.Value; }
     66    public IntRange TrainingPartition {
     67      get { return TrainingPartitionParameter.Value; }
    7668    }
    77     public IntValue TrainingPartitionEnd {
    78       get { return TrainingPartitionEndParameter.Value; }
    79     }
    80     public IntValue TestPartitionStart {
    81       get { return TestPartitionStartParameter.Value; }
    82     }
    83     public IntValue TestPartitionEnd {
    84       get { return TestPartitionEndParameter.Value; }
     69    public IntRange TestPartition {
     70      get { return TestPartitionParameter.Value; }
    8571    }
    8672
    8773    public IEnumerable<int> TrainingIndizes {
    8874      get {
    89         return Enumerable.Range(TrainingPartitionStart.Value, TrainingPartitionEnd.Value - TrainingPartitionStart.Value)
    90                          .Where(i => i >= 0 && i < Dataset.Rows && (i < TestPartitionStart.Value || TestPartitionEnd.Value <= i));
     75        return Enumerable.Range(TrainingPartition.Start, TrainingPartition.End - TrainingPartition.Start)
     76                         .Where(i => i >= 0 && i < Dataset.Rows && (i < TestPartition.Start || TestPartition.End <= i));
    9177      }
    9278    }
    9379    public IEnumerable<int> TestIndizes {
    9480      get {
    95         return Enumerable.Range(TestPartitionStart.Value, TestPartitionEnd.Value - TestPartitionStart.Value)
     81        return Enumerable.Range(TestPartition.Start, TestPartition.End - TestPartition.Start)
    9682           .Where(i => i >= 0 && i < Dataset.Rows);
    9783      }
     
    121107      Parameters.Add(new FixedValueParameter<Dataset>(DatasetParameterName, "", dataset));
    122108      Parameters.Add(new FixedValueParameter<ICheckedItemList<StringValue>>(InputVariablesParameterName, "", inputVariables.AsReadOnly()));
    123       Parameters.Add(new FixedValueParameter<IntValue>(TrainingPartitionStartParameterName, "", new IntValue(trainingPartitionStart)));
    124       Parameters.Add(new FixedValueParameter<IntValue>(TrainingPartitionEndParameterName, "", new IntValue(trainingPartitionEnd)));
    125       Parameters.Add(new FixedValueParameter<IntValue>(TestPartitionStartParameterName, "", new IntValue(testPartitionStart)));
    126       Parameters.Add(new FixedValueParameter<IntValue>(TestPartitionEndParameterName, "", new IntValue(testPartitionEnd)));
     109      Parameters.Add(new FixedValueParameter<IntRange>(TrainingPartitionParameterName, "", new IntRange(trainingPartitionStart, trainingPartitionEnd)));
     110      Parameters.Add(new FixedValueParameter<IntRange>(TestPartitionParameterName, "", new IntRange(testPartitionStart, testPartitionEnd)));
    127111
    128112      ((ValueParameter<Dataset>)DatasetParameter).ReactOnValueToStringChangedAndValueItemImageChanged = false;
     
    133117      DatasetParameter.ValueChanged += new EventHandler(Parameter_ValueChanged);
    134118      InputVariables.CheckedItemsChanged += new CollectionItemsChangedEventHandler<IndexedItem<StringValue>>(InputVariables_CheckedItemsChanged);
    135       TrainingPartitionStart.ValueChanged += new EventHandler(Parameter_ValueChanged);
    136       TrainingPartitionEnd.ValueChanged += new EventHandler(Parameter_ValueChanged);
    137       TestPartitionStart.ValueChanged += new EventHandler(Parameter_ValueChanged);
    138       TestPartitionEnd.ValueChanged += new EventHandler(Parameter_ValueChanged);
     119      TrainingPartition.ValueChanged += new EventHandler(Parameter_ValueChanged);
     120      TestPartition.ValueChanged += new EventHandler(Parameter_ValueChanged);
    139121    }
    140122
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisProblemData.cs

    r5649 r5759  
    3131    IEnumerable<string> AllowedInputVariables { get; }
    3232
    33     IntValue TrainingPartitionStart { get; }
    34     IntValue TrainingPartitionEnd { get; }
    35     IntValue TestPartitionStart { get; }
    36     IntValue TestPartitionEnd { get; }
     33    IntRange TrainingPartition { get; }
     34    IntRange TestPartition { get; }
    3735
    3836    IEnumerable<int> TrainingIndizes { get; }
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/OnlineEvaluators/OnlineLinearScalingParameterCalculator.cs

    r5746 r5759  
    7878    /// </summary>
    7979    public void Add(double original, double target) {
    80       // validity of values is checked in mean clculator and covariance calculator
     80      // validity of values is checked in mean calculator and covariance calculator
    8181      targetMeanCalculator.Add(target);
    8282      originalMeanAndVarianceCalculator.Add(original);
Note: See TracChangeset for help on using the changeset viewer.