def outcome_machine_learner(xdata, ydata, all_a, none_a, ml_model,
    continuous, print_results=True):
    """Function to fit machine learning predictions. Used by TMLE to generate predicted probabilities of outcome
    (i.e. Pr(Y=1 | A=1, L) and Pr(Y=1 | A=0, L)). Future update will include continuous Y functionality (i.e. E(Y))
    """
    try:
        fm = ml_model.fit(X=xdata, y=ydata)
    except TypeError:
        raise TypeError(
            "Currently custom_model must have the 'fit' function with arguments 'X', 'y'. This covers both sklearn and supylearner. If there is a predictive model you would like to use, please open an issue at https://github.com/pzivich/zepid and I can work on adding support"
            )
    if print_results and hasattr(fm, 'summarize'):
        fm.summarize()
    if continuous:
        if hasattr(fm, 'predict'):
            qa1 = fm.predict(all_a)
            qa0 = fm.predict(none_a)
            return qa1, qa0
        else:
            raise ValueError(
                "Currently custom_model must have 'predict' or 'predict_proba' attribute"
                )
    elif hasattr(fm, 'predict_proba'):
        qa1 = fm.predict_proba(all_a)
        qa0 = fm.predict_proba(none_a)
        if qa1.ndim == 1 and qa0.ndim == 1:
            return qa1, qa0
        else:
            return qa1[:, (1)], qa0[:, (1)]
    elif hasattr(fm, 'predict'):
        qa1 = fm.predict(all_a)
        qa0 = fm.predict(none_a)
        return qa1, qa0
    else:
        raise ValueError(
            "Currently custom_model must have 'predict' or 'predict_proba' attribute"
            )
