Changeset 8532
- Timestamp:
- 08/28/12 14:59:50 (12 years ago)
- Location:
- branches/HeuristicLab.DataImporter/HeuristicLab.DataImporter.DataProcessor
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.DataImporter/HeuristicLab.DataImporter.DataProcessor/DataProcessorView.cs
r7868 r8532 386 386 DataAnalysisProblemData problemData = null; 387 387 if (saveFileDialog.FilterIndex == 1) { 388 problemData = new RegressionProblemData(dataset, dataset. VariableNames, dataset.VariableNames.First());388 problemData = new RegressionProblemData(dataset, dataset.DoubleVariables, dataset.DoubleVariables.First()); 389 389 } else if (saveFileDialog.FilterIndex == 2) { 390 problemData = new ClassificationProblemData(dataset, dataset. VariableNames, dataset.VariableNames.First());390 problemData = new ClassificationProblemData(dataset, dataset.DoubleVariables, dataset.DoubleVariables.First()); 391 391 } else { 392 392 throw new ArgumentException("File extension doesn't exist"); … … 401 401 private Dataset ConvertDataset(DataSet dataSet) { 402 402 ColumnGroup cg; 403 if (dataSet.ActiveColumnGroups. Count() > 0) {403 if (dataSet.ActiveColumnGroups.Any()) { 404 404 cg = dataSet.ActiveColumnGroups.First(); 405 } else if (dataSet.ColumnGroups. Count() > 0) {405 } else if (dataSet.ColumnGroups.Any()) { 406 406 cg = dataSet.ColumnGroups.First(); 407 407 } else { … … 410 410 List<IList> values = new List<IList>(); 411 411 foreach (var column in cg.Columns) { 412 if (column.DataType .Equals(typeof(double?))) {413 values.Add(column.ValuesEnumerable.Cast<double?>().Select(x => x == null ? double.NaN : x).Cast<double>().ToList());414 } else if (column.DataType .Equals(typeof(string))) {415 values.Add(column.ValuesEnumerable.Cast<string>(). ToList());416 } else if (column.DataType .Equals(typeof(DateTime?))) {417 values.Add(column.ValuesEnumerable.Cast<DateTime?>().Select(x => x == null ? new DateTime() : x).Cast<DateTime>().ToList());412 if (column.DataType == typeof(double?)) { 413 values.Add(column.ValuesEnumerable.Cast<double?>().Select(x => x ?? double.NaN).ToList()); 414 } else if (column.DataType == typeof(string)) { 415 values.Add(column.ValuesEnumerable.Cast<string>().Select(x => x ?? string.Empty).ToList()); 416 } else if (column.DataType == typeof(DateTime?)) { 417 values.Add(column.ValuesEnumerable.Cast<DateTime?>().Select(x => x ?? default(DateTime)).ToList()); 418 418 } else { 419 419 throw new ArgumentException("The variable values must be of type List<double>, List<string> or List<DateTime>"); -
branches/HeuristicLab.DataImporter/HeuristicLab.DataImporter.DataProcessor/HeuristicLab.DataImporter.DataProcessor.csproj
r7868 r8532 94 94 </PropertyGroup> 95 95 <ItemGroup> 96 <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 96 <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 97 <Private>False</Private> 98 </Reference> 97 99 <Reference Include="HeuristicLab.Common.Resources-3.3"> 98 100 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Common.Resources-3.3.dll</HintPath> 99 101 <Private>False</Private> 100 102 </Reference> 101 <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 102 <Reference Include="HeuristicLab.Data-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 103 <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 104 <Private>False</Private> 105 </Reference> 106 <Reference Include="HeuristicLab.Data-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 107 <Private>False</Private> 108 </Reference> 103 109 <Reference Include="HeuristicLab.Persistence-3.3"> 104 110 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Persistence-3.3.dll</HintPath> … … 109 115 <Private>False</Private> 110 116 </Reference> 111 <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 117 <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 118 <Private>False</Private> 119 </Reference> 112 120 <Reference Include="System" /> 113 121 <Reference Include="System.Core">
Note: See TracChangeset
for help on using the changeset viewer.