recipes.cpc2.baseline package

Submodules

recipes.cpc2.baseline.compute_haspi module

Compute the HASPI scores.

recipes.cpc2.baseline.compute_haspi.compute_haspi_for_signal(signal_name: str, path: dict) float[source]

Compute the HASPI score for a given signal.

Parameters:
  • signal (str) – name of the signal to process

  • path (dict) – paths to the signals and metadata, as defined in the config

Returns:

HASPI score

Return type:

float

recipes.cpc2.baseline.compute_haspi.parse_cec2_signal_name(signal_name: str) tuple[str, str, str][source]

Parse the CEC2 signal name.

recipes.cpc2.baseline.compute_haspi.run_calculate_haspi(cfg: DictConfig) None[source]

Run the HASPI score computation.

recipes.cpc2.baseline.compute_haspi.set_seed_with_string(seed_string: str) None[source]

Set the random seed with a string.

recipes.cpc2.baseline.evaluate module

Evaluate the predictions against the ground truth correctness values

recipes.cpc2.baseline.evaluate.compute_scores(predictions, labels) dict[source]

Compute the scores for the predictions

recipes.cpc2.baseline.evaluate.evaluate(cfg: DictConfig) None[source]

Evaluate the predictions against the ground truth correctness values

recipes.cpc2.baseline.evaluate.kt_score(x: ndarray, y: ndarray) float[source]

Compute the Kendall’s tau correlation between two arrays

recipes.cpc2.baseline.evaluate.ncc_score(x: ndarray, y: ndarray) float[source]

Compute the normalized cross correlation between two arrays

recipes.cpc2.baseline.evaluate.rmse_score(x: ndarray, y: ndarray) float[source]

Compute the root mean squared error between two arrays

recipes.cpc2.baseline.evaluate.std_err(x: ndarray, y: ndarray) float[source]

Compute the standard error between two arrays

recipes.cpc2.baseline.predict module

Make intelligibility predictions from HASPI scores.

class recipes.cpc2.baseline.predict.LogisticModel[source]

Bases: object

Class to represent a logistic mapping.

Fits a logistic mapping from input values x to output values y.

fit(x, y)[source]

Fit a mapping from x values to y values.

params: np.ndarray | None = None
predict(x)[source]

Predict y values given x.

Raises:

TypeError – If the predict() method is called before fit().

recipes.cpc2.baseline.predict.make_disjoint_train_set(full_df: pandas.DataFrame, test_df: pandas.DataFrame) pandas.DataFrame[source]

Make a disjoint train set for given test samples.

recipes.cpc2.baseline.predict.predict(cfg: DictConfig)[source]

Predict intelligibility from HASPI scores.

Module contents