# generated by export.py
# origin: ../validate/validate.ipynb
# date: 2017-04-22 20:41:18.953691

from pyspark.ml.evaluation import BinaryClassificationEvaluator
# --------------------

def auc(df, model):
    prediction = model.transform(df)
    evaluator = BinaryClassificationEvaluator()

    metric = evaluator.evaluate(prediction)
    metric_name = evaluator.getMetricName()

    return metric_name, metric
# --------------------
