Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/23/18 14:10:15 (5 years ago)
Author:
pfleck
Message:

#2906 Implemented transformation re-apply of an already reverse-transformed model.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2906_Transformations/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs

    r15847 r15856  
    181181    }
    182182
     183    public override IDataAnalysisProblemData Transform() {
     184      var transformedProblemData = (IRegressionProblemData)base.Transform();
     185      var targetVariable = GetTransformedTragetVariable(TargetVariable, Transformations);
     186      transformedProblemData.TargetVariable = targetVariable;
     187      return transformedProblemData;
     188    }
     189
    183190    public override IDataAnalysisProblemData InverseTransform() {
    184191      var transformedProblemData = (IRegressionProblemData)base.InverseTransform();
     
    186193      transformedProblemData.TargetVariable = targetVariable;
    187194      return transformedProblemData;
     195    }
     196
     197    public static string GetTransformedTragetVariable(string originalTarget, IEnumerable<IDataAnalysisTransformation> transformations) {
     198      var transformedTarget = originalTarget;
     199      foreach (var transformation in transformations) {
     200        if (transformation.OriginalVariable == transformedTarget)
     201          transformedTarget = transformation.TransformedVariable;
     202      }
     203      return transformedTarget;
    188204    }
    189205
Note: See TracChangeset for help on using the changeset viewer.