# tf.compat.v1.metrics.sparse_precision_at_k

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.14.0/tensorflow/python/ops/metrics_impl.py#L3698-L3717) |

Renamed to `precision_at_k`, please use that method instead. (deprecated)

    tf.compat.v1.metrics.sparse_precision_at_k(
        labels,
        predictions,
        k,
        class_id=None,
        weights=None,
        metrics_collections=None,
        updates_collections=None,
        name=None
    )

> [!WARNING]
> **Deprecated:** THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: Use precision_at_k instead