- Timestamp:
- 03/05/14 14:11:06 (11 years ago)
- Location:
- branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/StatisticsLogic.cs
r10534 r10537 97 97 98 98 return preprocessingData.GetValues<T>(columnIndex) 99 100 99 .GroupBy(x => x) 101 100 .OrderByDescending(g => g.Count()) -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/TransformationLogic.cs
r10249 r10537 1 1 2 using System; 2 3 namespace HeuristicLab.DataPreprocessing { 4 3 5 public class TransformationLogic : ITransformationLogic { 6 7 private readonly IPreprocessingData preprocessingData; 8 private readonly ISearchLogic searchLogic; 9 private readonly IStatisticsLogic statisticsLogic; 10 11 public TransformationLogic(IPreprocessingData thePreprocessingData, ISearchLogic theSearchLogic, IStatisticsLogic theStatisticsLogic) { 12 preprocessingData = thePreprocessingData; 13 searchLogic = theSearchLogic; 14 statisticsLogic = theStatisticsLogic; 15 } 16 17 public void deleteRowsWithMissingValuesGreater(double percent) { 18 for (int i = 0; i < preprocessingData.Rows; ++i) { 19 int missingCount = statisticsLogic.GetRowMissingValueCount(i); 20 if (100f / preprocessingData.Columns * missingCount >= percent) { 21 preprocessingData.DeleteRow(i); 22 --i; 23 } 24 } 25 } 26 27 public void deleteColumnsWithMissingValuesGreater(float percent) { 28 for (int i = 0; i < preprocessingData.Columns; ++i) { 29 int missingCount = statisticsLogic.GetMissingValueCount(i); 30 if (100f / preprocessingData.Columns * missingCount >= percent) { 31 preprocessingData.DeleteColumn(i); 32 --i; 33 } 34 } 35 } 36 37 public void deleteColumnsWithVarianceSmaller(double variance) { 38 for (int i = 0; i < preprocessingData.Columns; ++i) { 39 if (preprocessingData.IsType<double>(i) || preprocessingData.IsType<DateTime>(i)) { 40 double columnVariance = statisticsLogic.GetVariance(i); 41 if (columnVariance < variance) { 42 preprocessingData.DeleteColumn(i); 43 --i; 44 } 45 } 46 } 47 } 48 4 49 } 5 50 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/ITransformationLogic.cs
r10244 r10537 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace HeuristicLab.DataPreprocessing 7 { 8 public interface ITransformationLogic 9 { 1 2 namespace HeuristicLab.DataPreprocessing { 3 public interface ITransformationLogic { 4 void deleteRowsWithMissingValuesGreater(double percent); 5 void deleteColumnsWithMissingValuesGreater(float percent); 6 void deleteColumnsWithVarianceSmaller(double variance); 10 7 } 11 8 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Views/DataPreprocessingView.cs
r10383 r10537 46 46 ISearchLogic searchLogic = new SearchLogic(data); 47 47 var dataGridLogic = new DataGridLogic(data); 48 dataGridContent = new DataGridContent(dataGridLogic, new ManipulationLogic(data, searchLogic, new StatisticsLogic(data, searchLogic))); 49 statisticsContent = new StatisticsContent(new StatisticsLogic(data, searchLogic)); 48 StatisticsLogic statisticsLogic = new StatisticsLogic(data, searchLogic); 49 dataGridContent = new DataGridContent(dataGridLogic, new ManipulationLogic(data, searchLogic, statisticsLogic)); 50 statisticsContent = new StatisticsContent(statisticsLogic); 50 51 filterContent = new FilterContent(new FilterLogic()); 51 tranformationContent = new TransformationContent(new TransformationLogic( ));52 tranformationContent = new TransformationContent(new TransformationLogic(data, searchLogic, statisticsLogic)); 52 53 lineChartContent = new LineChartContent(new LineChartLogic(data)); 53 54 histogramContent = new HistogramContent(new HistogramLogic());
Note: See TracChangeset
for help on using the changeset viewer.