UniformKernel Class |
Namespace: Accord.Statistics.Distributions.DensityKernels
[SerializableAttribute] public class UniformKernel : IRadiallySymmetricKernel, IDensityKernel
The UniformKernel type exposes the following members.
Name | Description | |
---|---|---|
UniformKernel |
Initializes a new instance of the UniformKernel class.
| |
UniformKernel(Double) |
Initializes a new instance of the UniformKernel class.
|
Name | Description | |
---|---|---|
Derivative |
Computes the derivative of the kernel profile function.
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
Function |
Computes the kernel density function.
| |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Profile |
Computes the kernel profile function.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
HasMethod |
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.) | |
IsEqual |
Compares two objects for equality, performing an elementwise
comparison if the elements are vectors or matrices.
(Defined by Matrix.) | |
To(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.) | |
ToT | 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.) |
References:
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.