- Timestamp:
- 12/16/21 14:23:48 (3 years ago)
- Location:
- branches/3136_Structural_GP
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3136_Structural_GP
- Property svn:mergeinfo changed
-
branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis
- Property svn:mergeinfo changed
-
branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis/3.4
- Property svn:mergeinfo changed
-
branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblem.cs
r17180 r18146 92 92 93 93 #region Import & Export 94 public v oid Load(T data) {94 public virtual void Load(T data) { 95 95 Name = data.Name; 96 96 Description = data.Description; … … 98 98 } 99 99 100 public T Export() {100 public virtual T Export() { 101 101 return ProblemData; 102 102 } -
branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblemData.cs
r18034 r18146 187 187 Parameters.Add(new FixedValueParameter<ReadOnlyItemList<ITransformation>>(TransformationsParameterName, "", transformationsList.AsReadOnly())); 188 188 189 IntervalCollection varRanges = null; 189 190 if (variableRanges == null) { 190 variableRanges = Dataset.GetVariableRanges(); 191 } 192 Parameters.Add(new FixedValueParameter<IntervalCollection>(VariableRangesParameterName, variableRanges)); 191 varRanges = Dataset.GetVariableRanges(); 192 }else { 193 varRanges = (IntervalCollection) variableRanges.Clone(); 194 } 195 196 Parameters.Add(new FixedValueParameter<IntervalCollection>(VariableRangesParameterName, varRanges)); 193 197 194 198 TransformationsParameter.Hidden = true; -
branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs
r18034 r18146 158 158 159 159 public RegressionProblemData(IDataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable, 160 IEnumerable<ITransformation> transformations = null/*, 161 IntervalCollection variableRanges = null*/) 162 : base(dataset, allowedInputVariables, transformations ?? Enumerable.Empty<ITransformation>()) { 160 IEnumerable<ITransformation> transformations = null, IntervalCollection variableRanges = null) 161 : base(dataset, allowedInputVariables, transformations, variableRanges) { 163 162 var variables = InputVariables.Select(x => x.AsReadOnly()).ToList(); 164 163 Parameters.Add(new ConstrainedValueParameter<StringValue>(TargetVariableParameterName, new ItemSet<StringValue>(variables), variables.Where(x => x.Value == targetVariable).First())); 165 /*if (variableRanges == null) { 166 variableRanges = Dataset.GetVariableRanges(); 167 } 168 Parameters.Add(new FixedValueParameter<IntervalCollection>(VariableRangesParameterName, variableRanges));*/ 164 169 165 } 170 166 private void RegisterParameterEvents() { -
branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/ShapeConstrainedRegressionProblem.cs
r17960 r18146 24 24 using HeuristicLab.Core; 25 25 26 namespace HeuristicLab.Problems.DataAnalysis {26 namespace HeuristicLab.Problems.DataAnalysis { 27 27 [StorableType("B53C4C71-3715-4BB1-9A95-4E969D8135C6")] 28 28 [Item("Shape-constrained Regression Problem", "A regression problem with shape constraints.")] 29 public class ShapeConstrainedRegressionProblem : DataAnalysisProblem<I ShapeConstrainedRegressionProblemData>, IShapeConstrainedRegressionProblem {29 public class ShapeConstrainedRegressionProblem : DataAnalysisProblem<IRegressionProblemData>, IShapeConstrainedRegressionProblem { 30 30 [StorableConstructor] 31 31 protected ShapeConstrainedRegressionProblem(StorableConstructorFlag _) : base(_) { } … … 33 33 public override IDeepCloneable Clone(Cloner cloner) { return new ShapeConstrainedRegressionProblem(this, cloner); } 34 34 35 public ShapeConstrainedRegressionProblemData ShapeConstrainedRegressionProblemData { 36 get => (ShapeConstrainedRegressionProblemData)ProblemData; 37 set => ProblemData = value; 38 } 35 39 public ShapeConstrainedRegressionProblem() : base(new ShapeConstrainedRegressionProblemData()) { } 40 41 42 public override void Load(IRegressionProblemData data) { 43 if (data is ShapeConstrainedRegressionProblemData scProblemData) { 44 // use directly 45 } else { 46 scProblemData = new ShapeConstrainedRegressionProblemData(data.Dataset, data.AllowedInputVariables, data.TargetVariable, 47 data.TrainingPartition, data.TestPartition) { 48 Name = data.Name, 49 Description = data.Description 50 }; 51 } 52 base.Load(scProblemData); 53 } 36 54 } 37 55 } -
branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/ShapeConstrainedRegressionProblemData.cs
r18034 r18146 144 144 public ShapeConstrainedRegressionProblemData(IRegressionProblemData regressionProblemData) 145 145 : this(regressionProblemData.Dataset, regressionProblemData.AllowedInputVariables, regressionProblemData.TargetVariable, 146 regressionProblemData.TrainingPartition, regressionProblemData.TestPartition, regressionProblemData.Transformations, 147 (regressionProblemData is ShapeConstrainedRegressionProblemData) ? ((ShapeConstrainedRegressionProblemData)regressionProblemData).ShapeConstraints : null, 148 regressionProblemData.VariableRanges) { 146 regressionProblemData.TrainingPartition, regressionProblemData.TestPartition, (regressionProblemData is ShapeConstrainedRegressionProblemData) ? ((ShapeConstrainedRegressionProblemData)regressionProblemData).ShapeConstraints : null, 147 regressionProblemData.Transformations, regressionProblemData.VariableRanges) { 149 148 } 150 149 151 150 public ShapeConstrainedRegressionProblemData(IDataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable, 152 IntRange trainingPartition, IntRange testPartition, 153 IEnumerable<ITransformation> transformations = null, ShapeConstraints sc = null,IntervalCollection variableRanges = null)154 : base(dataset, allowedInputVariables, targetVariable, transformations ?? Enumerable.Empty<ITransformation>()) {151 IntRange trainingPartition, IntRange testPartition, ShapeConstraints sc = null, 152 IEnumerable<ITransformation> transformations = null, IntervalCollection variableRanges = null) 153 : base(dataset, allowedInputVariables, targetVariable, transformations, variableRanges) { 155 154 TrainingPartition.Start = trainingPartition.Start; 156 155 TrainingPartition.End = trainingPartition.End; … … 159 158 if (sc == null) sc = new ShapeConstraints(); 160 159 Parameters.Add(new FixedValueParameter<ShapeConstraints>(ShapeConstraintsParameterName, "Specifies the shape constraints for the regression problem.", (ShapeConstraints)sc.Clone())); 161 162 160 RegisterEventHandlers(); 163 161 } -
branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IShapeConstrainedRegressionProblem.cs
r17960 r18146 24 24 namespace HeuristicLab.Problems.DataAnalysis { 25 25 [StorableType("C6E9D32A-7727-487E-859C-DF24EDCC5922")] 26 public interface IShapeConstrainedRegressionProblem : IDataAnalysisProblem<IShapeConstrainedRegressionProblemData> { 26 public interface IShapeConstrainedRegressionProblem : IRegressionProblem { 27 ShapeConstrainedRegressionProblemData ShapeConstrainedRegressionProblemData { get; set; } 27 28 } 28 29 } -
branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineLinearScalingParameterCalculator.cs
r17180 r18146 28 28 29 29 /// <summary> 30 /// Additive constant30 /// Additive offset 31 31 /// </summary> 32 32 public double Alpha { … … 103 103 /// <param name="original">Values that should be scaled</param> 104 104 /// <param name="target">Target values to which the original values should be scaled</param> 105 /// <param name="alpha">Additive constant for the linear scaling</param>105 /// <param name="alpha">Additive offset for the linear scaling</param> 106 106 /// <param name="beta">Multiplicative factor for the linear scaling</param> 107 107 /// <param name="errorState">Flag that indicates if errors occurred in the calculation of the linea scaling parameters.</param>
Note: See TracChangeset
for help on using the changeset viewer.