def create_formula()

in Python/length_of_stay_utils.py [0:0]


def create_formula(response, features, to_remove=None):
    if to_remove is None:
        feats = [x for x in features if x not in [response]]
    else:
        feats = [x for x in features if x not in to_remove and x not in [response]]
    formula = "{} ~ ".format(response) + " + ".join(feats)
    return formula