Changeset 17812 for trunk/HeuristicLab.Algorithms.DataAnalysis
- Timestamp:
- 12/31/20 15:45:14 (4 years ago)
- 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 25 25 using System.Linq; 26 26 using System.Threading; 27 using HEAL.Attic; 27 28 using HeuristicLab.Analysis; 28 29 using HeuristicLab.Common; … … 31 32 using HeuristicLab.Optimization; 32 33 using HeuristicLab.Parameters; 33 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;34 34 using HeuristicLab.Problems.DataAnalysis; 35 35 using HeuristicLab.Random; 36 36 37 37 namespace 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")] 41 40 [Creatable(CreatableAttribute.Categories.DataAnalysisRegression, Priority = 600)] 42 41 public sealed class GeneralizedAdditiveModelAlgorithm : FixedDataAnalysisAlgorithm<IRegressionProblem> { … … 104 103 105 104 [StorableConstructor] 106 private GeneralizedAdditiveModelAlgorithm( booldeserializing)105 private GeneralizedAdditiveModelAlgorithm(StorableConstructorFlag deserializing) 107 106 : base(deserializing) { 108 107 } … … 228 227 alglib.spline1dinterpolant s; 229 228 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 orElements of Statistical Learning)229 int numKnots = (int)Math.Min(50, 3 * Math.Sqrt(x.Length)); // heuristic for number of knots (Elements of Statistical Learning) 231 230 232 231 alglib.spline1dfitpenalized(x, y, numKnots, lambda, out info, out s, out rep); -
trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/GAM/Spline1dModel.cs
r15775 r17812 22 22 23 23 using System; 24 using HEAL.Attic; 24 25 using System.Collections.Generic; 25 26 using System.Linq; … … 32 33 [Item("Spline model (1d)", 33 34 "Univariate spline model (wrapper for alglib.spline1dmodel)")] 34 [Storable Class]35 [StorableType("23D71839-E011-4DC5-B451-2D4C1177D743")] 35 36 public sealed class Spline1dModel : RegressionModel { 36 37 // not storable! see persistence properties below … … 38 39 39 40 [Storable] 40 private string[] variablesUsedForPrediction;41 private readonly string[] variablesUsedForPrediction; 41 42 public override IEnumerable<string> VariablesUsedForPrediction { 42 43 get { … … 46 47 47 48 [StorableConstructor] 48 private Spline1dModel( booldeserializing) : base(deserializing) {49 private Spline1dModel(StorableConstructorFlag deserializing) : base(deserializing) { 49 50 this.interpolant = new alglib.spline1d.spline1dinterpolant(); 50 51 } -
trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj
r17154 r17812 133 133 <Compile Include="DoubleArrayExtensions.cs" /> 134 134 <Compile Include="FixedDataAnalysisAlgorithm.cs" /> 135 <Compile Include="GAM\GeneralizedAdditiveModelAlgorithm.cs" /> 136 <Compile Include="GAM\Spline1dModel.cs" /> 135 137 <Compile Include="GaussianProcess\CovarianceFunctions\CovarianceSpectralMixture.cs" /> 136 138 <Compile Include="GaussianProcess\CovarianceFunctions\CovariancePiecewisePolynomial.cs" />
Note: See TracChangeset
for help on using the changeset viewer.