Changeset 16692 for branches/2521_ProblemRefactoring/HeuristicLab.DataPreprocessing/3.4/ProblemDataCreator.cs
- Timestamp:
- 03/18/19 17:24:30 (5 years ago)
- Location:
- branches/2521_ProblemRefactoring
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring
- Property svn:ignore
-
old new 24 24 protoc.exe 25 25 obj 26 .vs
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/2521_ProblemRefactoring/HeuristicLab.DataPreprocessing
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/stable/HeuristicLab.DataPreprocessing merged eligible /branches/1721-RandomForestPersistence/HeuristicLab.DataPreprocessing 10321-10322 /branches/Algorithms.GradientDescent/HeuristicLab.DataPreprocessing 5516-5520 /branches/Async/HeuristicLab.DataPreprocessing 13329-15286 /branches/Benchmarking/sources/HeuristicLab.DataPreprocessing 6917-7005 /branches/CloningRefactoring/HeuristicLab.DataPreprocessing 4656-4721 /branches/CodeEditor/HeuristicLab.DataPreprocessing 11700-11806 /branches/DataAnalysis Refactoring/HeuristicLab.DataPreprocessing 5471-5808 /branches/DataAnalysis SolutionEnsembles/HeuristicLab.DataPreprocessing 5815-6180 /branches/DataAnalysis/HeuristicLab.DataPreprocessing 4458-4459,4462,4464 /branches/DataPreprocessing Cleanup/HeuristicLab.DataPreprocessing 15269-15489 /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing 14445-15109 /branches/DataPreprocessing/HeuristicLab.DataPreprocessing 10085-11101 /branches/GP.Grammar.Editor/HeuristicLab.DataPreprocessing 6284-6795 /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.DataPreprocessing 5060 /branches/HLScript/HeuristicLab.DataPreprocessing 10331-10358 /branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.DataPreprocessing 11570-12508 /branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.DataPreprocessing 6123-9799 /branches/HeuristicLab.Problems.Orienteering/HeuristicLab.DataPreprocessing 11130-12721 /branches/HiveStatistics/sources/HeuristicLab.DataPreprocessing 12440-12877 /branches/LogResidualEvaluator/HeuristicLab.DataPreprocessing 10202-10483 /branches/NET40/sources/HeuristicLab.DataPreprocessing 5138-5162 /branches/NSGA-II Changes/HeuristicLab.DataPreprocessing 12033-12122 /branches/ParallelEngine/HeuristicLab.DataPreprocessing 5175-5192 /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.DataPreprocessing 7568-7810 /branches/QAPAlgorithms/HeuristicLab.DataPreprocessing 6350-6627 /branches/Restructure trunk solution/HeuristicLab.DataPreprocessing 6828 /branches/RuntimeOptimizer/HeuristicLab.DataPreprocessing 8943-9078 /branches/ScatterSearch (trunk integration)/HeuristicLab.DataPreprocessing 7787-8333 /branches/SlaveShutdown/HeuristicLab.DataPreprocessing 8944-8956 /branches/SpectralKernelForGaussianProcesses/HeuristicLab.DataPreprocessing 10204-10479 /branches/SuccessProgressAnalysis/HeuristicLab.DataPreprocessing 5370-5682 /branches/Trunk/HeuristicLab.DataPreprocessing 6829-6865 /branches/UnloadJobs/HeuristicLab.DataPreprocessing 9168-9215 /branches/VNS/HeuristicLab.DataPreprocessing 5594-5752 /branches/crossvalidation-2434/HeuristicLab.DataPreprocessing 12948-12950 /branches/histogram/HeuristicLab.DataPreprocessing 5959-6341 /branches/symbreg-factors-2650/HeuristicLab.DataPreprocessing 14232-14825 /trunk/sources/HeuristicLab.DataPreprocessing 13331-15681
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
branches/2521_ProblemRefactoring/HeuristicLab.DataPreprocessing/3.4
- Property svn:mergeinfo changed
-
branches/2521_ProblemRefactoring/HeuristicLab.DataPreprocessing/3.4/ProblemDataCreator.cs
r13252 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 28 28 namespace HeuristicLab.DataPreprocessing { 29 29 public class ProblemDataCreator { 30 31 private readonly IPreprocessingContext context; 30 private readonly PreprocessingContext context; 32 31 33 32 private Dataset ExportedDataset { 34 get { 35 return context.Data.ExportToDataset(); 36 } 33 get { return context.Data.ExportToDataset(); } 37 34 } 38 35 39 private IList<ITransformation> Transformations { get { return context.Data.Transformations; } } 36 private IList<ITransformation> Transformations { 37 get { return context.Data.Transformations; } 38 } 40 39 41 public ProblemDataCreator( IPreprocessingContext context) {40 public ProblemDataCreator(PreprocessingContext context) { 42 41 this.context = context; 43 42 } 44 43 45 public IDataAnalysisProblemData CreateProblemData( ) {44 public IDataAnalysisProblemData CreateProblemData(IDataAnalysisProblemData oldProblemData) { 46 45 if (context.Data.Rows == 0 || context.Data.Columns == 0) return null; 47 46 48 var oldProblemData = context.ProblemData;49 47 IDataAnalysisProblemData problemData; 50 48 51 if (oldProblemData is RegressionProblemData) { 49 if (oldProblemData is TimeSeriesPrognosisProblemData) { 50 problemData = CreateTimeSeriesPrognosisData((TimeSeriesPrognosisProblemData)oldProblemData); 51 } else if (oldProblemData is RegressionProblemData) { 52 52 problemData = CreateRegressionData((RegressionProblemData)oldProblemData); 53 53 } else if (oldProblemData is ClassificationProblemData) { … … 70 70 } 71 71 72 private IDataAnalysisProblemData CreateTimeSeriesPrognosisData(TimeSeriesPrognosisProblemData oldProblemData) { 73 var targetVariable = oldProblemData.TargetVariable; 74 if (!context.Data.VariableNames.Contains(targetVariable)) 75 targetVariable = context.Data.VariableNames.First(); 76 var inputVariables = GetDoubleInputVariables(targetVariable); 77 var newProblemData = new TimeSeriesPrognosisProblemData(ExportedDataset, inputVariables, targetVariable, Transformations) { 78 TrainingHorizon = oldProblemData.TrainingHorizon, 79 TestHorizon = oldProblemData.TestHorizon 80 }; 81 return newProblemData; 82 } 83 72 84 private IDataAnalysisProblemData CreateRegressionData(RegressionProblemData oldProblemData) { 73 85 var targetVariable = oldProblemData.TargetVariable; … … 84 96 targetVariable = context.Data.VariableNames.First(); 85 97 var inputVariables = GetDoubleInputVariables(targetVariable); 86 var newProblemData = new ClassificationProblemData(ExportedDataset, inputVariables, targetVariable, Transformations); 87 newProblemData.PositiveClass = oldProblemData.PositiveClass; 98 var newProblemData = new ClassificationProblemData(ExportedDataset, inputVariables, targetVariable, Transformations) { 99 PositiveClass = oldProblemData.PositiveClass 100 }; 88 101 return newProblemData; 89 102 }
Note: See TracChangeset
for help on using the changeset viewer.