from typing import Any
from typing import Callable


def guess_model_predict_function(model: Any, use_classif_proba: bool) -> Callable:
    """
    Returns model prediction method guessed from model properties.
    Multi-class classification not implemented yet.
    Parameters
    ----------
    model : scikit-learn model
        Model to compute predictions, `model.predict()` must work
    use_classif_proba : bool
        If True, use `predict_proba` for positive class as model output,
        only used if model is a classifier

    Returns
    -------
    function : Callable
        Prediction method for direct use on data
    """
    if hasattr(model, "classes_"):
        if len(model.classes_) > 2:
            # multiclass
            return model.predict
        else:
            # binary class
            if use_classif_proba:
                return lambda x: model.predict_proba(x)[:, 1]
            return model.predict
    # regression
    return model.predict