• Computes the precision of the predictions with respect to the labels.

    Example:

    const x = tf.tensor2d(
    [
    [0, 0, 0, 1],
    [0, 1, 0, 0],
    [0, 0, 0, 1],
    [1, 0, 0, 0],
    [0, 0, 1, 0]
    ]
    );

    const y = tf.tensor2d(
    [
    [0, 0, 1, 0],
    [0, 1, 0, 0],
    [0, 0, 0, 1],
    [0, 1, 0, 0],
    [0, 1, 0, 0]
    ]
    );

    const precision = tf.metrics.precision(x, y);
    precision.print();

    Parameters

    • yTrue: Tensor<Rank>

      The ground truth values. Expected to contain only 0-1 values.

    • yPred: Tensor<Rank>

      The predicted values. Expected to contain only 0-1 values.

    Returns Tensor

    Precision Tensor.

    Doc

Generated using TypeDoc