#region License Information /* HeuristicLab * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using System; using System.Collections.Generic; using System.Linq; using HeuristicLab.Analysis; using HeuristicLab.Common; using HeuristicLab.Core; using HeuristicLab.Data; using HeuristicLab.Encodings.RealVectorEncoding; using HeuristicLab.Optimization; using HeuristicLab.Parameters; using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; using HeuristicLab.PluginInfrastructure; using HeuristicLab.Problems.DataAnalysis; using HeuristicLab.Problems.Instances; namespace HeuristicLab.Algorithms.DataAnalysis { [Item("SVM Parameter Tuning Problem", "")] [StorableClass] [Creatable("Problems")] public sealed class SupportVectorParameterTuningProblem : SingleObjectiveHeuristicOptimizationProblem, IStorableContent { public string Filename { get; set; } [StorableConstructor] private SupportVectorParameterTuningProblem(bool deserializing) : base(deserializing) { } private SupportVectorParameterTuningProblem(SupportVectorParameterTuningProblem original, Cloner cloner) : base(original, cloner) { RegisterEventHandlers(); } public SupportVectorParameterTuningProblem() : base(new SupportVectorParameterTuningEvaluator(), new UniformRandomRealVectorCreator()) { Parameters.Add(new ValueParameter("ProblemData", "")); Parameters.Add(new ValueParameter("Length", "", new IntValue(3))); var bounds = new DoubleMatrix(new double[,] { {-7,7}, {-7,7}, {-7,7} }); Parameters.Add(new ValueParameter("Bounds", "", bounds)); SolutionCreator.RealVectorParameter.ActualName = "Point"; Parameters["Length"].Hidden = true; Parameters["Bounds"].Hidden = true; InitializeOperators(); RegisterEventHandlers(); } public override IDeepCloneable Clone(Cloner cloner) { return new SupportVectorParameterTuningProblem(this, cloner); } #region Events #endregion #region Helpers [StorableHook(HookType.AfterDeserialization)] private void AfterDeserialization() { RegisterEventHandlers(); } private void RegisterEventHandlers() { } private void InitializeOperators() { Operators.AddRange(ApplicationManager.Manager.GetInstances().Cast()); } #endregion } }