Input Output¶
- inpout.load_df(path)[source]¶
Loading a parquet file to a pandas DataFrame. Return this pandas DataFrame.
- Args:
path: Path of the under loading DataFrame.
- Return:
pandas DataFrame.
- inpout.load_mdmp_from_h5(dir_path, name, k)[source]¶
Load a multidimensional matrix profile that has been saved as a pair of hdf5 files.
- Args:
dir_path: Path of the directory where the file is located. name: Name that follows the default prefix. (i.e. mp_multivariate_<name>.h5) k: Specifies which K-dimensional matrix profile to load.(i.e. k=2 loads the 2-D matrix profile
- Return:
mp: matrix profile/stumpy distances index: matrix profile/stumpy indexes
- inpout.load_mp(path)[source]¶
Load the Uni variate/Multivariate Matrix profile which was saved from Create_mp in a .npz file.
- Args:
path: Path of the directory where the file is saved.
- Return:
mp: Matrix profile Distances mpi: Matrix profile Indices
- inpout.save_mdmp_as_h5(dir_path, name, mps, idx, k=0)[source]¶
Save a multidimensional matrix profile as a pair of hdf5 files. Input is based on the output of Args:
dir_path: Path of the directory where the file will be saved. name: Name that will be appended to the file after a default prefix. (i.e. mp_multivariate_<name>.h5) mps: The multi-dimensional matrix profile. Each row of the array corresponds
to each matrix profile for a given dimension(i.e., the first row is the 1-D matrix profile and the second row is the 2-D matrix profile).
idx: The multi-dimensional matrix profile index where each row of the array corresponds to each matrix profile index for a given dimension. k: If mps and idx are one-dimensional k can be used to specify the given dimension of the matrix profile.
The default value specifies the 1-D matrix profile. If mps and idx are multi-dimensional, k is ignored.
Return:
- inpout.save_results(results_dir, sub_dir_name, p, df_stats, m, radius, ez, k, max_neighbors)[source]¶
Save the results of a specific run in the directory specified by the results_dir and sub_dir_name. The results contain some figures that are created with an adaptation of the matrix profile foundation visualize() function. The adaptation works for multi dimensional time series and can be found at (https://github.com/MORE-EU/matrixprofile/blob/master/matrixprofile/visualize.py) as visualize_md(). Args:
results_dir: Path of the directory where the results will be saved. sub_dir_name: Path of the sub directory where the results will be saved. p: A profile object as it is defined in the matrix profile foundation python library. df_stats: DataFrame with the desired statistics that need to be saved. m: The subsequence window size. ez: The exclusion zone to use. radius: The radius to use. k: The number of the top motifs that were calculated. max_neighbors: The maximum amount of neighbors to find for each of the top k motifs.
- Return:
None