spectral-clustering-0.2.1.2: Library for spectral clustering.

Math.Clustering.Spectral.Sparse

Synopsis

# Documentation

newtype B Source #

Constructors

 B FieldsunB :: SpMatrix Double
Instances
 Source # Instance detailsDefined in Math.Clustering.Spectral.Sparse MethodsshowsPrec :: Int -> B -> ShowS #show :: B -> String #showList :: [B] -> ShowS #

newtype B1 Source #

Constructors

 B1 FieldsunB1 :: SpMatrix Double
Instances
 Source # Instance detailsDefined in Math.Clustering.Spectral.Sparse MethodsshowsPrec :: Int -> B1 -> ShowS #show :: B1 -> String #showList :: [B1] -> ShowS #

newtype B2 Source #

Constructors

 B2 FieldsunB2 :: SpMatrix Double
Instances
 Source # Instance detailsDefined in Math.Clustering.Spectral.Sparse MethodsshowsPrec :: Int -> B2 -> ShowS #show :: B2 -> String #showList :: [B2] -> ShowS #

spectral :: Int -> Int -> B -> [SpVector Double] Source #

Returns the second left singular vector (or from N) and E on of a sparse spectral process. Assumes the columns are features and rows are observations. B is the normalized matrix (from getB). See Shu et al., "Efficient Spectral Neighborhood Blocking for Entity Resolution", 2011.

spectralCluster :: B -> LabelVector Source #

Returns a vector of cluster labels for two groups by finding the second left singular vector of a special normalized matrix. Assumes the columns are features and rows are observations. B is the normalized matrix (from getB). See Shu et al., "Efficient Spectral Neighborhood Blocking for Entity Resolution", 2011.

spectralClusterK :: Int -> Int -> B -> LabelVector Source #

Returns a vector of cluster labels for two groups by finding the second left singular vector and on of a special normalized matrix and running kmeans. Assumes the columns are features and rows are observations. B is the normalized matrix (from getB). See Shu et al., "Efficient Spectral Neighborhood Blocking for Entity Resolution", 2011.

Returns the eigenvector with the second smallest eigenvalue (or N start) and E on of the symmetric normalized Laplacian L. Computes real symmetric part of L, so ensure the input is real and symmetric. Diagonal should be 0s for adjacency matrix. Uses I + Lnorm instead of I - Lnorm to find second largest singular value instead of second smallest for Lnorm.

spectralClusterNorm :: AdjacencyMatrix -> LabelVector Source #

Returns the eigenvector with the second smallest eigenvalue of the symmetric normalized Laplacian L. Computes real symmetric part of L, so ensure the input is real and symmetric. Diagonal should be 0s for adjacency matrix. Clusters the eigenvector by sign.

spectralClusterKNorm :: Int -> Int -> AdjacencyMatrix -> LabelVector Source #

Returns the eigenvector with the second smallest eigenvalue and on of the symmetric normalized Laplacian L. Computes real symmetric part of L, so ensure the input is real and symmetric. Diagonal should be 0s for adjacency matrix. Clusters the eigenvector using kmeans into k groups.

Get the normalized matrix B from an input matrix where the features are columns and rows are observations. Optionally, do not normalize.

Normalize the input matrix by column. Here, columns are features.

Get the cosine similarity between two rows using B2.