Changeset 8664 for trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveValidationBestSolutionAnalyzer.cs
- Timestamp:
- 09/17/12 11:18:40 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveValidationBestSolutionAnalyzer.cs
r8594 r8664 22 22 using HeuristicLab.Common; 23 23 using HeuristicLab.Core; 24 using HeuristicLab.Data;25 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 26 25 using HeuristicLab.Parameters; … … 37 36 private const string ModelCreatorParameterName = "ModelCreator"; 38 37 private const string EstimationLimitsParameterName = "EstimationLimits"; 39 private const string ApplyLinearScalingParameterName = "ApplyLinearScaling";40 38 41 39 #region parameter properties 42 40 public IValueLookupParameter<DoubleLimit> EstimationLimitsParameter { 43 41 get { return (IValueLookupParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; } 44 }45 public IValueParameter<BoolValue> ApplyLinearScalingParameter {46 get { return (IValueParameter<BoolValue>)Parameters[ApplyLinearScalingParameterName]; }47 42 } 48 43 public IValueLookupParameter<ISymbolicClassificationModelCreator> ModelCreatorParameter { … … 54 49 #endregion 55 50 56 #region properties57 public BoolValue ApplyLinearScaling {58 get { return ApplyLinearScalingParameter.Value; }59 }60 #endregion61 51 [StorableConstructor] 62 52 private SymbolicClassificationMultiObjectiveValidationBestSolutionAnalyzer(bool deserializing) : base(deserializing) { } … … 65 55 : base() { 66 56 Parameters.Add(new ValueLookupParameter<DoubleLimit>(EstimationLimitsParameterName, "The loewr and upper limit for the estimated values produced by the symbolic classification model.")); 67 Parameters.Add(new ValueParameter<BoolValue>(ApplyLinearScalingParameterName, "Flag that indicates if the produced symbolic classification solution should be linearly scaled.", new BoolValue(false)));68 57 Parameters.Add(new ValueLookupParameter<ISymbolicClassificationModelCreator>(ModelCreatorParameterName, "")); 69 58 } … … 72 61 } 73 62 74 [StorableHook(HookType.AfterDeserialization)]75 private void AfterDeserialization() {76 if (!Parameters.ContainsKey(ModelCreatorParameterName))77 Parameters.Add(new ValueLookupParameter<ISymbolicClassificationModelCreator>(ModelCreatorParameterName, ""));78 }79 63 80 64 protected override ISymbolicClassificationSolution CreateSolution(ISymbolicExpressionTree bestTree, double[] bestQualities) { 81 65 var model = ModelCreatorParameter.ActualValue.CreateSymbolicClassificationModel((ISymbolicExpressionTree)bestTree.Clone(), SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper); 82 if (ApplyLinearScaling .Value) SymbolicClassificationModel.Scale(model, ProblemDataParameter.ActualValue);66 if (ApplyLinearScalingParameter.ActualValue.Value) SymbolicClassificationModel.Scale(model, ProblemDataParameter.ActualValue, ProblemDataParameter.ActualValue.TargetVariable); 83 67 84 68 model.RecalculateModelParameters(ProblemDataParameter.ActualValue, ProblemDataParameter.ActualValue.TrainingIndices);
Note: See TracChangeset
for help on using the changeset viewer.