Welcome to torchcluster’s documentation!¶
-
class
torchcluster.dataset.
SimpleDataset
(n_clusters, device='cpu', feature=10, sigma=10)[source]¶ We use this as a simple dataset to test clustering algorithm.
Simple dataset factory’s config.
- Args:
- n_clusters (int) - How many clusters in result.
- Kwargs:
device (string) - Device of tensors.
feature (int) - The dim of each data point.
sigma (float) - Factor of clustering difficulty, the bigger the easier.
-
class
torchcluster.zoo.
KMeans
(n_clusters, tol=0.0001)[source]¶ K-Means algorithm
Spectrum clustering factory’s config.
- Args:
- n_clusters (int) - How many clusters in result.
- Kwargs:
- tol (float) - stop to update when shift is smaller than tol
-
class
torchcluster.zoo.
SpectrumClustering
(n_clusters=None, cluster=None, threshold=2, k=2, eps=1e-05)[source]¶ Spectrum clustering algorithm.
Spectrum clustering factory’s config.
- Kwargs:
n_clusters (int) - how many clusters in result. You do not need it if giving a cluster
cluster (Cluster) - clustering method after spectrum transformation
threshold (int) - threshold of dropping out an edge
k (int) - the number of selected feature
eps (float) – a value added to the denominator for numerical stability.