Changeset 17981
- Timestamp:
- 05/11/21 11:48:17 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/ShapeConstrainedRegressionProblemData.cs
r17964 r17981 35 35 protected const string ShapeConstraintsParameterName = "ShapeConstraints"; 36 36 37 #region default data 37 38 private static double[,] sigmoid = new double[,] { 38 39 {1.00, 0.09, 0.01390952}, … … 90 91 static ShapeConstrainedRegressionProblemData() { 91 92 defaultDataset = new Dataset(new string[] { "x", "y", "y_noise" }, sigmoid) { 92 Name = "Sigmoid function to showshape-constrained symbolic regression.",93 Name = "Sigmoid function for shape-constrained symbolic regression.", 93 94 Description = "f(x) = 1 + tanh(x - 2.5)" 94 95 }; … … 110 111 problemData.Parameters.Add(new FixedValueParameter<Dataset>(DatasetParameterName, "", new Dataset())); 111 112 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())); 114 115 problemData.Parameters.Add(new ConstrainedValueParameter<StringValue>(TargetVariableParameterName, new ItemSet<StringValue>())); 115 116 problemData.Parameters.Add(new FixedValueParameter<IntervalCollection>(VariableRangesParameterName, "", new IntervalCollection())); … … 117 118 emptyProblemData = problemData; 118 119 } 120 #endregion 119 121 120 122 public IFixedValueParameter<ShapeConstraints> ShapeConstraintParameter => (IFixedValueParameter<ShapeConstraints>)Parameters[ShapeConstraintsParameterName]; … … 142 144 public ShapeConstrainedRegressionProblemData(IRegressionProblemData regressionProblemData) 143 145 : 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) { 145 149 } 146 150
Note: See TracChangeset
for help on using the changeset viewer.