att.transitions¶
- class att.transitions.TransitionDetector(window_size=500, step_size=50, max_dim=1, backend='ripser', subsample=None)[source]¶
Bases:
objectDetect topological transitions via sliding-window persistent homology.
- Parameters:
- fit_transform(X, seed=None, embedding_dim=None, embedding_delay=None)[source]¶
Run sliding-window PH on input data.
- Parameters:
X (array) – If 2D (n_points, dim): pre-embedded point cloud. Windows the cloud directly. If 1D (n_samples,): time series. Embeds each window separately (requires embedding_dim and embedding_delay).
seed (random seed for subsampling)
embedding_dim (embedding dimension (required for 1D input))
embedding_delay (embedding delay (required for 1D input))
- Returns:
topology_timeseries: list of fit_transform results per window distances: list of bottleneck distances between consecutive windows image_distances: list of L2 distances between consecutive persistence images window_centers: array of center sample indices transition_scores: array (same as image_distances, the default score)
- Return type:
dict with keys
- detect_changepoints(method='cusum', threshold=None)[source]¶
Detect changepoints in the transition score series.
- Parameters:
method ("cusum" or "threshold")
threshold (detection threshold. Default: mean + 2*std for cusum,) – mean + 2*std for threshold.
- Returns:
List of indices into window_centers[
- Return type:
-1] where transitions detected.
- class att.transitions.TransitionDetector(window_size=500, step_size=50, max_dim=1, backend='ripser', subsample=None)[source]¶
Bases:
objectDetect topological transitions via sliding-window persistent homology.
- Parameters:
- fit_transform(X, seed=None, embedding_dim=None, embedding_delay=None)[source]¶
Run sliding-window PH on input data.
- Parameters:
X (array) – If 2D (n_points, dim): pre-embedded point cloud. Windows the cloud directly. If 1D (n_samples,): time series. Embeds each window separately (requires embedding_dim and embedding_delay).
seed (random seed for subsampling)
embedding_dim (embedding dimension (required for 1D input))
embedding_delay (embedding delay (required for 1D input))
- Returns:
topology_timeseries: list of fit_transform results per window distances: list of bottleneck distances between consecutive windows image_distances: list of L2 distances between consecutive persistence images window_centers: array of center sample indices transition_scores: array (same as image_distances, the default score)
- Return type:
dict with keys
- detect_changepoints(method='cusum', threshold=None)[source]¶
Detect changepoints in the transition score series.
- Parameters:
method ("cusum" or "threshold")
threshold (detection threshold. Default: mean + 2*std for cusum,) – mean + 2*std for threshold.
- Returns:
List of indices into window_centers[
- Return type:
-1] where transitions detected.