franc.evaluation.dataset

A representation of a dataset for the evaluation of noise mitigation methods.

Attributes

NDArrayF

Classes

EvaluationDataset

A representation of a dataset for the evaluation of noise mitigation methods.

Module Contents

franc.evaluation.dataset.NDArrayF
class franc.evaluation.dataset.EvaluationDataset(sample_rate, witness_conditioning, target_conditioning, witness_evaluation, target_evaluation, signal_conditioning=None, signal_evaluation=None, name='Unnamed', target_unit='1', supplementary_data=None)

A representation of a dataset for the evaluation of noise mitigation methods.

Provided sequences will be stored as immutable float64 numpy arrays.

Parameters:
  • sample_rate (float) – Sample rate in Hz

  • witness_conditioning (collections.abc.Sequence[collections.abc.Sequence[NDArrayF]]) – witness channel data for the conditioning format: witness_conditioning[sequence_idx][channel_idx][sample_idx]

  • target_conditioning (collections.abc.Sequence[NDArrayF]) – target channel data for the conditioning format: witness_conditioning[sequence_idx][sample_idx]

  • witness_evaluation (collections.abc.Sequence[collections.abc.Sequence[NDArrayF]]) – witness channel data for the evaluation

  • target_evaluation (collections.abc.Sequence[NDArrayF]) – target channel data for the evaluation

  • signal_conditioning (collections.abc.Sequence[NDArrayF] | None) – (Optional) A signal that can be subtracted from the target for performance metrics

  • signal_evaluation (collections.abc.Sequence[NDArrayF] | None) – (Optional) A signal that can be subtracted from the target for performance metrics

  • name (str) – (Optional) a string describing the dataset

  • supplementary_data (dict | None) – (Optional) A dict with additional data passed to the evaluation metrics Must be hashable (only common python built-in types and numpy arrays are allowed)

  • target_unit (str) –

sample_rate: float
witness_conditioning: collections.abc.Sequence[collections.abc.Sequence[NDArrayF]]
target_conditioning: collections.abc.Sequence[NDArrayF]
witness_evaluation: collections.abc.Sequence[collections.abc.Sequence[NDArrayF]]
target_evaluation: collections.abc.Sequence[NDArrayF]
signal_conditioning: collections.abc.Sequence[NDArrayF] | None
signal_evaluation: collections.abc.Sequence[NDArrayF] | None
name: str
target_unit: str
supplementary_data: dict
static _prepare_dataset(witness_inp, target_inp, signal_inp=None)

Convert input to immutable np.float64 arrays and check shape

Parameters:
  • witness_inp (collections.abc.Sequence[collections.abc.Sequence[NDArrayF]]) –

  • target_inp (collections.abc.Sequence[NDArrayF]) –

  • signal_inp (collections.abc.Sequence[NDArrayF] | None) –

Return type:

tuple[collections.abc.Sequence[collections.abc.Sequence[NDArrayF]], collections.abc.Sequence[NDArrayF], collections.abc.Sequence[NDArrayF] | None]

property channel_count: int

Number of witness channels

Return type:

int

property has_signal: bool

Indicates whether the dataset has a signal channel

Return type:

bool

sequence_lengths(which)

Returns the lengths of the evaluation or conditioning sequences

Parameters:

which (str) – A string selecting which sequence will be analyzed. Must be one of the following values: “cond”, “conditioning”, “eval”, or “evaluation”.

Return type:

list[int]

get_min_sequence_len(separate=False)

Get the length of the shortest sequence in the dataset

Parameters:

separate (bool) – If True, returns the minimum separately for conditioning and evaluation data.

Return type:

int | tuple[int, int]

static _hash_wts_data(witness, target, signal=None)

Calculate a hash value for a set of witness, target, signal data

Parameters:
  • witness (collections.abc.Sequence[collections.abc.Sequence[NDArrayF]]) –

  • target (collections.abc.Sequence[NDArrayF]) –

  • signal (collections.abc.Sequence[NDArrayF] | None) –

hash_bytes()

return a hash over the dataset data as a bytes object

Return type:

bytes

hash_str()

return a hash over the dataset data as a string

Return type:

str

__hash__()
Return type:

int

description()

Generate a description of the dataset

Return type:

str