Precision is obtained below by using keras library:
model.compile(optimizer=\'sgd\', loss=\'mse\', metrics=[tf.keras.metrics.Precision()])