// Importing the tensorflow.js library
import * as tf from "@tensorflow/tfjs"
// Calling metrics.precision() method with
// its parameter directly and then
// Printing output
const output = tf.metrics.precision(tf.tensor(
[
[0, 1, 0, 0],
[0, 1, 1, 0],
[0, 0, 0, 1],
[1, 1, 0, 0],
[0, 0, 1, 0]
]
), tf.tensor(
[
[0, 0, 1, 1],
[0, 1, 1, 0],
[0, 0, 0, 1],
[0, 1, 0, 1],
[1, 1, 0, 0]
]
)).print();