pyhctsa.utils.get_dataset_features

pyhctsa.utils.get_dataset_features(which='e1000')

Load the precomputed features of the default feature set for a downloadable dataset.

Returns the full feature matrix of get_dataset()’s "e1000" or "1000x1000" dataset, computed with pyhctsa 2.0.0 and its default configuration, so that it need not be computed again. The first call downloads the file (44 MB for "e1000", 40 MB for "1000x1000") into the same cache directory as get_dataset() (~/.cache/pyhctsa; set PYHCTSA_DATA_DIR to use another directory) and verifies its size and SHA-256 digest. Later calls read the cached copy.

These are pyhctsa features, and they are not the same as the hctsa features published in the same figshare record. The record also holds a feature matrix computed with hctsa, the MATLAB toolbox (HCTSA_Empirical1000.mat or HCTSA_1000x1000.mat, and the same values in hctsa_datamatrix.csv). That is a different feature set: the 6392 features of hctsa v3.0.1, with hctsa names, against pyhctsa’s 6406. pyhctsa leaves out some hctsa features, adds features of its own and computes some others differently, so a column of one matrix cannot be assumed to equal any column of the other. MATLAB users of hctsa should use the hctsa files; Python users should use this function, which loads the pyhctsa file only. The hctsa function mappings page maps hctsa function names to their pyhctsa equivalents.

Parameters:
which : str, default="e1000"

"e1000" (Empirical1000; or "Empirical1000") or "1000x1000" (the 1000×1000 collection; or "S1000"), as in get_dataset(). Not case-sensitive.

Returns:

The Results named tuple that load_results() returns, (values, quality, errors, calc_time, meta). values is a 1000 × 6406 DataFrame (NaN wherever the quality is not Quality.GOOD), quality holds the Quality code of each value, errors lists the feature functions that raised, calc_time holds the seconds per series and feature function, and meta records what produced the values (the pyhctsa version and commit, the configuration’s SHA-256, the dataset and the SHA-256 of its series file).

The rows are labelled ts_1 to ts_1000: row ts_{i+1} holds the features of get_dataset(which)[i].

Return type:

Results

Raises:
  • ValueError – If which names no dataset with precomputed features.

  • RuntimeError – If this version of pyhctsa does not know the file’s download URL.

  • ConnectionError – If the file is not cached and cannot be downloaded.

Warns:

UserWarning – If the file was computed with a pyhctsa version or a default configuration other than the installed one (a different configuration hash means that the feature set may differ), or from a series file other than the one get_dataset() loads. The values are returned anyway; recompute them with extract() if the difference matters.

Notes

The values were computed on Linux x86-64. Recomputing them on Linux x86-64 gives bitwise-identical values, but on macOS arm64 about 0.5% of the values differ, in a few numerically sensitive features (for example force_potential_*, ssa_*, armax_*, state_space_n4sid_* and gp_hyperparameters_*).

Examples

>>> from pyhctsa.utils import get_dataset, get_dataset_features
>>> res = get_dataset_features("e1000")
>>> res.values.shape
(1000, 6406)
>>> x = get_dataset("e1000")[0]             # the series of row 'ts_1'