- Timestamp:
- 04/02/14 11:38:44 (11 years ago)
- Location:
- branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/PreprocessingContext.cs
r10676 r10695 93 93 problem.ProblemDataParameter.ActualValue = data; 94 94 problem.Name = "Preprocessed " + problem.Name; 95 96 var symbolicProblem = problem as ISymbolicDataAnalysisProblem;97 if (symbolicProblem != null) {98 var tree = new SymbolicExpressionTree(new ProgramRootSymbol().CreateTreeNode());99 var variableNode = (VariableTreeNode)new Variable("dummy", "dummy description").CreateTreeNode();100 variableNode.VariableName = "dummy";101 tree.Root.AddSubtree(variableNode);102 103 symbolicProblem.TransformationsParameter.Value.Add(tree);104 }105 106 95 return clone; 107 96 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/PreprocessingData.cs
r10586 r10695 39 39 40 40 protected double trainingToTestRatio; 41 42 protected IList<ITransformation> transformations; 41 43 42 44 protected PreprocessingData(PreprocessingData original, Cloner cloner) … … 161 163 } 162 164 165 public IList<ITransformation> Transformations { 166 get { return transformations; } 167 } 168 163 169 public string GetVariableName(int columnIndex) { 164 170 return variableNames[columnIndex]; -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IPreprocessingData.cs
r10586 r10695 51 51 IntRange TestPartition { get; } 52 52 53 IList<ITransformation> Transformations { get; } 54 53 55 IEnumerable<string> VariableNames { get; } 54 56 string GetVariableName(int columnIndex); -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/ProblemDataCreator.cs
r10536 r10695 29 29 private readonly IPreprocessingContext context; 30 30 31 private Dataset ExportedDataset { 32 get { return exporteDataset ?? (exporteDataset = context.Data.ExportToDataset()); } 33 } 34 private Dataset exporteDataset; 35 36 private IEnumerable<string> InputVariables { get { return context.Data.VariableNames; } } 37 private IEnumerable<ITransformation> Transformations { get { return context.Data.Transformations; } } 38 39 31 40 public ProblemDataCreator(IPreprocessingContext context) { 32 41 this.context = context; … … 38 47 IDataAnalysisProblemData problemData = null; 39 48 40 var dataSet = context.Data.ExportToDataset();41 var inputVariables = context.Data.VariableNames;42 43 49 if (oldProblemData is RegressionProblemData) { 44 problemData = CreateRegressionData((RegressionProblemData)oldProblemData , dataSet, inputVariables);50 problemData = CreateRegressionData((RegressionProblemData)oldProblemData); 45 51 } else if (oldProblemData is ClassificationProblemData) { 46 problemData = CreateClassificationData((ClassificationProblemData)oldProblemData , dataSet, inputVariables);52 problemData = CreateClassificationData((ClassificationProblemData)oldProblemData); 47 53 } else if (oldProblemData is ClusteringProblemData) { 48 problemData = CreateClusteringData((ClusteringProblemData)oldProblemData , dataSet, inputVariables);54 problemData = CreateClusteringData((ClusteringProblemData)oldProblemData); 49 55 } else { 50 56 throw new NotImplementedException("The type of the DataAnalysisProblemData is not supported."); … … 56 62 } 57 63 58 private IDataAnalysisProblemData CreateRegressionData(RegressionProblemData oldProblemData , Dataset dataSet, IEnumerable<string> inputVariables) {64 private IDataAnalysisProblemData CreateRegressionData(RegressionProblemData oldProblemData) { 59 65 var targetVariable = oldProblemData.TargetVariable; 60 66 // target variable must be double and must exist in the new dataset 61 return new RegressionProblemData( dataSet, inputVariables, targetVariable);67 return new RegressionProblemData(ExportedDataset, InputVariables, targetVariable, Transformations); 62 68 } 63 69 64 private IDataAnalysisProblemData CreateClassificationData(ClassificationProblemData oldProblemData , Dataset dataSet, IEnumerable<string> inputVariables) {70 private IDataAnalysisProblemData CreateClassificationData(ClassificationProblemData oldProblemData) { 65 71 var targetVariable = oldProblemData.TargetVariable; 66 72 // target variable must be double and must exist in the new dataset 67 return new ClassificationProblemData( dataSet, inputVariables, targetVariable);73 return new ClassificationProblemData(ExportedDataset, InputVariables, targetVariable, Transformations); 68 74 } 69 75 70 private IDataAnalysisProblemData CreateClusteringData(ClusteringProblemData oldProblemData , Dataset dataSet, IEnumerable<string> inputVariables) {71 return new ClusteringProblemData( dataSet, inputVariables);76 private IDataAnalysisProblemData CreateClusteringData(ClusteringProblemData oldProblemData) { 77 return new ClusteringProblemData(ExportedDataset, InputVariables, Transformations); 72 78 } 73 79
Note: See TracChangeset
for help on using the changeset viewer.