Changeset 17388
- Timestamp:
- 12/20/19 11:37:00 (5 years ago)
- Location:
- branches/3044_variableScaling/HeuristicLab.Problems.DataAnalysis/3.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3044_variableScaling/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs
r17180 r17388 1 #region License Information1 #region License Information 2 2 /* HeuristicLab 3 3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) … … 34 34 public class RegressionProblemData : DataAnalysisProblemData, IRegressionProblemData, IStorableContent { 35 35 protected const string TargetVariableParameterName = "TargetVariable"; 36 protected const string ScaleInputsParameterName = "Scale Inputs"; 36 37 public string Filename { get; set; } 37 38 … … 110 111 } 111 112 113 public IFixedValueParameter<BoolValue> ScaleInputsParameter { 114 get { return (IFixedValueParameter<BoolValue>)Parameters[ScaleInputsParameterName]; } 115 } 116 117 public bool ScaleInputs { 118 get { return ScaleInputsParameter.Value.Value; } 119 set { ScaleInputsParameter.Value.Value = value; } 120 } 121 112 122 public IEnumerable<double> TargetVariableValues { 113 123 get { return Dataset.GetDoubleValues(TargetVariable); } … … 120 130 } 121 131 122 123 132 [StorableConstructor] 124 133 protected RegressionProblemData(StorableConstructorFlag _) : base(_) { } 125 134 [StorableHook(HookType.AfterDeserialization)] 126 135 private void AfterDeserialization() { 136 if (!Parameters.ContainsKey(ScaleInputsParameterName)) { 137 Parameters.Add(new FixedValueParameter<BoolValue>(ScaleInputsParameterName, "If enabled input features are scaled by a standard transformation (µ=0, σ=1)", new BoolValue(false))); 138 } 127 139 RegisterParameterEvents(); 128 140 } … … 152 164 var variables = InputVariables.Select(x => x.AsReadOnly()).ToList(); 153 165 Parameters.Add(new ConstrainedValueParameter<StringValue>(TargetVariableParameterName, new ItemSet<StringValue>(variables), variables.Where(x => x.Value == targetVariable).First())); 166 Parameters.Add(new FixedValueParameter<BoolValue>(ScaleInputsParameterName, "If enabled input features are scaled by a standard transformation (µ=0, σ=1)", new BoolValue(false))); 154 167 RegisterParameterEvents(); 155 168 } -
branches/3044_variableScaling/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionProblemData.cs
r17180 r17388 31 31 IEnumerable<double> TargetVariableTrainingValues { get; } 32 32 IEnumerable<double> TargetVariableTestValues { get; } 33 34 bool ScaleInputs { get; set; } 33 35 } 34 36 }
Note: See TracChangeset
for help on using the changeset viewer.