[14741] | 1 | #region License Information
|
---|
| 2 | /* HeuristicLab
|
---|
| 3 | * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
|
---|
| 4 | *
|
---|
| 5 | * This file is part of HeuristicLab.
|
---|
| 6 | *
|
---|
| 7 | * HeuristicLab is free software: you can redistribute it and/or modify
|
---|
| 8 | * it under the terms of the GNU General Public License as published by
|
---|
| 9 | * the Free Software Foundation, either version 3 of the License, or
|
---|
| 10 | * (at your option) any later version.
|
---|
| 11 | *
|
---|
| 12 | * HeuristicLab is distributed in the hope that it will be useful,
|
---|
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 15 | * GNU General Public License for more details.
|
---|
| 16 | *
|
---|
| 17 | * You should have received a copy of the GNU General Public License
|
---|
| 18 | * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
|
---|
| 19 | */
|
---|
| 20 | #endregion
|
---|
| 21 |
|
---|
| 22 | using System;
|
---|
| 23 | using System.Linq;
|
---|
[17332] | 24 | using HEAL.Attic;
|
---|
[14741] | 25 | using HeuristicLab.Common;
|
---|
| 26 | using HeuristicLab.Core;
|
---|
| 27 | using HeuristicLab.Encodings.RealVectorEncoding;
|
---|
| 28 | using HeuristicLab.Problems.DataAnalysis;
|
---|
| 29 |
|
---|
| 30 | // ReSharper disable once CheckNamespace
|
---|
| 31 | namespace HeuristicLab.Algorithms.EGO {
|
---|
| 32 |
|
---|
[17332] | 33 | [StorableType("a9a7c704-6620-4129-9da3-74d590c8422a")]
|
---|
| 34 | [Item("ExpectedImprovementMeassure", "Extension of the Expected Improvement to a weighted version by ANDRAS SÓBESTER , STEPHEN J. LEARY and ANDY J. KEANE in \n On the Design of Optimization Strategies Based on Global Response Surface Approximation Models")]
|
---|
[15064] | 35 | public sealed class ExpectedImprovement : ExpectedImprovementBase {
|
---|
| 36 | #region Constructors, Serialization and Cloning
|
---|
[14741] | 37 | [StorableConstructor]
|
---|
[17332] | 38 | private ExpectedImprovement(StorableConstructorFlag deserializing) : base(deserializing) { }
|
---|
[15064] | 39 | private ExpectedImprovement(ExpectedImprovement original, Cloner cloner) : base(original, cloner) { }
|
---|
| 40 | public ExpectedImprovement() { }
|
---|
[14741] | 41 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
| 42 | return new ExpectedImprovement(this, cloner);
|
---|
| 43 | }
|
---|
| 44 | #endregion
|
---|
| 45 |
|
---|
[14818] | 46 | public override double Evaluate(RealVector vector) {
|
---|
| 47 | var model = RegressionSolution.Model as IConfidenceRegressionModel;
|
---|
[14741] | 48 | var yhat = model.GetEstimation(vector);
|
---|
| 49 | var s = Math.Sqrt(model.GetVariance(vector));
|
---|
[15064] | 50 | return GetEstimatedImprovement(BestFitness, yhat, s, ExploitationWeight, ExpensiveMaximization);
|
---|
[14741] | 51 | }
|
---|
| 52 |
|
---|
[15064] | 53 | protected override double Evaluate(RealVector vector, double estimatedFitness, double estimatedStandardDeviation) {
|
---|
| 54 | return GetEstimatedImprovement(BestFitness, estimatedFitness, estimatedStandardDeviation, ExploitationWeight, ExpensiveMaximization);
|
---|
[14741] | 55 | }
|
---|
| 56 |
|
---|
[15064] | 57 | protected override double FindBestFitness(IConfidenceRegressionSolution solution) {
|
---|
| 58 | return ExpensiveMaximization ? solution.ProblemData.TargetVariableTrainingValues.Max() : solution.ProblemData.TargetVariableTrainingValues.Min();
|
---|
[14818] | 59 | }
|
---|
[14741] | 60 | }
|
---|
| 61 | }
|
---|