Linear manifold clustering algorithm (LMCLUS) discovers clusters which are described by a following model:
x = μN × 1 + BN × KϕK × 1 + B̄N × N − KϵN − K × 1
where N is a dimension of the dataset, K is dimension of the manifold, μ ∈ ℝN is a linear manifold translation vector, B is a matrix whose columns are orthonormal vectors that span ℝK, B̄ is a matrix whose columns span subspace orthogonal to spanned by columns of B, ϕ is a zero-mean random vector whose entries are i.i.d. from a support of linear manifold, ϵ is a zero-mean random vector with small variance independent of ϕ.
This package implements the LMCLUS algorithm in the lmclus
function:
lmclus(X, p)
Performs linear manifold clustering over the given dataset.
- param X
The given sample matrix. Each column of
X
is a sample.- param p
The clustering parameters as instance of
LMCLUSParameters </params>
.
This function returns an LMCLUSResult
instance.
Let M
be an instance of Manifold
, n
be the number of observations, and d
be the dimension of the linear manifold cluster.
indim(M)
Returns a dimension of the observation space.
outdim(M)
Returns a dimension of the linear manifold cluster which is the dimension of the subspace.
size(M)
Returns the number of points in the cluster which is the size of the cluster.
points(M)
Returns indexes of points assigned to the cluster.
mean(M)
Returns the translation vector μ which contains coordinates of the linear manifold origin.
projection(M)
Returns the basis matrix with columns corresponding to orthonormal vectors that span the linear manifold."
separation(M)
Returns the instance of Separation </separation>
object.
using LMCLUS
# Load test data, remove label column and flip
X = readdlm(Pkg.dir("LMCLUS", "test", "testData"), ',')[:,1:end-1]'
# Initialize clustering parameters with
# maximum dimensionality for clusters.
# I should be less then original space dimension.
params = LMCLUSParameters(5)
# perform clustering and returns a collection of clusters
clust = lmclus(X, params)
# pick the first cluster
M = manifold(clust, 1)
# obtain indexes of points assigned to the cluster
l = points(M)
# obtain the linear manifold cluster translation vector
mu = mean(M)
# get basis vectors that span manifold as columns of the returned matrix
B = projection(M)
# get separation properties
S = separation(M)