Changeset 4326
- Timestamp:
- 08/26/10 12:43:02 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/OverfittingAnalyzer.cs
r4309 r4326 104 104 get { return (ILookupParameter<DoubleValue>)Parameters["TrainingValidationCorrelation"]; } 105 105 } 106 public IValueLookupParameter<DoubleValue> CorrelationLimitParameter { 107 get { return (IValueLookupParameter<DoubleValue>)Parameters["CorrelationLimit"]; } 106 public IValueLookupParameter<DoubleValue> LowerCorrelationLimitParameter { 107 get { return (IValueLookupParameter<DoubleValue>)Parameters["LowerCorrelationLimit"]; } 108 } 109 public IValueLookupParameter<DoubleValue> UpperCorrelationLimitParameter { 110 get { return (IValueLookupParameter<DoubleValue>)Parameters["UpperCorrelationLimit"]; } 108 111 } 109 112 public ILookupParameter<BoolValue> OverfittingParameter { … … 179 182 //Parameters.Add(new ValueLookupParameter<PercentValue>("RelativeValidationQualityLowerLimit", new PercentValue(-0.05))); 180 183 Parameters.Add(new LookupParameter<DoubleValue>("TrainingValidationCorrelation")); 181 Parameters.Add(new ValueLookupParameter<DoubleValue>("CorrelationLimit", new DoubleValue(0.65))); 184 Parameters.Add(new ValueLookupParameter<DoubleValue>("LowerCorrelationLimit", new DoubleValue(0.65))); 185 Parameters.Add(new ValueLookupParameter<DoubleValue>("UpperCorrelationLimit", new DoubleValue(0.75))); 182 186 Parameters.Add(new LookupParameter<BoolValue>("Overfitting")); 183 187 Parameters.Add(new LookupParameter<ResultCollection>("Results")); … … 211 215 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("ValidationQuality")); 212 216 } 217 if (!Parameters.ContainsKey("LowerCorrelationLimit")) { 218 Parameters.Add(new ValueLookupParameter<DoubleValue>("LowerCorrelationLimit", new DoubleValue(0.65))); 219 } 220 if (!Parameters.ContainsKey("UpperCorrelationLimit")) { 221 Parameters.Add(new ValueLookupParameter<DoubleValue>("UpperCorrelationLimit", new DoubleValue(0.75))); 222 } 223 213 224 } 214 225 … … 218 229 ItemArray<DoubleValue> validationQualities = ValidationQualityParameter.ActualValue; 219 230 231 double correlationLimit; 232 if (OverfittingParameter.ActualValue != null && OverfittingParameter.ActualValue.Value) { 233 // if is already overfitting have to reach the upper limit to switch back to non-overfitting state 234 correlationLimit = UpperCorrelationLimitParameter.ActualValue.Value; 235 } else { 236 // if currently in non-overfitting state have to reach to lower limit to switch to overfitting state 237 correlationLimit = LowerCorrelationLimitParameter.ActualValue.Value; 238 } 220 239 //string targetVariable = ProblemData.TargetVariable.Value; 221 240 … … 262 281 // best first (only for maximization 263 282 var orderedDistinctPairs = (from index in Enumerable.Range(0, qualities.Length) 283 where qualities[index].Value > 0.0 264 284 select new { Training = qualities[index].Value, Validation = validationQualities[index].Value }) 265 285 .OrderBy(x => -x.Training) … … 285 305 avgTrainingQuality > InitialTrainingQualityParameter.ActualValue.Value && // better on training than in initial generation 286 306 // RelativeValidationQualityParameter.ActualValue.Value < 0.0 && // validation quality is worse than training quality 287 r < CorrelationLimitParameter.ActualValue.Value; // low correlation between training and validation quality307 r < correlationLimit; 288 308 289 309
Note: See TracChangeset
for help on using the changeset viewer.