Click or drag to resize
Accord.NET (logo)

UniformKernel Class

Uniform density kernel.
Inheritance Hierarchy
SystemObject
  Accord.Statistics.Distributions.DensityKernelsUniformKernel

Namespace:  Accord.Statistics.Distributions.DensityKernels
Assembly:  Accord.Statistics (in Accord.Statistics.dll) Version: 3.8.0
Syntax
[SerializableAttribute]
public class UniformKernel : IRadiallySymmetricKernel, 
	IDensityKernel
Request Example View Source

The UniformKernel type exposes the following members.

Constructors
  NameDescription
Public methodUniformKernel
Initializes a new instance of the UniformKernel class.
Public methodUniformKernel(Double)
Initializes a new instance of the UniformKernel class.
Top
Properties
  NameDescription
Public propertyConstant
Gets or sets the kernel's normalization constant.
Top
Methods
  NameDescription
Public methodDerivative
Computes the derivative of the kernel profile function.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFunction
Computes the kernel density function.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodProfile
Computes the kernel profile function.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Extension Methods
  NameDescription
Public Extension MethodHasMethod
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.)
Public Extension MethodIsEqual
Compares two objects for equality, performing an elementwise comparison if the elements are vectors or matrices.
(Defined by Matrix.)
Public Extension MethodTo(Type)Overloaded.
Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.)
Public Extension MethodToTOverloaded.
Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.)
Top
Remarks

References:

  • Comaniciu, Dorin, and Peter Meer. "Mean shift: A robust approach toward feature space analysis." Pattern Analysis and Machine Intelligence, IEEE Transactions on 24.5 (2002): 603-619. Available at: http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=1000236
  • Dan Styer, Oberlin College Department of Physics and Astronomy; Volume of a d-dimensional sphere. Last updated 30 August 2007. Available at: http://www.oberlin.edu/physics/dstyer/StatMech/VolumeDSphere.pdf
  • David W. Scott, Multivariate Density Estimation: Theory, Practice, and Visualization, Wiley, Aug 31, 1992

Examples

The following example demonstrates how to use the Mean Shift algorithm with a uniform kernel to solve a clustering task:

// Use a fixed seed for reproducibility
Accord.Math.Random.Generator.Seed = 0;

// Declare some data to be clustered
double[][] input =
{
    new double[] { -5, -2, -4 },
    new double[] { -5, -5, -6 },
    new double[] {  2,  1,  1 },
    new double[] {  1,  1,  2 },
    new double[] {  1,  2,  2 },
    new double[] {  3,  1,  2 },
    new double[] { 11,  5,  4 },
    new double[] { 15,  5,  6 },
    new double[] { 10,  5,  6 },
};

// Create a new Mean-Shift algorithm for 3 dimensional samples
MeanShift meanShift = new MeanShift()
{
    // Use a uniform kernel density
    Kernel = new UniformKernel(),
    Bandwidth = 2.0
};

// Learn a data partitioning using the Mean Shift algorithm
MeanShiftClusterCollection clustering = meanShift.Learn(input);

// Predict group labels for each point
int[] labels = clustering.Decide(input);

// As a result, the first two observations should belong to the
//  same cluster (thus having the same label). The same should
//  happen to the next four observations and to the last three.
See Also