Changeset 7615 for branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Evaluators/SymbolicDataAnalysisEvaluator.cs
- Timestamp:
- 03/15/12 09:11:17 (13 years ago)
- Location:
- branches/HeuristicLab.TimeSeries
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.TimeSeries
-
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Evaluators/SymbolicDataAnalysisEvaluator.cs
r7268 r7615 44 44 private const string EvaluationPartitionParameterName = "EvaluationPartition"; 45 45 private const string RelativeNumberOfEvaluatedSamplesParameterName = "RelativeNumberOfEvaluatedSamples"; 46 private const string ValidRowIndicatorParameterName = "ValidRowIndicator"; 46 47 47 48 public override bool CanChangeName { get { return false; } } … … 70 71 get { return (IValueLookupParameter<PercentValue>)Parameters[RelativeNumberOfEvaluatedSamplesParameterName]; } 71 72 } 73 public IValueLookupParameter<StringValue> ValidRowIndicatorParameter { 74 get { return (IValueLookupParameter<StringValue>)Parameters[ValidRowIndicatorParameterName]; } 75 } 72 76 #endregion 73 77 … … 87 91 Parameters.Add(new ValueLookupParameter<DoubleLimit>(EstimationLimitsParameterName, "The upper and lower limit that should be used as cut off value for the output values of symbolic data analysis trees.")); 88 92 Parameters.Add(new ValueLookupParameter<PercentValue>(RelativeNumberOfEvaluatedSamplesParameterName, "The relative number of samples of the dataset partition, which should be randomly chosen for evaluation between the start and end index.")); 93 Parameters.Add(new ValueLookupParameter<StringValue>(ValidRowIndicatorParameterName, "An indicator variable in the data set that specifies which rows should be evaluated (those for which the indicator <> 0) (optional).")); 94 } 95 96 [StorableHook(HookType.AfterDeserialization)] 97 private void AfterDeserialization() { 98 if(!Parameters.ContainsKey(ValidRowIndicatorParameterName)) 99 Parameters.Add(new ValueLookupParameter<StringValue>(ValidRowIndicatorParameterName, "An indicator variable in the data set that specifies which rows should be evaluated (those for which the indicator <> 0) (optional).")); 89 100 } 90 101 … … 93 104 } 94 105 95 protected IEnumerable<int> GenerateRowsToEvaluate(double percentageOfRows) {96 106 protected IEnumerable<int> GenerateRowsToEvaluate(double percentageOfRows) 107 { 97 108 98 109 IEnumerable<int> rows; … … 113 124 } 114 125 115 return rows.Where(i => i < testPartitionStart || testPartitionEnd <= i); 126 rows = rows.Where(i => i < testPartitionStart || testPartitionEnd <= i); 127 128 if(ValidRowIndicatorParameter.ActualValue != null) 129 { 130 string indicatorVar = ValidRowIndicatorParameter.ActualValue.Value; 131 var problemData = ProblemDataParameter.ActualValue; 132 var indicatorRow = problemData.Dataset.GetReadOnlyDoubleValues(indicatorVar); 133 rows = rows.Where(r=>!indicatorRow[r].IsAlmost(0.0)); 134 } 135 return rows; 116 136 } 117 137 }
Note: See TracChangeset
for help on using the changeset viewer.