tssearch.utils package

Submodules

tssearch.utils.add_personal_distance module

tssearch.utils.add_personal_distance.add_distance_json(distances_path, json_path)[source]

Adds new distance to features.json. :param distances_path: Personal Python module directory containing new distances implementation. :type distances_path: string :param json_path: Personal .json file directory containing existing disatnces from TSSEARCH.

System Message: ERROR/3 (/home/docs/checkouts/readthedocs.org/user_builds/tssearch/envs/stable/lib/python3.7/site-packages/tssearch-0.1.3-py3.7.egg/tssearch/utils/add_personal_distance.py:docstring of tssearch.utils.add_personal_distance.add_distance_json, line 5)

Unexpected indentation.
New customised distances will be added to file in this directory.

System Message: WARNING/2 (/home/docs/checkouts/readthedocs.org/user_builds/tssearch/envs/stable/lib/python3.7/site-packages/tssearch-0.1.3-py3.7.egg/tssearch/utils/add_personal_distance.py:docstring of tssearch.utils.add_personal_distance.add_distance_json, line 6)

Block quote ends without a blank line; unexpected unindent.

tssearch.utils.distances_settings module

tssearch.utils.distances_settings.get_distance_dict(dist_list)[source]
tssearch.utils.distances_settings.get_distances_by_type(domain=None, json_path=None)[source]

Creates a dictionary with the features settings by domain. :param domain: Available domains: “statistical”; “spectral”; “temporal”

System Message: ERROR/3 (/home/docs/checkouts/readthedocs.org/user_builds/tssearch/envs/stable/lib/python3.7/site-packages/tssearch-0.1.3-py3.7.egg/tssearch/utils/distances_settings.py:docstring of tssearch.utils.distances_settings.get_distances_by_type, line 3)

Unexpected indentation.
If domain equals None, then the features settings from all domains are returned.

System Message: WARNING/2 (/home/docs/checkouts/readthedocs.org/user_builds/tssearch/envs/stable/lib/python3.7/site-packages/tssearch-0.1.3-py3.7.egg/tssearch/utils/distances_settings.py:docstring of tssearch.utils.distances_settings.get_distances_by_type, line 4)

Block quote ends without a blank line; unexpected unindent.
Parameters:json_path (string) – Directory of json file. Default: package features.json directory
Returns:Dictionary with the features settings
Return type:Dict
tssearch.utils.distances_settings.load_json(json_path)[source]

Loads the json file given by filename. :param json_path: Json path :type json_path: string

Returns:Dictionary
Return type:Dict

tssearch.utils.preprocessing module

tssearch.utils.preprocessing.interpolation(x, y)[source]

Computes the interpolation given two time series of different length.

Parameters:
  • x (nd-array) – Time series x
  • y (nd-array) – Time series y
Returns:

  • interp_signal (nd-array) – Interpolated signal
  • nd-array – Time series

tssearch.utils.preprocessing.standardization(signal, fit=False, param=None)[source]

Normalizes a given signal by subtracting the mean and dividing by the standard deviation.

Parameters:signal (nd-array) – input signal
Returns:standardized signal
Return type:nd-array

tssearch.utils.visualisation module

tssearch.utils.visualisation.plot_alignment(ref_signal, estimated_signal, path, **kwargs)[source]

This functions plots the resulted alignment of two sequences given the path calculated by the Dynamic Time Warping algorithm.

Parameters:
  • ref_signal – (array-like) The reference sequence.
  • estimated_signal – (array-like) The estimated sequence.
  • path – (array-like) A 2D array congaing the path resulted from the algorithm
  • **kwargs

    See below:

    • offset (double) –
      The offset used to move the reference signal to an upper position for visualization purposes. (default: 2)
    • linewidths (list) –
      A list containing the linewidth for the reference, estimated and connection plots, respectively. (default: [3, 3, 0.5])
    • step (int) –
      The step for

      System Message: WARNING/2 (/home/docs/checkouts/readthedocs.org/user_builds/tssearch/envs/stable/lib/python3.7/site-packages/tssearch-0.1.3-py3.7.egg/tssearch/utils/visualisation.py:docstring of tssearch.utils.visualisation.plot_alignment, line 25)

      Definition list ends without a blank line; unexpected unindent.

      (default: 2)

    • colors (list) – A list containing the colors for the reference, estimated and connection plots, respectively. (default: [sns.color_palette()[0], sns.color_palette()[1], 'k'])
tssearch.utils.visualisation.plot_costmatrix(matrix, path)[source]

This functions overlays the optimal warping path and the cost matrices :param matrix: (ndarray-like)

System Message: ERROR/3 (/home/docs/checkouts/readthedocs.org/user_builds/tssearch/envs/stable/lib/python3.7/site-packages/tssearch-0.1.3-py3.7.egg/tssearch/utils/visualisation.py:docstring of tssearch.utils.visualisation.plot_costmatrix, line 3)

Unexpected indentation.
The cost matrix (local cost or accumulated)

System Message: WARNING/2 (/home/docs/checkouts/readthedocs.org/user_builds/tssearch/envs/stable/lib/python3.7/site-packages/tssearch-0.1.3-py3.7.egg/tssearch/utils/visualisation.py:docstring of tssearch.utils.visualisation.plot_costmatrix, line 4)

Block quote ends without a blank line; unexpected unindent.
Parameters:path – (ndarray-like) The optimal warping path
Returns:(void) Plots the optimal warping path with an overlay of the cost matrix.
tssearch.utils.visualisation.plot_search_distance_result(res, sequence, ts=None, cmap_name='viridis')[source]
tssearch.utils.visualisation.plot_weight_query(x, query, weight, cmap='viridis', axs=None, fig=None)[source]

Module contents