- Timestamp:
- 07/06/17 13:07:40 (7 years ago)
- Location:
- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/KernelRidgeRegression
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/KernelRidgeRegression/KernelFunctions/CicularKernel.cs
r14936 r15156 29 29 [Item("CircularKernel", "A circular kernel function 2*pi*(acos(-d)-d*(1-d²)^(0.5)) where n = ||x-c|| and d = n/beta \n As described in http://crsouza.com/2010/03/17/kernel-functions-for-machine-learning-applications/")] 30 30 public class CircularKernel : KernelBase { 31 32 #region HLConstructors & Boilerplate33 31 [StorableConstructor] 34 32 protected CircularKernel(bool deserializing) : base(deserializing) { } 35 [StorableHook(HookType.AfterDeserialization)] 36 private void AfterDeserialization() { } 33 37 34 protected CircularKernel(CircularKernel original, Cloner cloner) : base(original, cloner) { } 38 public CircularKernel() { 39 } 35 36 public CircularKernel() { } 37 40 38 public override IDeepCloneable Clone(Cloner cloner) { 41 39 return new CircularKernel(this, cloner); 42 40 } 43 #endregion44 41 45 42 protected override double Get(double norm) { -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/KernelRidgeRegression/KernelFunctions/GaussianKernel.cs
r14936 r15156 31 31 [Item("GaussianKernel", "A kernel function that uses Gaussian function exp(-n²/beta²). As described in http://crsouza.com/2010/03/17/kernel-functions-for-machine-learning-applications/")] 32 32 public class GaussianKernel : KernelBase { 33 34 #region HLConstructors & Boilerplate35 33 [StorableConstructor] 36 34 protected GaussianKernel(bool deserializing) : base(deserializing) { } 37 [StorableHook(HookType.AfterDeserialization)] 38 private void AfterDeserialization() { } 35 39 36 protected GaussianKernel(GaussianKernel original, Cloner cloner) : base(original, cloner) { } 37 40 38 public GaussianKernel() { 41 39 } 40 42 41 public override IDeepCloneable Clone(Cloner cloner) { 43 42 return new GaussianKernel(this, cloner); 44 43 } 45 #endregion46 44 47 45 protected override double Get(double norm) { -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/KernelRidgeRegression/KernelFunctions/InverseMultiquadraticKernel.cs
r14936 r15156 29 29 [Item("InverseMultiquadraticKernel", "A kernel function that uses the inverse multi-quadratic function 1 / sqrt(1+||x-c||²/beta²). Similar to http://crsouza.com/2010/03/17/kernel-functions-for-machine-learning-applications/ with beta as a scaling factor.")] 30 30 public class InverseMultiquadraticKernel : KernelBase { 31 private const double C = 1.0; 31 32 32 private const double C = 1.0;33 #region HLConstructors & Boilerplate34 33 [StorableConstructor] 35 34 protected InverseMultiquadraticKernel(bool deserializing) : base(deserializing) { } 36 [StorableHook(HookType.AfterDeserialization)] 37 private void AfterDeserialization() { } 35 38 36 protected InverseMultiquadraticKernel(InverseMultiquadraticKernel original, Cloner cloner) : base(original, cloner) { } 37 39 38 public InverseMultiquadraticKernel() { } 39 40 40 public override IDeepCloneable Clone(Cloner cloner) { 41 41 return new InverseMultiquadraticKernel(this, cloner); 42 42 } 43 #endregion44 43 45 44 protected override double Get(double norm) { -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/KernelRidgeRegression/KernelFunctions/KernelBase.cs
r14936 r15156 32 32 public abstract class KernelBase : ParameterizedNamedItem, IKernel { 33 33 34 #region Parameternames35 34 private const string DistanceParameterName = "Distance"; 36 #endregion 37 #region Parameterproperties 35 38 36 public ValueParameter<IDistance> DistanceParameter { 39 37 get { return Parameters[DistanceParameterName] as ValueParameter<IDistance>; } … … 42 40 [Storable] 43 41 public double? Beta { get; set; } 44 #endregion 45 #region Properties 42 46 43 public IDistance Distance { 47 44 get { return DistanceParameter.Value; } … … 49 46 } 50 47 51 #endregion52 53 48 [StorableConstructor] 54 49 protected KernelBase(bool deserializing) : base(deserializing) { } 55 [StorableHook(HookType.AfterDeserialization)]56 private void AfterDeserialization() { }57 50 58 51 protected KernelBase(KernelBase original, Cloner cloner) … … 82 75 public ParameterizedCovarianceFunction GetParameterizedCovarianceFunction(double[] p, int[] columnIndices) { 83 76 if (p.Length != GetNumberOfParameters(columnIndices.Length)) throw new ArgumentException("Illegal parametrization"); 84 var myClone = (KernelBase)Clone( new Cloner());77 var myClone = (KernelBase)Clone(); 85 78 myClone.SetParameter(p); 86 79 var cov = new ParameterizedCovarianceFunction { -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/KernelRidgeRegression/KernelFunctions/MultiquadraticKernel.cs
r14936 r15156 32 32 33 33 private const double C = 1.0; 34 #region HLConstructors & Boilerplate 34 35 35 [StorableConstructor] 36 36 protected MultiquadraticKernel(bool deserializing) : base(deserializing) { } 37 [StorableHook(HookType.AfterDeserialization)] 38 private void AfterDeserialization() { } 37 39 38 protected MultiquadraticKernel(MultiquadraticKernel original, Cloner cloner) 40 39 : base(original, cloner) { } 41 40 42 public MultiquadraticKernel() { 43 } 41 public MultiquadraticKernel() { } 42 44 43 public override IDeepCloneable Clone(Cloner cloner) { 45 44 return new MultiquadraticKernel(this, cloner); 46 45 } 47 #endregion 46 48 47 protected override double Get(double norm) { 49 48 var beta = Beta.Value; -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/KernelRidgeRegression/KernelFunctions/PolysplineKernel.cs
r14936 r15156 33 33 public class PolysplineKernel : KernelBase { 34 34 35 #region Parameternames36 35 private const string DegreeParameterName = "Degree"; 37 #endregion 38 #region Parameterproperties 36 39 37 public IFixedValueParameter<DoubleValue> DegreeParameter { 40 38 get { return Parameters[DegreeParameterName] as IFixedValueParameter<DoubleValue>; } 41 39 } 42 #endregion 43 #region Properties 40 44 41 public DoubleValue Degree { 45 42 get { return DegreeParameter.Value; } 46 43 } 47 #endregion48 44 49 #region HLConstructors & Boilerplate50 45 [StorableConstructor] 51 46 protected PolysplineKernel(bool deserializing) : base(deserializing) { } 52 [StorableHook(HookType.AfterDeserialization)] 53 private void AfterDeserialization() { } 47 54 48 protected PolysplineKernel(PolysplineKernel original, Cloner cloner) : base(original, cloner) { } 49 55 50 public PolysplineKernel() { 56 51 Parameters.Add(new FixedValueParameter<DoubleValue>(DegreeParameterName, "The degree of the kernel. Needs to be greater than zero.", new DoubleValue(1.0))); 57 52 } 53 58 54 public override IDeepCloneable Clone(Cloner cloner) { 59 55 return new PolysplineKernel(this, cloner); 60 56 } 61 #endregion62 57 63 58 protected override double Get(double norm) { -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/KernelRidgeRegression/KernelFunctions/ThinPlatePolysplineKernel.cs
r14936 r15156 33 33 public class ThinPlatePolysplineKernel : KernelBase { 34 34 35 #region Parameternames36 35 private const string DegreeParameterName = "Degree"; 37 #endregion 38 #region Parameterproperties 36 39 37 public IFixedValueParameter<DoubleValue> DegreeParameter { 40 38 get { return Parameters[DegreeParameterName] as IFixedValueParameter<DoubleValue>; } 41 39 } 42 #endregion43 #region Properties44 40 public DoubleValue Degree { 45 41 get { return DegreeParameter.Value; } 46 42 } 47 #endregion48 43 49 #region HLConstructors & Boilerplate50 44 [StorableConstructor] 51 45 protected ThinPlatePolysplineKernel(bool deserializing) : base(deserializing) { } 52 [StorableHook(HookType.AfterDeserialization)] 53 private void AfterDeserialization() { } 46 54 47 protected ThinPlatePolysplineKernel(ThinPlatePolysplineKernel original, Cloner cloner) : base(original, cloner) { } 48 55 49 public ThinPlatePolysplineKernel() { 56 50 Parameters.Add(new FixedValueParameter<DoubleValue>(DegreeParameterName, "The degree of the kernel. Needs to be greater than zero.", new DoubleValue(2.0))); 57 51 } 52 58 53 public override IDeepCloneable Clone(Cloner cloner) { 59 54 return new ThinPlatePolysplineKernel(this, cloner); 60 55 } 61 #endregion62 56 63 57 protected override double Get(double norm) { -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/KernelRidgeRegression/KernelRidgeRegression.cs
r14936 r15156 107 107 Parameters.Add(new FixedValueParameter<DoubleValue>(BetaParameterName, "The beta parameter for the kernel", new DoubleValue(2))); 108 108 } 109 [StorableHook(HookType.AfterDeserialization)]110 private void AfterDeserialization() { }111 109 112 110 public override IDeepCloneable Clone(Cloner cloner) {
Note: See TracChangeset
for help on using the changeset viewer.