timeeval.utils package

timeeval.utils.datasets module

timeeval.utils.datasets.extract_features(df: DataFrame) ndarray
timeeval.utils.datasets.extract_labels(df: DataFrame) ndarray
timeeval.utils.datasets.load_dataset(path: Path) DataFrame
timeeval.utils.datasets.load_labels_only(path: Path) ndarray

timeeval.utils.encode_params module

timeeval.utils.encode_params.dump_params(params: Params, fh: Union[str, Path, TextIO]) None
timeeval.utils.encode_params.dumps_params(params: Params) str

timeeval.utils.hash_dict module

timeeval.utils.hash_dict.hash_dict(x: Mapping[Any, Any]) str

timeeval.utils.label_formatting module

timeeval.utils.label_formatting.id2labels(ids: ndarray, data_length: int) ndarray
timeeval.utils.label_formatting.labels2id(labels: ndarray) ndarray

timeeval.utils.results_path module

timeeval.utils.results_path.generate_experiment_path(base_results_dir: Path, algorithm_name: str, hyper_params_id: str, collection_name: str, dataset_name: str, repetition_number: int) Path

timeeval.utils.tqdm_joblib module

timeeval.utils.tqdm_joblib.tqdm_joblib(tqdm_object: tqdm) Generator[tqdm, None, None]

Context manager to patch joblib to report into tqdm progress bar given as argument.

Directly taken from https://stackoverflow.com/a/58936697.

Examples

>>> import time
>>> from joblib import Parallel, delayed
>>>
>>> def some_method(wait_time):
>>>     time.sleep(wait_time)
>>>
>>> with tqdm_joblib(tqdm(desc="Sleeping method", total=10)):
>>>     Parallel(n_jobs=2)(delayed(some_method)(0.2) for i in range(10))

timeeval.utils.window module

class timeeval.utils.window.Method(value)

Bases: Enum

An enumeration.

MEAN = 0
MEDIAN = 1
SUM = 2
fn(x: ndarray, axis: Optional[int] = None) ndarray
class timeeval.utils.window.ReverseWindowing(window_size: int, reduction: Method = Method.MEAN, n_jobs: int = 1, chunksize: Optional[int] = None, force_iterative: bool = False)

Bases: TransformerMixin

fit_transform(X: ndarray, y=None, **fit_params) ndarray

Fit to data, then transform it.

Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X.

Parameters
  • X (array-like of shape (n_samples, n_features)) – Input samples.

  • y (array-like of shape (n_samples,) or (n_samples, n_outputs), default=None) – Target values (None for unsupervised transformations).

  • **fit_params (dict) – Additional fit parameters.

Returns

X_new – Transformed array.

Return type

ndarray array of shape (n_samples, n_features_new)

timeeval.utils.window.padding_borders(scores: ndarray, input_size: int) ndarray