SpectralConfig
VariantSpectral clustering.
Properties
kinteger≥ 2Number of clusters. Must be at least 2 and no more than the number of cases.
kernelstringSimilarity measure the affinity matrix is built from: "rbf" = Gaussian, with one width shared by every case; "rbf_local" = Gaussian with a per-case width taken from the distance to its seventh nearest neighbor, which lets one clustering hold groups of differing density; "laplace" = exponential, which decays more slowly than the Gaussian and so keeps more weight on distant pairs.
one of
"rbf""rbf_local""laplace"sigmanumber | null> 0Inverse kernel width: larger values make the affinity fall off faster with distance. Unset estimates it for "rbf" by searching a grid of widths for the one whose embedding clusters most tightly, and uses 1 for "laplace". Applies only when kernel is "rbf" or "laplace".
sigma_sample_fractionnumber | null≤ 1> 0Fraction of the cases the kernel width is estimated from. Lowering it is the way to make the search affordable on many cases, since it decomposes one affinity matrix per candidate width. Used only when "sigma" is unset, which is what triggers the search. Unset uses three quarters of them. Applies only when kernel is "rbf".
iterationsinteger≥ 1Maximum number of k-means iterations run on the spectral embedding.
nystrombooleanApproximate the affinity matrix from a sample of the cases by the Nystrom method, rather than decomposing it in full. The exact decomposition is cubic in the number of cases; this trades some accuracy for a cost set by the sample size instead. Cannot be combined with the "rbf_local" kernel, whose per-case widths need every pairwise distance.
nystrom_sampleinteger | null≥ 1Number of cases the approximation samples. Must be fewer than the number of cases, and enough larger than the number of clusters for the sample to be clustered on its own. Unset samples one sixth of the cases. Applies only when nystrom is true.
Relationships
Used by