Changeset 13205 for trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessRegressionSolutionCreator.cs
- Timestamp:
- 11/17/15 11:47:52 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessRegressionSolutionCreator.cs
r12012 r13205 40 40 private const string TrainingRSquaredResultName = "Training R²"; 41 41 private const string TestRSquaredResultName = "Test R²"; 42 private const string CreateSolutionParameterName = "CreateSolution"; 42 43 43 44 #region Parameter Properties … … 54 55 get { return (ILookupParameter<ResultCollection>)Parameters[ResultsParameterName]; } 55 56 } 57 public ILookupParameter<BoolValue> CreateSolutionParameter { 58 get { return (ILookupParameter<BoolValue>)Parameters[CreateSolutionParameterName]; } 59 } 56 60 #endregion 57 61 … … 64 68 Parameters.Add(new LookupParameter<IRegressionProblemData>(ProblemDataParameterName, "The regression problem data for the Gaussian process solution.")); 65 69 Parameters.Add(new LookupParameter<IGaussianProcessModel>(ModelParameterName, "The Gaussian process regression model to use for the solution.")); 70 Parameters.Add(new LookupParameter<BoolValue>(CreateSolutionParameterName, "Flag that indicates if a solution should be produced at the end of the run")); 71 66 72 // in & out 67 73 Parameters.Add(new LookupParameter<ResultCollection>(ResultsParameterName, "The result collection of the algorithm.")); 68 74 // out 69 75 Parameters.Add(new LookupParameter<IGaussianProcessSolution>(SolutionParameterName, "The produced Gaussian process solution.")); 76 } 77 78 [StorableHook(HookType.AfterDeserialization)] 79 private void AfterDeserialization() { 80 // BackwardsCompatibility3.3 81 #region Backwards compatible code, remove with 3.4 82 if (!Parameters.ContainsKey(CreateSolutionParameterName)) { 83 Parameters.Add(new LookupParameter<BoolValue>(CreateSolutionParameterName, "Flag that indicates if a solution should be produced at the end of the run")); 84 } 85 #endregion 70 86 } 71 87 … … 75 91 76 92 public override IOperation Apply() { 77 if (ModelParameter.ActualValue != null ) {93 if (ModelParameter.ActualValue != null && CreateSolutionParameter.ActualValue.Value == true) { 78 94 var m = (IGaussianProcessModel)ModelParameter.ActualValue.Clone(); 79 95 m.FixParameters();
Note: See TracChangeset
for help on using the changeset viewer.