- Timestamp:
- 03/20/18 12:28:16 (7 years ago)
- Location:
- branches/2906_Transformations
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2906_Transformations/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj
r15847 r15848 432 432 <DependentUpon>RegressionSolutionScatterPlotView.cs</DependentUpon> 433 433 </Compile> 434 <Compile Include="Regression\TransformedRegressionModelView.cs"> 435 <SubType>UserControl</SubType> 436 </Compile> 437 <Compile Include="Regression\TransformedRegressionModelView.Designer.cs"> 438 <DependentUpon>TransformedRegressionModelView.cs</DependentUpon> 439 </Compile> 434 440 <Compile Include="Solution Views\ClassificationSolutionView.cs"> 435 441 <SubType>UserControl</SubType> -
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 -
branches/2906_Transformations/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/ITransformedRegressionModel.cs
r15846 r15848 20 20 #endregion 21 21 22 using HeuristicLab.Core; 23 22 24 namespace HeuristicLab.Problems.DataAnalysis { 23 25 public interface ITransformedRegressionModel : IRegressionModel { 26 24 27 IRegressionModel OriginalModel { get; } 28 29 ItemList<IDataAnalysisTransformation> Transformations { get; } 25 30 } 26 31 }
Note: See TracChangeset
for help on using the changeset viewer.