Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/02/14 11:38:44 (11 years ago)
Author:
pfleck
Message:
  • Added Transformations to PreprocessingData
  • Added Transformations to DataAnalysisProblemData Parameters
  • Removed SymbolicExpressionTree as inverse transformation.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/ProblemDataCreator.cs

    r10536 r10695  
    2929    private readonly IPreprocessingContext context;
    3030
     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
    3140    public ProblemDataCreator(IPreprocessingContext context) {
    3241      this.context = context;
     
    3847      IDataAnalysisProblemData problemData = null;
    3948
    40       var dataSet = context.Data.ExportToDataset();
    41       var inputVariables = context.Data.VariableNames;
    42 
    4349      if (oldProblemData is RegressionProblemData) {
    44         problemData = CreateRegressionData((RegressionProblemData)oldProblemData, dataSet, inputVariables);
     50        problemData = CreateRegressionData((RegressionProblemData)oldProblemData);
    4551      } else if (oldProblemData is ClassificationProblemData) {
    46         problemData = CreateClassificationData((ClassificationProblemData)oldProblemData, dataSet, inputVariables);
     52        problemData = CreateClassificationData((ClassificationProblemData)oldProblemData);
    4753      } else if (oldProblemData is ClusteringProblemData) {
    48         problemData = CreateClusteringData((ClusteringProblemData)oldProblemData, dataSet, inputVariables);
     54        problemData = CreateClusteringData((ClusteringProblemData)oldProblemData);
    4955      } else {
    5056        throw new NotImplementedException("The type of the DataAnalysisProblemData is not supported.");
     
    5662    }
    5763
    58     private IDataAnalysisProblemData CreateRegressionData(RegressionProblemData oldProblemData, Dataset dataSet, IEnumerable<string> inputVariables) {
     64    private IDataAnalysisProblemData CreateRegressionData(RegressionProblemData oldProblemData) {
    5965      var targetVariable = oldProblemData.TargetVariable;
    6066      // 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);
    6268    }
    6369
    64     private IDataAnalysisProblemData CreateClassificationData(ClassificationProblemData oldProblemData, Dataset dataSet, IEnumerable<string> inputVariables) {
     70    private IDataAnalysisProblemData CreateClassificationData(ClassificationProblemData oldProblemData) {
    6571      var targetVariable = oldProblemData.TargetVariable;
    6672      // 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);
    6874    }
    6975
    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);
    7278    }
    7379
Note: See TracChangeset for help on using the changeset viewer.