Result of Spatex.Region.spenc/3.
labels- cluster of each area, in graph order,0-based. Spectral clustering does not guarantee that clusters are contiguous on the graph.n_clusters- number of distinct clusters inlabels.assign_labels-:discretize,:kmeansor:hierarchical, the strategy used (spopt switches to:hierarchicalitself whenn_clustersis:infinity).seed- the seed used for the random stages (a drawn one is recorded here);nilfor:hierarchical, which is deterministic.start_row- for:discretize, the embedding row the random rotation was initialised from (spopt draws it fromrandom_state;sklearn'sdiscretizeis a function of it alone).nilotherwise.eigenvalues- then_clusterssmallest eigenvalues of the normalized Laplacian, ascending ([]for:hierarchical).embedding- then x n_clustersspectral embedding spopt callsembedding_: eigenvectors divided by the square root of the affinity degrees, each with its largest-magnitude entry positive. Rows of lists, or anNx.Tensorwithkeep_embedding: :tensor;nilunless kept and for:hierarchical.affinity_matrix- the densen x naffinity (affinity_matrix_) whenkeep_affinityis set, elsenil.warnings- for example a disconnected graph, which spopt also warns about.
Summary
Types
@type t() :: %Spatex.Region.Spenc{ affinity_matrix: [[float()]] | Nx.Tensor.t() | nil, assign_labels: :discretize | :kmeans | :hierarchical, eigenvalues: [float()], embedding: [[float()]] | Nx.Tensor.t() | nil, labels: [non_neg_integer()], n_clusters: non_neg_integer(), seed: non_neg_integer() | nil, start_row: non_neg_integer() | nil, warnings: [String.t()] }