Free cookie consent management tool by TermsFeed Policy Generator

Changeset 13119


Ignore:
Timestamp:
11/05/15 07:49:41 (9 years ago)
Author:
gkronber
Message:

#2497: added input scaling also to Gaussian process classification models

Location:
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessBase.cs

    r13118 r13119  
    2121#endregion
    2222
    23 using System;
    24 using System.Linq;
    2523using HeuristicLab.Algorithms.GradientDescent;
    2624using HeuristicLab.Common;
     
    3129using HeuristicLab.Parameters;
    3230using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    33 using HeuristicLab.PluginInfrastructure;
    3431using HeuristicLab.Problems.DataAnalysis;
    3532
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessClassificationModelCreator.cs

    r12012 r13119  
    6262    public override IOperation Apply() {
    6363      try {
    64         var model = Create(ProblemData, Hyperparameter.ToArray(), MeanFunction, CovarianceFunction);
     64        var model = Create(ProblemData, Hyperparameter.ToArray(), MeanFunction, CovarianceFunction, ScaleInputValues);
    6565        ModelParameter.ActualValue = model;
    6666        NegativeLogLikelihoodParameter.ActualValue = new DoubleValue(model.NegativeLogLikelihood);
    6767        HyperparameterGradientsParameter.ActualValue = new RealVector(model.HyperparameterGradients);
    6868        return base.Apply();
    69       }
    70       catch (ArgumentException) { }
    71       catch (alglib.alglibexception) { }
     69      } catch (ArgumentException) { } catch (alglib.alglibexception) { }
    7270      NegativeLogLikelihoodParameter.ActualValue = new DoubleValue(1E300);
    7371      HyperparameterGradientsParameter.ActualValue = new RealVector(Hyperparameter.Count());
     
    7573    }
    7674
    77     public static IGaussianProcessModel Create(IClassificationProblemData problemData, double[] hyperparameter, IMeanFunction meanFunction, ICovarianceFunction covarianceFunction) {
    78       return new GaussianProcessModel(problemData.Dataset, problemData.TargetVariable, problemData.AllowedInputVariables, problemData.TrainingIndices, hyperparameter, meanFunction, covarianceFunction);
     75    public static IGaussianProcessModel Create(IClassificationProblemData problemData, double[] hyperparameter, IMeanFunction meanFunction, ICovarianceFunction covarianceFunction, bool scaleInputs = true) {
     76      return new GaussianProcessModel(problemData.Dataset, problemData.TargetVariable, problemData.AllowedInputVariables, problemData.TrainingIndices, hyperparameter, meanFunction, covarianceFunction, scaleInputs);
    7977    }
    8078  }
Note: See TracChangeset for help on using the changeset viewer.