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).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
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) |
Parameter | Default Value | Description |
---|---|---|
|
Name of the classification metric for evaluation Can be either |
|
|
Column name with raw predictions (a.k.a. confidence) |
|
|
Name of the column with indexed labels (i.e. |
Evaluating Model Output — evaluate
Method
1 2 3 4 5 |
evaluate(dataset: Dataset[_]): Double |
Note
|
evaluate is part of Evaluator Contract.
|
evaluate
…FIXME