Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/28/18 17:17:31 (7 years ago)
Author:
pfleck
Message:

#2906

  • Implemented for classification, clustering, etc.
  • Simplified Transformation interfaces (read-only, ...).
  • Started moving transformation logic out of ProblemData.
Location:
branches/2906_Transformations/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression
Files:
1 added
1 deleted
1 edited

Legend:

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

    r15856 r15870  
    183183    public override IDataAnalysisProblemData Transform() {
    184184      var transformedProblemData = (IRegressionProblemData)base.Transform();
    185       var targetVariable = GetTransformedTragetVariable(TargetVariable, Transformations);
     185      var targetVariable = RegressionTransformationModel.GetTransformedTragetVariable(TargetVariable, Transformations);
    186186      transformedProblemData.TargetVariable = targetVariable;
    187187      return transformedProblemData;
     
    190190    public override IDataAnalysisProblemData InverseTransform() {
    191191      var transformedProblemData = (IRegressionProblemData)base.InverseTransform();
    192       var targetVariable = GetOriginalTragetVariable(TargetVariable, Transformations);
     192      var targetVariable = RegressionTransformationModel.GetOriginalTragetVariable(TargetVariable, Transformations);
    193193      transformedProblemData.TargetVariable = targetVariable;
    194194      return transformedProblemData;
    195195    }
    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;
    204     }
    205 
    206     public static string GetOriginalTragetVariable(string transformedTarget, IEnumerable<IDataAnalysisTransformation> transformations) {
    207       var originalTarget = transformedTarget;
    208       foreach (var transformation in transformations.Reverse()) {
    209         if (transformation.TransformedVariable == originalTarget)
    210           originalTarget = transformation.OriginalVariable;
    211       }
    212       return originalTarget;
    213     }
    214196  }
    215197}
Note: See TracChangeset for help on using the changeset viewer.