BinaryClassificationEvaluator — Evaluator of Binary Classification Models

BinaryClassificationEvaluator is an Evaluator of cross-validate models from binary classifications (e.g. LogisticRegression, RandomForestClassifier, NaiveBayes, DecisionTreeClassifier, MultilayerPerceptronClassifier, GBTClassifier, LinearSVC).

BinaryClassificationEvaluator finds the best model by maximizing the model evaluation metric that is the area under the specified curve (and so isLargerBetter is turned on for either metric).

import org.apache.spark.ml.evaluation.BinaryClassificationEvaluator
val binEval = new BinaryClassificationEvaluator().
  setMetricName("areaUnderROC").
  setRawPredictionCol("rawPrediction").
  setLabelCol("label")

scala> binEval.isLargerBetter
res0: Boolean = true

scala> println(binEval.explainParams)
labelCol: label column name (default: label)
metricName: metric name in evaluation (areaUnderROC|areaUnderPR) (default: areaUnderROC)
rawPredictionCol: raw prediction (a.k.a. confidence) column name (default: rawPrediction)
Table 1. BinaryClassificationEvaluator' Parameters
Parameter Default Value Description

metricName

areaUnderROC

Name of the classification metric for evaluation

Can be either areaUnderROC (default) or areaUnderPR

rawPredictionCol

rawPrediction

Column name with raw predictions (a.k.a. confidence)

labelCol

label

Name of the column with indexed labels (i.e. 0s or 1s)

Evaluating Model Output — evaluate Method

evaluate(dataset: Dataset[_]): Double
Note
evaluate is a part of Evaluator Contract.

evaluate…​FIXME

results matching ""

    No results matching ""