public class BinaryClassificationEvaluator extends Evaluator implements HasRawPredictionCol, HasLabelCol, HasWeightCol, DefaultParamsWritable
Constructor and Description |
---|
BinaryClassificationEvaluator() |
BinaryClassificationEvaluator(String uid) |
Modifier and Type | Method and Description |
---|---|
BinaryClassificationEvaluator |
copy(ParamMap extra)
Creates a copy of this instance with the same UID and some extra params.
|
double |
evaluate(Dataset<?> dataset)
Evaluates model output and returns a scalar metric.
|
String |
getMetricName() |
BinaryClassificationMetrics |
getMetrics(Dataset<?> dataset)
Get a BinaryClassificationMetrics, which can be used to get binary classification
metrics such as areaUnderROC and areaUnderPR.
|
int |
getNumBins() |
boolean |
isLargerBetter()
Indicates whether the metric returned by
evaluate should be maximized (true, default)
or minimized (false). |
Param<String> |
labelCol()
Param for label column name.
|
static BinaryClassificationEvaluator |
load(String path) |
Param<String> |
metricName()
param for metric name in evaluation (supports
"areaUnderROC" (default), "areaUnderPR" ) |
IntParam |
numBins()
param for number of bins to down-sample the curves (ROC curve, PR curve) in area
computation.
|
Param<String> |
rawPredictionCol()
Param for raw prediction (a.k.a.
|
static MLReader<T> |
read() |
BinaryClassificationEvaluator |
setLabelCol(String value) |
BinaryClassificationEvaluator |
setMetricName(String value) |
BinaryClassificationEvaluator |
setNumBins(int value) |
BinaryClassificationEvaluator |
setRawPredictionCol(String value) |
BinaryClassificationEvaluator |
setWeightCol(String value) |
String |
toString() |
String |
uid()
An immutable unique ID for the object and its derivatives.
|
Param<String> |
weightCol()
Param for weight column name.
|
getRawPredictionCol
getLabelCol
getWeightCol
clear, copyValues, defaultCopy, defaultParamMap, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, onParamChange, paramMap, params, set, set, set, setDefault, setDefault, shouldOwn
write
save
public BinaryClassificationEvaluator(String uid)
public BinaryClassificationEvaluator()
public static BinaryClassificationEvaluator load(String path)
public static MLReader<T> read()
public final Param<String> weightCol()
HasWeightCol
weightCol
in interface HasWeightCol
public final Param<String> labelCol()
HasLabelCol
labelCol
in interface HasLabelCol
public final Param<String> rawPredictionCol()
HasRawPredictionCol
rawPredictionCol
in interface HasRawPredictionCol
public String uid()
Identifiable
uid
in interface Identifiable
public Param<String> metricName()
"areaUnderROC"
(default), "areaUnderPR"
)public String getMetricName()
public BinaryClassificationEvaluator setMetricName(String value)
public IntParam numBins()
public int getNumBins()
public BinaryClassificationEvaluator setNumBins(int value)
public BinaryClassificationEvaluator setRawPredictionCol(String value)
public BinaryClassificationEvaluator setLabelCol(String value)
public BinaryClassificationEvaluator setWeightCol(String value)
public double evaluate(Dataset<?> dataset)
Evaluator
isLargerBetter
specifies whether larger values are better.
public BinaryClassificationMetrics getMetrics(Dataset<?> dataset)
dataset
- a dataset that contains labels/observations and predictions.public boolean isLargerBetter()
Evaluator
evaluate
should be maximized (true, default)
or minimized (false).
A given evaluator may support multiple metrics which may be maximized or minimized.isLargerBetter
in class Evaluator
public BinaryClassificationEvaluator copy(ParamMap extra)
Params
defaultCopy()
.public String toString()
toString
in interface Identifiable
toString
in class Object