def transform_test(true, pred):
    """Transform true and predicted raster data sets to
    flat arrays.

    Parameters
    ----------
    true : array-like
        Testing data set raster as a 2D NumPy array.
    pred : array-like
        Predicted values as a 2D NumPy array.

    Returns
    -------
    y_true : array
        1D array of true labels of shape (n_samples).
    y_pred : array
        1D array of predicted labels of shape (n_samples).
    """
    y_pred = pred[true > 0].ravel()
    y_true = true[true > 0].ravel()
    return y_true, y_pred