Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/11/21 11:48:17 (4 years ago)
Author:
gkronber
Message:

#3073: fixed bugs in ShapeConstrainedRegressionProblemData

File:
1 edited

Legend:

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

    r17964 r17981  
    3535    protected const string ShapeConstraintsParameterName = "ShapeConstraints";
    3636
     37    #region default data
    3738    private static double[,] sigmoid = new double[,] {
    3839      {1.00, 0.09, 0.01390952},
     
    9091    static ShapeConstrainedRegressionProblemData() {
    9192      defaultDataset = new Dataset(new string[] { "x", "y", "y_noise" }, sigmoid) {
    92         Name = "Sigmoid function to show shape-constrained symbolic regression.",
     93        Name = "Sigmoid function for shape-constrained symbolic regression.",
    9394        Description = "f(x) = 1 + tanh(x - 2.5)"
    9495      };
     
    110111      problemData.Parameters.Add(new FixedValueParameter<Dataset>(DatasetParameterName, "", new Dataset()));
    111112      problemData.Parameters.Add(new FixedValueParameter<ReadOnlyCheckedItemList<StringValue>>(InputVariablesParameterName, ""));
    112       problemData.Parameters.Add(new FixedValueParameter<IntRange>(TrainingPartitionParameterName, "", (IntRange)new IntRange(0, 0).AsReadOnly()));
    113       problemData.Parameters.Add(new FixedValueParameter<IntRange>(TestPartitionParameterName, "", (IntRange)new IntRange(0, 0).AsReadOnly()));
     113      problemData.Parameters.Add(new FixedValueParameter<IntRange>(TrainingPartitionParameterName, "", (IntRange)new IntRange(0, 20).AsReadOnly()));
     114      problemData.Parameters.Add(new FixedValueParameter<IntRange>(TestPartitionParameterName, "", (IntRange)new IntRange(20, 40).AsReadOnly()));
    114115      problemData.Parameters.Add(new ConstrainedValueParameter<StringValue>(TargetVariableParameterName, new ItemSet<StringValue>()));
    115116      problemData.Parameters.Add(new FixedValueParameter<IntervalCollection>(VariableRangesParameterName, "", new IntervalCollection()));
     
    117118      emptyProblemData = problemData;
    118119    }
     120    #endregion
    119121
    120122    public IFixedValueParameter<ShapeConstraints> ShapeConstraintParameter => (IFixedValueParameter<ShapeConstraints>)Parameters[ShapeConstraintsParameterName];
     
    142144    public ShapeConstrainedRegressionProblemData(IRegressionProblemData regressionProblemData)
    143145      : this(regressionProblemData.Dataset, regressionProblemData.AllowedInputVariables, regressionProblemData.TargetVariable,
    144           regressionProblemData.TrainingPartition, regressionProblemData.TestPartition, regressionProblemData.Transformations, null, regressionProblemData.VariableRanges) {
     146          regressionProblemData.TrainingPartition, regressionProblemData.TestPartition, regressionProblemData.Transformations,
     147          (regressionProblemData is ShapeConstrainedRegressionProblemData scRegProblemData) ? scRegProblemData.ShapeConstraints : null,
     148          regressionProblemData.VariableRanges) {
    145149    }
    146150
Note: See TracChangeset for help on using the changeset viewer.