Changeset 10220 for branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/PreprocessingData.cs
- Timestamp:
- 12/11/13 16:28:05 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.