Free cookie consent management tool by TermsFeed Policy Generator

Changeset 17812


Ignore:
Timestamp:
12/31/20 15:45:14 (4 years ago)
Author:
gkronber
Message:

#2898: copied implementation from branch to trunk.

Location:
trunk/HeuristicLab.Algorithms.DataAnalysis/3.4
Files:
3 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/GAM/GeneralizedAdditiveModelAlgorithm.cs

    r15775 r17812  
    2525using System.Linq;
    2626using System.Threading;
     27using HEAL.Attic;
    2728using HeuristicLab.Analysis;
    2829using HeuristicLab.Common;
     
    3132using HeuristicLab.Optimization;
    3233using HeuristicLab.Parameters;
    33 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3434using HeuristicLab.Problems.DataAnalysis;
    3535using HeuristicLab.Random;
    3636
    3737namespace HeuristicLab.Algorithms.DataAnalysis {
    38   [Item("Generalized Additive Model (GAM)",
    39     "Generalized Additive Model Algorithm")]
    40   [StorableClass]
     38  [Item("Generalized Additive Model (GAM)", "Generalized additive model using uni-variate penalized regression splines as base learner.")]
     39  [StorableType("98A887E7-73DD-4602-BD6C-2F6B9E6FBBC5")]
    4140  [Creatable(CreatableAttribute.Categories.DataAnalysisRegression, Priority = 600)]
    4241  public sealed class GeneralizedAdditiveModelAlgorithm : FixedDataAnalysisAlgorithm<IRegressionProblem> {
     
    104103
    105104    [StorableConstructor]
    106     private GeneralizedAdditiveModelAlgorithm(bool deserializing)
     105    private GeneralizedAdditiveModelAlgorithm(StorableConstructorFlag deserializing)
    107106      : base(deserializing) {
    108107    }
     
    228227      alglib.spline1dinterpolant s;
    229228      alglib.spline1dfitreport rep;
    230       int numKnots = (int)Math.Min(50, 3 * Math.Sqrt(x.Length)); // heuristic for number of knots  (forgot the source, but it is probably the R documentation or Elements of Statistical Learning)
     229      int numKnots = (int)Math.Min(50, 3 * Math.Sqrt(x.Length)); // heuristic for number of knots  (Elements of Statistical Learning)
    231230
    232231      alglib.spline1dfitpenalized(x, y, numKnots, lambda, out info, out s, out rep);
  • trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/GAM/Spline1dModel.cs

    r15775 r17812  
    2222
    2323using System;
     24using HEAL.Attic;
    2425using System.Collections.Generic;
    2526using System.Linq;
     
    3233  [Item("Spline model (1d)",
    3334    "Univariate spline model (wrapper for alglib.spline1dmodel)")]
    34   [StorableClass]
     35  [StorableType("23D71839-E011-4DC5-B451-2D4C1177D743")]
    3536  public sealed class Spline1dModel : RegressionModel {
    3637    // not storable! see persistence properties below
     
    3839
    3940    [Storable]
    40     private string[] variablesUsedForPrediction;
     41    private readonly string[] variablesUsedForPrediction;
    4142    public override IEnumerable<string> VariablesUsedForPrediction {
    4243      get {
     
    4647
    4748    [StorableConstructor]
    48     private Spline1dModel(bool deserializing) : base(deserializing) {
     49    private Spline1dModel(StorableConstructorFlag deserializing) : base(deserializing) {
    4950      this.interpolant = new alglib.spline1d.spline1dinterpolant();
    5051    }
  • trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj

    r17154 r17812  
    133133    <Compile Include="DoubleArrayExtensions.cs" />
    134134    <Compile Include="FixedDataAnalysisAlgorithm.cs" />
     135    <Compile Include="GAM\GeneralizedAdditiveModelAlgorithm.cs" />
     136    <Compile Include="GAM\Spline1dModel.cs" />
    135137    <Compile Include="GaussianProcess\CovarianceFunctions\CovarianceSpectralMixture.cs" />
    136138    <Compile Include="GaussianProcess\CovarianceFunctions\CovariancePiecewisePolynomial.cs" />
Note: See TracChangeset for help on using the changeset viewer.