Changeset 17388 for branches/3044_variableScaling/HeuristicLab.Problems.DataAnalysis/3.4/Implementation
- Timestamp:
- 12/20/19 11:37:00 (5 years ago)
- File:
-
- 1 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 }
Note: See TracChangeset
for help on using the changeset viewer.