Calculates the number of true positives

metric_true_positives(..., thresholds = NULL, name = NULL, dtype = NULL)

Arguments

...

Passed on to the underlying metric. Used for forwards and backwards compatibility.

thresholds

(Optional) Defaults to 0.5. A float value or a list of float threshold values in [0, 1]. A threshold is compared with prediction values to determine the truth value of predictions (i.e., above the threshold is true, below is false). One metric value is generated for each threshold value.

name

(Optional) string name of the metric instance.

dtype

(Optional) data type of the metric result.

Value

A (subclassed) Metric instance that can be passed directly to compile(metrics = ), or used as a standalone object. See ?Metric for example usage.

Details

If sample_weight is given, calculates the sum of the weights of true positives. This metric creates one local variable, true_positives that is used to keep track of the number of true positives.

If sample_weight is NULL, weights default to 1. Use sample_weight of 0 to mask values.

See also