Changeset 10908 for branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/ChartLogic.cs
- Timestamp:
- 05/28/14 15:09:26 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/ChartLogic.cs
r10882 r10908 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 3Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 32 32 33 33 public class ChartLogic : IChartLogic { 34 34 private const int MAX_DISTINCT_VALUES_FOR_CLASSIFCATION = 20; 35 35 private ITransactionalPreprocessingData preprocessingData; 36 36 … … 63 63 } 64 64 65 public List<double> GetVariableValues(string variableName) {66 return preprocessingData.GetValues<double>(preprocessingData.GetColumnIndex(variableName)) .ToList();65 public IEnumerable<double> GetVariableValues(string variableName) { 66 return preprocessingData.GetValues<double>(preprocessingData.GetColumnIndex(variableName)); 67 67 } 68 68 … … 74 74 if (preprocessingData.IsType<double>(preprocessingData.GetColumnIndex(variableName))) 75 75 doubleVariableNames.Add(variableName); 76 } 77 78 return doubleVariableNames; 79 } 80 81 public IEnumerable<string> GetVariableNamesForHistogramClassification() { 82 List<string> doubleVariableNames = new List<string>(); 83 84 //only return variable names from type double 85 foreach (string variableName in preprocessingData.VariableNames) 86 { 87 int columnIndex = preprocessingData.GetColumnIndex(variableName); 88 bool isDouble = preprocessingData.IsType<double>(columnIndex); 89 double distinctValueCount = preprocessingData.GetValues<double>(columnIndex).GroupBy(x => x).Count(); 90 bool distinctValuesOk = distinctValueCount <= MAX_DISTINCT_VALUES_FOR_CLASSIFCATION; 91 92 if (isDouble && distinctValuesOk) 93 doubleVariableNames.Add(variableName); 76 94 } 77 95 … … 146 164 147 165 148 List<double> xValues = GetVariableValues(variableNameX) ;149 List<double> yValues = GetVariableValues(variableNameY) ;166 List<double> xValues = GetVariableValues(variableNameX).ToList(); 167 List<double> yValues = GetVariableValues(variableNameY).ToList(); 150 168 151 169 List<Point2D<double>> points = new List<Point2D<double>>();
Note: See TracChangeset
for help on using the changeset viewer.