- Timestamp:
- 05/07/14 15:33:02 (11 years ago)
- Location:
- branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis.Transformations/3.3
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis.Transformations/3.3/LinearTransformation.cs
r10808 r10821 82 82 83 83 public override bool Check(IEnumerable<double> data, out string errorMsg) { 84 StringBuilder sb = new StringBuilder();85 bool success = true;86 84 errorMsg = null; 87 88 85 if (Multiplier == 0.0) { 89 sb.Append(String.Format("Multiplicand is 0, all {0} entries will be set to {1}. Reversal will not be possble", data.Count(), Addend)); 90 errorMsg = sb.ToString(); 91 success = false; 86 errorMsg = String.Format("Multiplicand is 0, all {0} entries will be set to {1}. Inverse apply will not be possible (division by 0).", data.Count(), Addend); 87 return false; 92 88 } 93 return success;89 return true; 94 90 } 95 91 } -
branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis.Transformations/3.3/LogarithmicTransformation.cs
r10808 r10821 1 1 using System; 2 2 using System.Collections.Generic; 3 using System.Linq; 3 4 using System.Text; 4 5 using HeuristicLab.Common; … … 49 50 50 51 public override bool Check(IEnumerable<double> data, out string errorMsg) { 51 StringBuilder sb = new StringBuilder();52 52 errorMsg = null; 53 int errorCounter = 0; 54 55 foreach (double i in data) { 56 if (i <= 0.0) { 57 ++errorCounter; 58 } 59 } 60 53 int errorCounter = data.Count(i => i <= 0.0); 61 54 if (errorCounter > 0) { 62 sb.Append(String.Format("{0} values are zero or below zero. Logarithm can not be applied onto these values", errorCounter)); 63 errorMsg = sb.ToString(); 55 errorMsg = String.Format("{0} values are zero or below zero. Logarithm can not be applied onto these values", errorCounter); 64 56 return false; 65 57 } -
branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis.Transformations/3.3/ReciprocalTransformation.cs
r10808 r10821 2 2 using System; 3 3 using System.Collections.Generic; 4 using System.Linq; 4 5 using System.Text; 5 6 using HeuristicLab.Common; … … 34 35 35 36 public override bool Check(IEnumerable<double> data, out string errorMsg) { 36 StringBuilder sb = new StringBuilder();37 37 errorMsg = null; 38 int errorCounter = 0; 39 40 foreach (double i in data) { 41 if (i <= 0.0) { 42 ++errorCounter; 43 } 44 } 45 38 int errorCounter = data.Count(i => i <= 0.0); 46 39 if (errorCounter > 0) { 47 sb.Append(String.Format("{0} values are zero or below zero. 1/x can not be applied onto these values", errorCounter)); 48 errorMsg = sb.ToString(); 40 errorMsg = String.Format("{0} values are zero or below zero. 1/x can not be applied onto these values", errorCounter); 49 41 return false; 50 42 } -
branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis.Transformations/3.3/StandardDeviationTransformation.cs
r10816 r10821 90 90 errorMsg = "Standard deviaton for the original data is 0.0, Transformation cannot be applied onto these values."; 91 91 return false; 92 } else {93 return true;94 92 } 93 return true; 95 94 } 96 95
Note: See TracChangeset
for help on using the changeset viewer.