- Timestamp:
- 10/11/12 17:48:27 (12 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic
- Property svn:mergeinfo changed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Evaluators/SymbolicDataAnalysisEvaluator.cs
r8664 r8798 45 45 private const string RelativeNumberOfEvaluatedSamplesParameterName = "RelativeNumberOfEvaluatedSamples"; 46 46 private const string ApplyLinearScalingParameterName = "ApplyLinearScaling"; 47 private const string ValidRowIndicatorParameterName = "ValidRowIndicator"; 47 48 48 49 public override bool CanChangeName { get { return false; } } … … 74 75 get { return (ILookupParameter<BoolValue>)Parameters[ApplyLinearScalingParameterName]; } 75 76 } 77 public IValueLookupParameter<StringValue> ValidRowIndicatorParameter { 78 get { return (IValueLookupParameter<StringValue>)Parameters[ValidRowIndicatorParameterName]; } 79 } 76 80 #endregion 77 81 … … 92 96 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 97 Parameters.Add(new LookupParameter<BoolValue>(ApplyLinearScalingParameterName, "Flag that indicates if the individual should be linearly scaled before evaluating.")); 98 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 99 } 95 100 … … 100 105 if (!Parameters.ContainsKey(ApplyLinearScalingParameterName)) 101 106 Parameters.Add(new LookupParameter<BoolValue>(ApplyLinearScalingParameterName, "Flag that indicates if the individual should be linearly scaled before evaluating.")); 107 if (!Parameters.ContainsKey(ValidRowIndicatorParameterName)) 108 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).")); 102 109 } 103 110 … … 112 119 int testPartitionStart = ProblemDataParameter.ActualValue.TestPartition.Start; 113 120 int testPartitionEnd = ProblemDataParameter.ActualValue.TestPartition.End; 114 115 121 if (samplesEnd < samplesStart) throw new ArgumentException("Start value is larger than end value."); 116 122 … … 124 130 } 125 131 126 return rows.Where(i => i < testPartitionStart || testPartitionEnd <= i); 132 rows = rows.Where(i => i < testPartitionStart || testPartitionEnd <= i); 133 if (ValidRowIndicatorParameter.ActualValue != null) { 134 string indicatorVar = ValidRowIndicatorParameter.ActualValue.Value; 135 var problemData = ProblemDataParameter.ActualValue; 136 var indicatorRow = problemData.Dataset.GetReadOnlyDoubleValues(indicatorVar); 137 rows = rows.Where(r => !indicatorRow[r].IsAlmost(0.0)); 138 } 139 return rows; 127 140 } 128 141
Note: See TracChangeset
for help on using the changeset viewer.