Changeset 18111


Ignore:
Timestamp:
12/09/21 07:20:12 (7 months ago)
Author:
gkronber
Message:

#3073 fix exception when no variableRanges are given in the ctor for ShapeConstrainedRegressionProblemData

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/ShapeConstrainedRegressionProblemData.cs

    r18110 r18111  
    145145      : this(regressionProblemData.Dataset, regressionProblemData.AllowedInputVariables, regressionProblemData.TargetVariable,
    146146          regressionProblemData.TrainingPartition, regressionProblemData.TestPartition, regressionProblemData.Transformations,
    147           (regressionProblemData is ShapeConstrainedRegressionProblemData) ? ((ShapeConstrainedRegressionProblemData)regressionProblemData).ShapeConstraints : null, 
     147          (regressionProblemData is ShapeConstrainedRegressionProblemData) ? ((ShapeConstrainedRegressionProblemData)regressionProblemData).ShapeConstraints : null,
    148148          regressionProblemData.VariableRanges) {
    149149    }
     
    159159      if (sc == null) sc = new ShapeConstraints();
    160160      Parameters.Add(new FixedValueParameter<ShapeConstraints>(ShapeConstraintsParameterName, "Specifies the shape constraints for the regression problem.", (ShapeConstraints)sc.Clone()));
    161       foreach (var entry in variableRanges.GetVariableIntervals())
    162         VariableRanges.SetInterval(entry.Item1, entry.Item2);
     161      if (variableRanges != null) {
     162        foreach (var entry in variableRanges.GetVariableIntervals())
     163          VariableRanges.SetInterval(entry.Item1, entry.Item2);
     164      }
    163165      RegisterEventHandlers();
    164166    }
Note: See TracChangeset for help on using the changeset viewer.