ltsm.prompt_reader.stat_prompt.tsfel.utils package

Submodules

ltsm.prompt_reader.stat_prompt.tsfel.utils.add_personal_features module

ltsm.prompt_reader.stat_prompt.tsfel.utils.add_personal_features.add_feature_json(features_path, json_path)[source]

Adds new feature to features.json.

Parameters:
  • features_path (string) – Personal Python module directory containing new features implementation.

  • json_path (string) – Personal .json file directory containing existing features from TSFEL. New customised features will be added to file in this directory.

ltsm.prompt_reader.stat_prompt.tsfel.utils.calculate_complexity module

ltsm.prompt_reader.stat_prompt.tsfel.utils.calculate_complexity.compute_complexity(feature, domain, json_path, **kwargs)[source]

Computes the feature complexity.

Parameters:
  • feature (string) – Feature name

  • domain (string) – Feature domain

  • json_path (json) – Features json file

  • **kwargs

  • below (See) –

    • features_path (string) –

      Directory of script with personal features

Returns:

  • int – Feature complexity

  • Writes complexity in json file

ltsm.prompt_reader.stat_prompt.tsfel.utils.calculate_complexity.find_best_curve(t, signal)[source]

Finds the best curve.

Parameters:
  • t (nd-array) – Log space

  • signal (nd-array) – Mean execution time array

Returns:

Best fit curve name

Return type:

str

ltsm.prompt_reader.stat_prompt.tsfel.utils.calculate_complexity.n_constant(x, no)[source]

The model function

ltsm.prompt_reader.stat_prompt.tsfel.utils.calculate_complexity.n_linear(x, no)[source]

The model function

ltsm.prompt_reader.stat_prompt.tsfel.utils.calculate_complexity.n_log(x, no)[source]

The model function

ltsm.prompt_reader.stat_prompt.tsfel.utils.calculate_complexity.n_nlog(x, no)[source]

The model function

ltsm.prompt_reader.stat_prompt.tsfel.utils.calculate_complexity.n_squared(x, no)[source]

The model function

ltsm.prompt_reader.stat_prompt.tsfel.utils.progress_bar module

ltsm.prompt_reader.stat_prompt.tsfel.utils.progress_bar.display_progress_bar(iteration, total, out)[source]

Displays progress bar according to python interface.

Parameters:
  • iteration (int) – current iteration

  • total (int) – total iterations

  • out (progress bar notebook output)

ltsm.prompt_reader.stat_prompt.tsfel.utils.progress_bar.progress_bar_notebook(iteration, total=100)[source]

Progress bar for notebooks.

Parameters:
  • iteration (int) – current iteration

  • total (int) – total iterations

Returns:

Progress bar for notebooks

ltsm.prompt_reader.stat_prompt.tsfel.utils.progress_bar.progress_bar_terminal(iteration, total, prefix='', suffix='', decimals=0, length=100, fill='█', printend='\r')[source]

Call in a loop to create terminal progress bar.

iteration: int

current iteration

total: int

total iterations

prefix: str

prefix string

suffix: str

suffix string

decimals: int

positive number of decimals in percent complete

length: int

character length of bar

fill: str

bar fill character

printend: str

end character (e.g. “

“, ” “)

ltsm.prompt_reader.stat_prompt.tsfel.utils.signal_processing module

ltsm.prompt_reader.stat_prompt.tsfel.utils.signal_processing.correlated_features(features, threshold=0.95)[source]

Compute pairwise correlation of features using pearson method

Parameters:
  • features (DataFrame) – features

  • threshold – correlation value for removing highly correlated features

Returns:

correlated features names

Return type:

DataFrame

ltsm.prompt_reader.stat_prompt.tsfel.utils.signal_processing.merge_time_series(data, fs_resample, time_unit)[source]

Time series data interpolation

Parameters:
  • data (dict) – data to interpolate

  • fs_resample – resample sampling frequency

  • time_unit – time unit in seconds

Returns:

Interpolated data

Return type:

DataFrame

ltsm.prompt_reader.stat_prompt.tsfel.utils.signal_processing.signal_window_splitter(signal, window_size, overlap=0)[source]

Splits the signal into windows :type signal: :param signal: input signal :type signal: nd-array or pandas DataFrame :type window_size: :param window_size: number of points of window size :type window_size: int :type overlap: :param overlap: percentage of overlap, value between 0 and 1 (exclusive)

Default: 0

Returns:

list of signal windows

Return type:

list

Module contents