Type SpecificityAtSensitivity
Namespace tensorflow.keras.metrics
Parent SensitivitySpecificityBase
Interfaces ISpecificityAtSensitivity
Computes the specificity at a given sensitivity. `Sensitivity` measures the proportion of actual positives that are correctly
identified as such (tp / (tp + fn)).
`Specificity` measures the proportion of actual negatives that are correctly
identified as such (tn / (tn + fp)). This metric creates four local variables, `true_positives`, `true_negatives`,
`false_positives` and `false_negatives` that are used to compute the
specificity at the given sensitivity. The threshold for the given sensitivity
value is computed and used to evaluate the corresponding specificity. If `sample_weight` is `None`, weights default to 1.
Use `sample_weight` of 0 to mask values. For additional information about specificity and sensitivity, see the
following: https://en.wikipedia.org/wiki/Sensitivity_and_specificity Usage:
Usage with tf.keras API:
Show Example
m = tf.keras.metrics.SpecificityAtSensitivity(0.8, num_thresholds=1) m.update_state([0, 0, 1, 1], [0, 0.5, 0.3, 0.9]) print('Final result: ', m.result().numpy()) # Final result: 1.0
Properties
- activity_regularizer
- activity_regularizer_dyn
- built
- dtype
- dtype_dyn
- dynamic
- dynamic_dyn
- false_negatives
- false_positives
- inbound_nodes
- inbound_nodes_dyn
- input
- input_dyn
- input_mask
- input_mask_dyn
- input_shape
- input_shape_dyn
- input_spec
- input_spec_dyn
- losses
- losses_dyn
- metrics
- metrics_dyn
- name
- name_dyn
- name_scope
- name_scope_dyn
- non_trainable_variables
- non_trainable_variables_dyn
- non_trainable_weights
- non_trainable_weights_dyn
- num_thresholds
- outbound_nodes
- outbound_nodes_dyn
- output
- output_dyn
- output_mask
- output_mask_dyn
- output_shape
- output_shape_dyn
- PythonObject
- sensitivity
- stateful
- submodules
- submodules_dyn
- supports_masking
- thresholds
- trainable
- trainable_dyn
- trainable_variables
- trainable_variables_dyn
- trainable_weights
- trainable_weights_dyn
- true_negatives
- true_positives
- updates
- updates_dyn
- value
- variables
- variables_dyn
- weights
- weights_dyn