Changeset 9392 for branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/Discretizer
- Timestamp:
- 04/23/13 13:31:29 (12 years ago)
- Location:
- branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/Discretizer
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/Discretizer/IDiscretizer.cs
r9342 r9392 25 25 namespace HeuristicLab.Optimization.Operators.LCS { 26 26 public interface IDiscretizer : IItem { 27 IEnumerable<double> DiscretizeValues(string attribute, IEnumerable<double> values); 27 28 int NumberOfMicroIntervals(string attribute); 28 29 IEnumerable<double> GetCutPoints(string attribute); -
branches/LearningClassifierSystems/HeuristicLab.Optimization.Operators.LCS/3.3/Discretizer/UniformWidthDiscretizer.cs
r9342 r9392 20 20 #endregion 21 21 22 using System;23 22 using System.Collections.Generic; 24 23 using System.Linq; … … 42 41 protected UniformWidthDiscretizer(UniformWidthDiscretizer original, Cloner cloner) 43 42 : base(original, cloner) { 43 this.bins = original.bins; 44 this.variableMicroItervals = new Dictionary<string, IList<double>>(original.variableMicroItervals); 44 45 } 45 46 public UniformWidthDiscretizer() 46 : base() { 47 bins = 5; 47 : this(5) { 48 48 } 49 49 public UniformWidthDiscretizer(int bins) … … 60 60 } 61 61 62 public IEnumerable<double> discretizeValues(string attribute, IEnumerable<double> values) { 63 if (variableMicroItervals.ContainsKey(attribute)) { 64 throw new ArgumentException("Values of attribute " + attribute + " are already set."); 65 } 66 62 public IEnumerable<double> DiscretizeValues(string attribute, IEnumerable<double> values) { 67 63 double min = values.Min(); 68 64 double max = values.Max();
Note: See TracChangeset
for help on using the changeset viewer.