Skip to content

Selection

frame_selector

Frame-level seed selection within chosen clusters.

select_seeds

select_seeds(policy_name: str, selected_clusters: List[int], cluster_stats: ClusterStats, cluster_centers: Optional[ndarray], method: str = 'nearest_center', random_state: Optional[int] = None) -> List[SeedResult]

Select one seed frame from each chosen cluster.

Parameters:

Name Type Description Default
policy_name str

Name of the policy that selected the clusters.

required
selected_clusters list of int

Cluster IDs chosen by the policy.

required
cluster_stats dict

Per-cluster frame lists and populations.

required
cluster_centers ndarray or None

Cluster centroids, shape (n_clusters, n_features). Required for nearest_center selection when centers are defined per label index.

required
method str

Selection method: nearest_center or random_frame.

'nearest_center'
random_state int or None

Random seed for random_frame selection.

None

Returns:

Type Description
list of SeedResult

Selected seed frames with metadata.

Raises:

Type Description
ValueError

If method is unknown or centers are missing when required.