- Timestamp:
- 03/19/11 02:22:45 (14 years ago)
- 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 35 35 private const string DatasetParameterName = "Dataset"; 36 36 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"; 41 39 42 40 #region parameter properites … … 47 45 get { return (IFixedValueParameter<ICheckedItemList<StringValue>>)Parameters[InputVariablesParameterName]; } 48 46 } 49 public IFixedValueParameter<Int Value> TrainingPartitionStartParameter {50 get { return (IFixedValueParameter<Int Value>)Parameters[TrainingPartitionStartParameterName]; }47 public IFixedValueParameter<IntRange> TrainingPartitionParameter { 48 get { return (IFixedValueParameter<IntRange>)Parameters[TrainingPartitionParameterName]; } 51 49 } 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]; } 60 52 } 61 53 #endregion … … 72 64 } 73 65 74 public Int Value TrainingPartitionStart{75 get { return TrainingPartition StartParameter.Value; }66 public IntRange TrainingPartition { 67 get { return TrainingPartitionParameter.Value; } 76 68 } 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; } 85 71 } 86 72 87 73 public IEnumerable<int> TrainingIndizes { 88 74 get { 89 return Enumerable.Range(TrainingPartition Start.Value, TrainingPartitionEnd.Value - TrainingPartitionStart.Value)90 .Where(i => i >= 0 && i < Dataset.Rows && (i < TestPartition Start.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)); 91 77 } 92 78 } 93 79 public IEnumerable<int> TestIndizes { 94 80 get { 95 return Enumerable.Range(TestPartition Start.Value, TestPartitionEnd.Value - TestPartitionStart.Value)81 return Enumerable.Range(TestPartition.Start, TestPartition.End - TestPartition.Start) 96 82 .Where(i => i >= 0 && i < Dataset.Rows); 97 83 } … … 121 107 Parameters.Add(new FixedValueParameter<Dataset>(DatasetParameterName, "", dataset)); 122 108 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))); 127 111 128 112 ((ValueParameter<Dataset>)DatasetParameter).ReactOnValueToStringChangedAndValueItemImageChanged = false; … … 133 117 DatasetParameter.ValueChanged += new EventHandler(Parameter_ValueChanged); 134 118 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); 139 121 } 140 122 -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisProblemData.cs
r5649 r5759 31 31 IEnumerable<string> AllowedInputVariables { get; } 32 32 33 IntValue TrainingPartitionStart { get; } 34 IntValue TrainingPartitionEnd { get; } 35 IntValue TestPartitionStart { get; } 36 IntValue TestPartitionEnd { get; } 33 IntRange TrainingPartition { get; } 34 IntRange TestPartition { get; } 37 35 38 36 IEnumerable<int> TrainingIndizes { get; } -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/OnlineEvaluators/OnlineLinearScalingParameterCalculator.cs
r5746 r5759 78 78 /// </summary> 79 79 public void Add(double original, double target) { 80 // validity of values is checked in mean c lculator and covariance calculator80 // validity of values is checked in mean calculator and covariance calculator 81 81 targetMeanCalculator.Add(target); 82 82 originalMeanAndVarianceCalculator.Add(original);
Note: See TracChangeset
for help on using the changeset viewer.