MCPcopy
hub / github.com/tensorflow/tfjs / precision

Function precision

tfjs-layers/src/metrics.ts:62–73  ·  view source on GitHub ↗
(yTrue: Tensor, yPred: Tensor)

Source from the content-addressed store, hash-verified

60}
61
62export function precision(yTrue: Tensor, yPred: Tensor): Tensor {
63 return tidy(() => {
64 const tp = truePositives(yTrue, yPred);
65 const fp = falsePositives(yTrue, yPred);
66
67 const denominator = tfc.add(tp, fp);
68
69 return tfc.cast(
70 tfc.where(tfc.greater(denominator, 0), tfc.div(tp, denominator), 0),
71 'float32');
72 });
73}
74
75export function recall(yTrue: Tensor, yPred: Tensor): Tensor {
76 return tidy(() => {

Callers

nothing calls this directly

Calls 8

tidyFunction · 0.90
truePositivesFunction · 0.85
falsePositivesFunction · 0.85
greaterMethod · 0.80
divMethod · 0.80
addMethod · 0.65
castMethod · 0.65
whereMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…