Changeset 12612 for trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Transformations/LogarithmicTransformation.cs
- Timestamp:
- 07/06/15 15:58:16 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Transformations/LogarithmicTransformation.cs
r11114 r12612 9 9 10 10 namespace HeuristicLab.Problems.DataAnalysis { 11 [StorableClass] 11 12 [Item("Logarithmic Transformation", "f(x) = log(x, b) | Represents a logarithmic transformation.")] 12 13 public class LogarithmicTransformation : Transformation<double> { … … 43 44 44 45 public override IEnumerable<double> Apply(IEnumerable<double> data) { 45 foreach (double i in data) { 46 if (i > 0.0) 47 yield return Math.Log(i, Base); 48 else 49 yield return i; 50 } 46 var b = Base; 47 return data.Select(d => d > 0.0 ? Math.Log(d, b) : d); 51 48 } 52 49
Note: See TracChangeset
for help on using the changeset viewer.