ClassifierMetric¶
Inheritance Diagram

-
class
ashpy.metrics.classifier.ClassifierMetric(metric, model_selection_operator=None, logdir=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/ashpy/checkouts/master/docs/source/log'), processing_predictions=None)[source]¶ Bases:
ashpy.metrics.metric.MetricWrap a metric using argmax to extract predictions out of a classifier’s output.
Methods
__init__(metric[, model_selection_operator, …])Initialize the Metric. update_state(context)Update the internal state of the metric, using the information from the context object. Attributes
best_folderRetrieve the folder used to save the best model when doing model selection. best_model_sel_fileRetrieve the path to JSON file containing the measured performance of the best model. logdirRetrieve the log directory. metricRetrieve the tf.keras.metrics.Metricobject.model_selection_operatorRetrieve the operator used for model selection. nameRetrieve the metric name. sanitized_nameall / are _. -
__init__(metric, model_selection_operator=None, logdir=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/ashpy/checkouts/master/docs/source/log'), processing_predictions=None)[source]¶ Initialize the Metric.
Parameters: - metric (
tf.keras.metrics.Metric) – The Keras Metric to use with the classifier (e.g.: Accuracy()). - model_selection_operator (
typing.Callable) –The operation that will be used when model_selection is triggered to compare the metrics, used by the update_state. Any
typing.Callablebehaving like anoperatoris accepted.Note
Model selection is done ONLY if an model_selection_operator is specified here.
- logdir (str) – Path to the log dir, defaults to a log folder in the current directory.
- processing_predictions (
typing.Dict) – A dict in the form of {“fn”: tf.argmax, “kwargs”: {“axis”: -1}} with a function “fn” to be used for predictions processing purposes and its “kwargs” as its keyword-arguments. Defaults to {“fn”: tf.argmax, “kwargs”: {“axis”: -1}}.
Return type: None- metric (
-