from typing import Any


def useful_tree_predicate(
    y: Any, raw_predictions: Any, previous_loss: float, current_loss: float
) -> bool:
    """This predicated tells whether `current_loss < previous_loss`.

    This implies that only usefull trees (the ones that lower the
    overall loss) will be added to the ensemble. Trees that increase the
    loss will be discarded.
    """
    return current_loss < previous_loss