astartes.samplers package

Subpackages

Submodules

astartes.samplers.abstract_sampler module

Abstract Sampling class

class astartes.samplers.abstract_sampler.AbstractSampler(X, y, labels, configs)

Bases: ABC

Abstract Base Class for all samplers.

__init__(X, y, labels, configs)

Copies X, y, labels, and configs into class attributes and then calls sampler.

get_clusters()

Getter for the cluster labels.

Returns:

Cluster labels.

Return type:

np.array

get_config(key, default=None)

Getter to sampler._configs

Parameters:
  • key (str) – String parameter for the sampler.

  • default (any, optional) – Default to return if key not present. Defaults to None.

Returns:

value at provided key, or else default.

Return type:

any

get_sample_idxs(n_samples)

Get idxs of samples.

get_sorted_cluster_counter(max_shufflable_size=None)

Return a dict containing cluster_id: number of members sorted by number of members, ascending

if max_shufflable_size is not None, clusters below the passed size will be shuffled into a new order according to random_state in hopts

Module contents