Developer / Internal Reference¶
This page contains reference documentation for advanced functional tools for signal processing on learned graphs and other internal utilities.
Measure how each sample uses the axes of a spectral scaffold.
These diagnostics summarize per-sample structure in a fitted DM/msDM scaffold. They are useful for exploratory interpretation: identifying points dominated by one spectral mode, points lying far from the scaffold center, and neighborhoods that are locally axis-like. They are not clustering labels and should be interpreted together with the embedding and graph metrics.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
Z
|
(ndarray, shape(n, m))
|
Spectral scaffold coordinates, where rows are samples and columns are eigenvector-derived coordinates. |
required |
evals
|
ndarray or None
|
Eigenvalues matching the scaffold columns. If provided, they weight axes so smoother or more persistent modes can contribute more strongly. If None, all axes are weighted equally. |
None
|
weight_mode
|
(lambda_over_one_minus_lambda, 'lambda', none, uniform)
|
How eigenvalues are converted to axis weights. |
'lambda_over_one_minus_lambda'
|
standardize
|
bool
|
If True, center and scale scaffold columns before computing diagnostics. |
True
|
k_neighbors
|
int
|
Neighborhood size used for radiality and local axial coherence. |
30
|
metric
|
str
|
Metric used for scaffold-space nearest-neighbor searches. |
'euclidean'
|
P
|
sparse matrix, dense ndarray, or None
|
Optional diffusion operator used to smooth scalar diagnostic fields. |
None
|
smooth_t
|
int
|
Number of smoothing steps when |
0
|
Returns:
| Type | Description |
|---|---|
dict
|
Dictionary with one value per sample:
|
Smooth a one-dimensional graph signal by applying P^t.
The input is one scalar value per sample. Repeated multiplication by the
diffusion operator averages that signal over graph neighborhoods, with
larger t spreading information farther across the fitted geometry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
signal
|
(array - like, shape(n))
|
Scalar per-sample values to smooth. |
required |
P
|
sparse matrix or dense ndarray
|
Diffusion/operator matrix whose rows and columns correspond to samples. |
required |
t
|
int
|
Number of diffusion steps. |
8
|
Returns:
| Type | Description |
|---|---|
(ndarray, shape(n))
|
Smoothed signal with one value per sample. |
Diffuse every column of a data matrix over a graph operator.
This treats each feature column as a graph signal and applies P^t. The
result is a geometry-smoothed version of the input matrix. It is useful for
denoising or exploratory imputation, but the amount of smoothing is entirely
controlled by the fitted operator and t.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
X
|
(array - like or sparse, shape(n, d))
|
Data matrix with one row per graph sample and one column per feature or signal. |
required |
P
|
sparse matrix or dense ndarray
|
Diffusion/operator matrix with shape |
required |
t
|
int
|
Number of diffusion steps. Larger values smooth more aggressively. |
8
|
output
|
(auto, sparse, dense)
|
Output format. |
'auto'
|
dtype
|
numpy dtype
|
Numeric dtype used for the diffusion computation. |
float64
|
Returns:
| Type | Description |
|---|---|
sparse matrix or ndarray
|
Diffused matrix with the same shape as |
Estimate local distortion of a two-dimensional embedding.
The function computes a Riemannian metric field for a 2-D layout relative to a graph Laplacian/operator and optionally derives scalar deformation maps. It is intended for diagnosing where a visualization contracts, expands, or distorts local directions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
Y
|
(ndarray, shape(n, 2))
|
Two-dimensional embedding to diagnose. |
required |
L
|
array-like or sparse matrix
|
Graph Laplacian or operator defining the reference geometry. |
required |
center
|
(median, mean)
|
Center used when converting metric tensors into deformation values. |
'median'
|
diffusion_t
|
int
|
Number of diffusion smoothing steps for deformation maps. |
0
|
diffusion_op
|
sparse matrix, dense ndarray, or None
|
Operator used for smoothing when |
None
|
normalize
|
str
|
Normalization mode passed to the deformation calculation. |
'symmetric'
|
clip_percentile
|
float
|
Percentile used to clip deformation extremes for stable visualization limits. |
2.0
|
return_limits
|
bool
|
If True, include suggested plotting limits for deformation fields. |
True
|
compute_metric
|
bool
|
If True, include the local metric tensor |
True
|
compute_scalars
|
bool
|
If True, include scalar summaries derived from |
True
|
compute_deformation
|
bool
|
If True, include the deformation scalar from |
True
|
Returns:
| Type | Description |
|---|---|
dict
|
Dictionary that may include:
|