tardis.utils#
Utilities module.
This module collects some utility functions, making them accessible to a wider number of modules.
- tardis.utils.load_data(filename, batch_size, n_query_points, seed=None)[source]#
Load data from filename, depending on input type.
- Parameters:
filename (str) – If this points to a file name, the function will attempt to load said file and parse it. Else, the function will consider this as the name of a data set to load.
batch_size (int) – Number of points to sample from data set.
n_query_points (int) – Number of points to use for the subsequent Euclidicity calculations. It is possible to use the full data set.
seed (int, instance of
np.random.Generator
, orNone
) – Seed for the random number generator, or an instance of such a generator. If set toNone
, the default random number generator will be used.
- Returns:
The (subsampled) data set along with its query points is returned.
- Return type:
Tuple of np.array, np.array
- tardis.utils.estimate_scales(X, query_points, k_max)[source]#
Perform simple scale estimation of the data set.
- Parameters:
k_max (int) – Maximum number of neighbours to consider for the local scale estimation.
- Returns:
A list of dictionaries consisting of the minimum and maximum inner and outer radius, respectively.
- Return type:
List of dict