- Timestamp:
- 01/22/14 14:33:36 (11 years ago)
- Location:
- branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3
- Files:
-
- 8 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/HeuristicLab.DataPreprocessing-3.3.csproj
r10367 r10369 79 79 <Compile Include="Implementations\DataGridLogic.cs" /> 80 80 <Compile Include="Interfaces\IDataGridLogic.cs" /> 81 <Compile Include="Interfaces\I PreprocessingDataManipulation.cs" />81 <Compile Include="Interfaces\IManipulationLogic.cs" /> 82 82 <Compile Include="Implementations\FilterContent.cs" /> 83 83 <Compile Include="Implementations\DataPreprocessorStarter.cs" /> … … 135 135 <Compile Include="Implementations\PreprocessingContext.cs" /> 136 136 <Compile Include="Implementations\PreprocessingData.cs" /> 137 <Compile Include="Implementations\ PreprocessingDataManipulation.cs" />137 <Compile Include="Implementations\ManipulationLogic.cs" /> 138 138 <Compile Include="Implementations\SearchLogic.cs" /> 139 139 <Compile Include="Implementations\StatisticsLogic.cs" /> -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/DataGridContent.cs
r10313 r10369 11 11 12 12 private readonly IDataGridLogic dataGridLogic; 13 private readonly I PreprocessingDataManipulationpreprocessingDataManipulation;14 public DataGridContent(IDataGridLogic theDataGridLogic, I PreprocessingDataManipulationthePreprocessingDataManipulation) {13 private readonly IManipulationLogic preprocessingDataManipulation; 14 public DataGridContent(IDataGridLogic theDataGridLogic, IManipulationLogic thePreprocessingDataManipulation) { 15 15 dataGridLogic = theDataGridLogic; 16 16 preprocessingDataManipulation = thePreprocessingDataManipulation; … … 21 21 } 22 22 23 public I PreprocessingDataManipulationPreprocessingDataManipulation {23 public IManipulationLogic PreprocessingDataManipulation { 24 24 get { return preprocessingDataManipulation; } 25 25 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/ManipulationLogic.cs
r10367 r10369 5 5 6 6 namespace HeuristicLab.DataPreprocessing { 7 public class PreprocessingDataManipulation : IPreprocessingDataManipulation{7 public class ManipulationLogic : IManipulationLogic { 8 8 private IPreprocessingData preprocessingData; 9 9 private IStatisticsLogic statisticInfo; 10 10 private ISearchLogic searchLogic; 11 11 12 public PreprocessingDataManipulation(IPreprocessingData _prepocessingData, ISearchLogic theSearchLogic, IStatisticsLogic theStatisticsLogic) {12 public ManipulationLogic(IPreprocessingData _prepocessingData, ISearchLogic theSearchLogic, IStatisticsLogic theStatisticsLogic) { 13 13 preprocessingData = _prepocessingData; 14 14 searchLogic = theSearchLogic; -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/StatisticsLogic.cs
r10367 r10369 25 25 public int GetNumericColumnCount() { 26 26 int count = 0; 27 foreach (var variableName in preprocessingData.VariableNames) { 28 if (preprocessingData.IsType<double>(variableName)) { 27 28 for (int i = 0; i < preprocessingData.Columns; ++i) { 29 if (preprocessingData.IsType<double>(i)) { 29 30 ++count; 30 31 } … … 39 40 public int GetMissingValueCount() { 40 41 int count = 0; 41 for (int i = 0; i < preprocessingData.Columns; ++i){42 for (int i = 0; i < preprocessingData.Columns; ++i) { 42 43 count += GetMissingValueCount(i); 43 44 } … … 104 105 public int GetRowMissingValueCount(int rowIndex) { 105 106 int count = 0; 106 for(int i = 0; i < preprocessingData.Columns; ++i){107 for (int i = 0; i < preprocessingData.Columns; ++i) { 107 108 if (searchLogic.IsMissingValue(i, rowIndex)) { 108 109 ++count; -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IDataGridContent.cs
r10253 r10369 8 8 public interface IDataGridContent : IStringConvertibleMatrix { 9 9 IDataGridLogic DataGridLogic { get; } 10 I PreprocessingDataManipulationPreprocessingDataManipulation { get; }10 IManipulationLogic PreprocessingDataManipulation { get; } 11 11 } 12 12 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IDataGridLogic.cs
r10367 r10369 3 3 public interface IDataGridLogic { 4 4 IEnumerable<string> ColumnNames { get; } 5 string GetColumnTypeAsString(int columnIndex);6 5 IEnumerable<string> RowNames { get; } 7 6 int Columns { get; } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IManipulationLogic.cs
r10367 r10369 2 2 using System.Collections.Generic; 3 3 namespace HeuristicLab.DataPreprocessing { 4 public interface I PreprocessingDataManipulation{4 public interface IManipulationLogic { 5 5 void reOrderToIndices(IEnumerable<int> indices); 6 6 void reOrderToIndices(IList<Tuple<int, int>> indices); -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IStatisticsLogic.cs
r10367 r10369 19 19 double GetVariance(int columnIndex); 20 20 int GetDifferentValuesCount<T>(int columnIndex); 21 21 22 bool IsType<T>(int columnIndex); 23 string GetColumnTypeAsString(int columnIndex); 22 24 } 23 25 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Views/DataPreprocessingView.cs
r10367 r10369 46 46 ISearchLogic searchLogic = new SearchLogic(data); 47 47 var dataGridLogic = new DataGridLogic(data); 48 dataGridContent = new DataGridContent(dataGridLogic, new PreprocessingDataManipulation(data, searchLogic, new StatisticsLogic(data, searchLogic)));48 dataGridContent = new DataGridContent(dataGridLogic, new ManipulationLogic(data, searchLogic, new StatisticsLogic(data, searchLogic))); 49 49 statisticsContent = new StatisticsContent(new StatisticsLogic(data, searchLogic), dataGridLogic); 50 50 filterContent = new FilterContent(new FilterLogic()); -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Views/StatisticsView.cs
r10320 r10369 1 using System.Windows.Forms; 1 using System; 2 using System.Collections.Generic; 3 using System.Windows.Forms; 2 4 using HeuristicLab.Core.Views; 3 5 using HeuristicLab.MainForm; … … 9 11 [Content(typeof(StatisticsContent), false)] 10 12 public partial class StatisticsView : ItemView { 13 14 private List<List<string>> columnsRowsMatrix; 15 private readonly int COLUMNS = 5; 11 16 12 17 public new StatisticsContent Content { … … 21 26 protected override void OnContentChanged() { 22 27 base.OnContentChanged(); 23 if (Content != null) { 24 var logic = Content.StatisticsLogic; 25 txtRows.Text = logic.GetRowCount().ToString(); 26 txtColumns.Text = logic.GetColumnCount().ToString(); 27 txtNumericColumns.Text = logic.GetNumericColumnCount().ToString(); 28 txtNominalColumns.Text = logic.GetNominalColumnCount().ToString(); 29 txtMissingValuesTotal.Text = logic.GetMissingValueCount().ToString(); 28 if (Content == null) { 29 txtRows.Text = ""; 30 txtColumns.Text = ""; 31 txtNumericColumns.Text = ""; 32 txtNominalColumns.Text = ""; 33 txtMissingValuesTotal.Text = ""; 34 dataGridView.Columns.Clear(); 35 } else { 36 UpdateData(); 37 } 38 } 39 private void UpdateData() { 40 var statisticsLogic = Content.StatisticsLogic; 41 var dataGridLogic = Content.DataDridLogic; 42 txtRows.Text = statisticsLogic.GetRowCount().ToString(); 43 txtColumns.Text = statisticsLogic.GetColumnCount().ToString(); 44 txtNumericColumns.Text = statisticsLogic.GetNumericColumnCount().ToString(); 45 txtNominalColumns.Text = statisticsLogic.GetNominalColumnCount().ToString(); 46 txtMissingValuesTotal.Text = statisticsLogic.GetMissingValueCount().ToString(); 47 48 DataGridViewColumn[] columns = new DataGridViewColumn[COLUMNS]; 49 50 columnsRowsMatrix = new List<List<string>>(); 51 52 53 for (int i = 0; i < Content.DataDridLogic.Columns; ++i) { 54 var column = new DataGridViewTextBoxColumn(); 55 column.FillWeight = 1; 56 columns[i] = column; 57 58 List<string> list; 59 if (statisticsLogic.IsType<double>(i)) { 60 list = GetDoubleColumns(i); 61 } else if (statisticsLogic.IsType<string>(i)) { 62 list = GetStringColumns(i); 63 } else if (statisticsLogic.IsType<DateTime>(i)) { 64 list = GetDateTimeColumns(i); 65 } else { 66 list = new List<string>(); 67 } 68 columnsRowsMatrix.Add(list); 69 } 70 71 dataGridView.Columns.Clear(); 72 dataGridView.Columns.AddRange(columns); 73 dataGridView.RowCount = columnsRowsMatrix[0].Count; 74 75 } 76 77 private List<string> GetDoubleColumns(int columnIndex) { 78 var logic = Content.StatisticsLogic; 79 return new List<string> { 80 //logic.GetColumnTypeAsString(columnIndex), 81 //logic.GetMissingValueCount(columnIndex).tostring(), 82 //logic.GetMin<double>(columnIndex), 83 //logic.GetMax<double>(columnIndex), 84 //logic.getmedian(columnIndex), 85 //logic.getaverage(columnIndex), 86 //logic.-(columnIndex), 87 }; 88 } 89 90 private List<string> GetStringColumns(int columnIndex) { 91 return null; 92 } 93 private List<string> GetDateTimeColumns(int columndIndex) { 94 return null; 95 } 96 97 private List<string> GetDoubleColums(int i) { 98 throw new NotImplementedException(); 99 } 100 101 private void dataGridView_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e) { 102 if (Content != null && e.RowIndex < columnsRowsMatrix.Count && e.ColumnIndex < Content.DataDridLogic.Columns) { 103 30 104 } 31 105 }
Note: See TracChangeset
for help on using the changeset viewer.