def accuracy(preds: Array, targets: Array) -> jnp.ndarray:
    """
    Compute the accuracy given predictions and target variables.

    Parameters
    ----------
    preds: Array
        A one-dimensional array of predictions over the data points.
    targets: Array
        A one-dimensional array of target variables.

    Returns
    -------
    jnp.ndarray
        The computed accuracy.
    """
    if preds.ndim > 1:
        raise ValueError(
            """`preds` must be a one-dimensional array of predicted classes."""
        )
    if targets.ndim > 1:
        raise ValueError(
            """`targets` must be a one-dimensional array of target classes."""
        )
    return jnp.mean(preds == targets)

    Compute the accuracy given predictions and target variables.

    Parameters
    ----------
    preds: Array
        A one-dimensional array of predictions over the data points.
    targets: Array
        A one-dimensional array of target variables.

    Returns
    -------
    jnp.ndarray
        The computed accuracy.
    
fortuna/metric/classification.py