Changeset 15848 for branches/2906_Transformations/HeuristicLab.Problems.DataAnalysis/3.4/Implementation
- Timestamp:
- 03/20/18 12:28:16 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2906_Transformations/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblemData.cs
r15847 r15848 273 273 } 274 274 275 public static IDataset InverseTransform(IDataset dataset, IEnumerable<IDataAnalysisTransformation> transformations ) {275 public static IDataset InverseTransform(IDataset dataset, IEnumerable<IDataAnalysisTransformation> transformations, bool removeVirtualVariables = true) { 276 276 var modifiableDataset = ((Dataset)dataset).ToModifiable(); 277 277 278 foreach (var transformation in transformations.Reverse()) { 278 var transformationsStack = new Stack<IDataAnalysisTransformation>(transformations); 279 while (transformationsStack.Any()) { 280 var transformation = transformationsStack.Pop(); 279 281 var trans = (ITransformation<double>)transformation.Transformation; 280 282 … … 283 285 var originalData = trans.InverseApply(transformedData).ToList(); 284 286 modifiableDataset.ReplaceVariable(transformation.OriginalVariable, originalData); 287 288 bool transformedVariablePending = transformationsStack.Any(x => x.OriginalVariable == transformation.TransformedVariable); 289 if (removeVirtualVariables && !transformedVariablePending) 290 modifiableDataset.RemoveVariable(transformation.TransformedVariable); 285 291 } 286 292
Note: See TracChangeset
for help on using the changeset viewer.