das.evaluate#

das.evaluate.cli_evaluate(model_save_name: str, verbose: int = 1)[source]#

Evaluate model.

Parameters
  • model_save_name (str) – Stem of the path for the model (and parameters). File to load will be MODEL_SAVE_NAME + _model.h5.

  • verbose (int) – Display progress bar during prediction. Defaults to 1.

das.evaluate.evaluate(model_save_name: str, custom_objects: Optional[Dict[str, Callable]] = None, full_output: bool = True, verbose: int = 1)[source]#

_summary_

Parameters
  • model_save_name (str) – Stem of the path for the model (and parameters). File to load will be MODEL_SAVE_NAME + _model.h5.

  • custom_objects (Dict[str, Callable], optional) – Unused.

  • full_output (bool, optional) – If True, function will return

  • verbose (int, optional) – Display progress bar during prediction. Defaults to 1.

Returns

_description_

Return type

_type_

das.evaluate.evaluate_probabilities(x, y, model: Optional[keras.src.engine.training.Model] = None, params: Optional[Dict] = None, model_savename: Optional[str] = None, verbose: int = 1)[source]#

[summary]

evaluate_probabilities(x, y, model=keras_model, params=params_dict) evaluate_probabilities(x, y, model_savename=save_string) -> will load model and params

Parameters
  • x ([type]) – [description]

  • y ([type]) – [description]

  • model (Union[models.keras.models.Model], optional) – [description]. Defaults to None.

  • params (Union[Dict], optional) – [description]. Defaults to None.

  • model_savename (Union[str], optional) – [description]. Defaults to None.

  • verbose (int, optional) – [description]. Defaults to 1.

Returns

[description]

Return type

[type]

das.evaluate.evaluate_segment_timing(segment_labels_true, segment_labels_pred, samplerate: float, event_tol: float)[source]#

[summary]

Parameters
  • segment_labels_true ([type]) – [description]

  • segment_labels_pred ([type]) – [description]

  • samplerate ([type]) – Hz [description]

  • event_tol ([type]) – seconds [description]

Returns

[description]

Return type

[type]

das.evaluate.evaluate_segments(labels_test, labels_pred, class_names, confmat_as_pandas: bool = False, report_as_dict: bool = False, labels=None)[source]#
Parameters
  • labels_test (List) – [nb_samples,]

  • labels_pred (List) – [nb_samples,]

  • class_names ([type]) – [description]

  • confmat_as_pandas (bool, optional) – [description]. Defaults to False.

  • report_as_dict (bool, optional) – [description]. Defaults to False.

  • labels ([type], optional) – [description]. Defaults to None.

Returns

conf_mat report

das.evaluate.segment_timing(labels, samplerate: float)[source]#

Get onset and offset time (in seconds) for each segment.