Changeset 10220
- Timestamp:
- 12/11/13 16:28:05 (11 years ago)
- Location:
- branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/DataPreprocessingView.cs
r10219 r10220 25 25 private void button1_Click(object sender, System.EventArgs e) { 26 26 27 IPreprocessingData Data = Content.Data; 27 28 28 /* 29 DataAnalysisProblemData problemData = Content; 30 Dataset ds = problemData.Dataset; 31 for (int i = 0; i < ds.Columns; i++) { 32 for (int j = 0; j < ds.Rows; j++) { 33 ds.SetValue("1,0", j, i); 29 foreach (string variable in Data.VariableNames) { 30 for (int j = 0; j < Data.Rows; j++) { 31 // assume: all double 32 Data.SetCell(variable, j, 1.0); 34 33 } 35 34 } 36 35 37 MessageBox.Show("Success ;)"); 38 */ 36 MessageBox.Show("Success, now cloning... "); 37 38 39 //Dataset ds = Data.ExportToDataset(); 40 //var cloner = new Cloner(); 41 42 //cloner.RegisterClonedObject() 43 44 //var clone = null; 45 39 46 } 40 47 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/PreprocessingData.cs
r10218 r10220 26 26 using HeuristicLab.Common; 27 27 using HeuristicLab.Core; 28 using HeuristicLab.Data; 28 29 using HeuristicLab.Problems.DataAnalysis; 29 using HeuristicLab.Data;30 30 31 31 namespace HeuristicLab.DataPreprocessing { … … 42 42 43 43 private double trainingToTestRatio; 44 44 45 45 private PreprocessingData(PreprocessingData original, Cloner cloner) 46 46 : base(original, cloner) { … … 109 109 public IEnumerable<T> GetValues<T>(string variableName) { 110 110 // TODO: test if cast is valid 111 return (IEnumerable<T>)variableValues[variableName]; 111 return (IEnumerable<T>)variableValues[variableName]; 112 112 } 113 113 … … 183 183 return GetValues<string>(variableName).Select((s, i) => new { i, s }).Where(t => string.IsNullOrEmpty(t.s)).Select(t => t.i); 184 184 } else if (IsType<DateTime>(variableName)) { 185 185 return GetValues<DateTime>(variableName).Select((s, i) => new { i, s }).Where(t => t.s.Equals(DateTime.MinValue)).Select(t => t.i); 186 186 } else { 187 187 throw new ArgumentException("column with variableName: " + variableName + " contains a non supported type."); 188 188 } 189 } 190 191 #endregion 192 193 #region IPreprocessingData Members 194 195 public Dataset ExportToDataset() { 196 IList<IList> values = new List<IList>(); 197 foreach (var variable in VariableNames) { 198 values.Add(variableValues[variable]); 199 } 200 201 var dataset = new Dataset(variableNames, values); 202 return dataset; 189 203 } 190 204 -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IPreprocessingData.cs
r10218 r10220 22 22 using System.Collections.Generic; 23 23 using HeuristicLab.Core; 24 using HeuristicLab.Data; 24 25 using HeuristicLab.Problems.DataAnalysis; 25 using HeuristicLab.Data;26 26 27 27 namespace HeuristicLab.DataPreprocessing { … … 36 36 void InsertRow(int rowIndex); 37 37 void DeleteRow(int rowIndex); 38 39 IntRange TrainingPartition { get; }40 IntRange TestPartition { get; }41 38 42 39 void InsertColumn<T>(string variableName, int columnIndex); … … 63 60 64 61 bool IsMissingValue(string variableName, int rowIndex); 62 63 Dataset ExportToDataset(); 65 64 } 66 65 }
Note: See TracChangeset
for help on using the changeset viewer.