Changeset 10194
- Timestamp:
- 12/04/13 17:01:13 (11 years ago)
- Location:
- branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/PreprocessingData.cs
r10193 r10194 73 73 74 74 trainingToTestRatio = (double)problemData.TrainingPartition.Size / problemData.TestPartition.Size; 75 Columns = problemData.Dataset.Columns;76 Rows = problemData.Dataset.Rows;77 75 } 78 76 … … 104 102 105 103 public IEnumerable<T> GetValues<T>(string variableName) { 106 return (IEnumerable<T>)variableValues[variableName]; 104 // TODO: test if cast is valid 105 return (IEnumerable<T>)variableValues[variableName]; 107 106 } 108 107 … … 112 111 113 112 public void InsertRow(int rowIndex) { 114 throw new NotImplementedException(); 113 foreach (IList column in variableValues.Values) { 114 Type type = column.GetType().GetGenericArguments()[0]; 115 116 column.Insert(rowIndex, type.IsValueType ? Activator.CreateInstance(type) : null); 117 } 115 118 } 116 119 117 120 public void DeleteRow(int rowIndex) { 118 throw new NotImplementedException(); 121 foreach (IList column in variableValues.Values) { 122 column.RemoveAt(rowIndex); 123 } 119 124 } 120 125 121 public void InsertColumn(string variableName, int columnIndex) { 122 throw new NotImplementedException(); 126 public void InsertColumn<T>(string variableName, int columnIndex) { 127 variableValues.Add(variableName, new List<T>(Rows)); 128 variableNameIndices.Add(variableName, columnIndex); 129 variableNames.Insert(columnIndex, variableName); 123 130 } 124 131 125 132 public void DeleteColumn(string variableName) { 126 throw new NotImplementedException(); 133 variableValues.Remove(variableName); 134 variableNames.RemoveAt(variableNameIndices[variableName]); 135 variableNameIndices.Remove(variableName); 127 136 } 128 137 … … 136 145 137 146 public int Columns { 138 get; 139 private set; 147 get { return variableNames.Count; } 140 148 } 141 149 142 150 public int Rows { 143 get; 144 private set; 151 get { return variableValues.Count; } 145 152 } 146 147 public void ExportTo(IDataAnalysisProblemData problemData) {148 throw new NotImplementedException();149 }150 151 153 public IDictionary<string, IEnumerable<int>> GetMissingValueIndices() { 152 154 var dic = new Dictionary<string, IEnumerable<int>>(); -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IPreprocessingData.cs
r10191 r10194 36 36 void DeleteRow(int rowIndex); 37 37 38 void InsertColumn (string variableName, int columnIndex);38 void InsertColumn<T>(string variableName, int columnIndex); 39 39 void DeleteColumn(string variableName); 40 40 … … 44 44 int Columns { get; } 45 45 int Rows { get; } 46 47 void ExportTo(IDataAnalysisProblemData problemData);48 46 49 47 /// <summary>
Note: See TracChangeset
for help on using the changeset viewer.