Package org.apache.spark.ml.evaluation
Class MultilabelClassificationEvaluator
Object
org.apache.spark.ml.evaluation.Evaluator
org.apache.spark.ml.evaluation.MultilabelClassificationEvaluator
- All Implemented Interfaces:
- Serializable,- Params,- HasLabelCol,- HasPredictionCol,- DefaultParamsWritable,- Identifiable,- MLWritable
public class MultilabelClassificationEvaluator
extends Evaluator
implements HasPredictionCol, HasLabelCol, DefaultParamsWritable
:: Experimental ::
 Evaluator for multi-label classification, which expects two input
 columns: prediction and label.
- See Also:
- 
Constructor SummaryConstructorsConstructorDescription
- 
Method SummaryModifier and TypeMethodDescriptionCreates a copy of this instance with the same UID and some extra params.doubleEvaluates model output and returns a scalar metric.doublegetMetrics(Dataset<?> dataset) Get a MultilabelMetrics, which can be used to get multilabel classification metrics such as accuracy, precision, precisionByLabel, etc.booleanIndicates whether the metric returned byevaluateshould be maximized (true, default) or minimized (false).labelCol()Param for label column name.final DoubleParamparam for the class whose metric will be computed in"precisionByLabel","recallByLabel","f1MeasureByLabel".param for metric name in evaluation (supports"f1Measure"(default),"subsetAccuracy","accuracy","hammingLoss","precision","recall","precisionByLabel","recallByLabel","f1MeasureByLabel","microPrecision","microRecall","microF1Measure")Param for prediction column name.static MLReader<T>read()setLabelCol(String value) setMetricLabel(double value) setMetricName(String value) setPredictionCol(String value) toString()uid()An immutable unique ID for the object and its derivatives.Methods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.spark.ml.util.DefaultParamsWritablewriteMethods inherited from interface org.apache.spark.ml.param.shared.HasLabelColgetLabelColMethods inherited from interface org.apache.spark.ml.param.shared.HasPredictionColgetPredictionColMethods inherited from interface org.apache.spark.ml.util.MLWritablesaveMethods inherited from interface org.apache.spark.ml.param.Paramsclear, copyValues, defaultCopy, defaultParamMap, estimateMatadataSize, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, onParamChange, paramMap, params, set, set, set, setDefault, setDefault, shouldOwn
- 
Constructor Details- 
MultilabelClassificationEvaluator
- 
MultilabelClassificationEvaluatorpublic MultilabelClassificationEvaluator()
 
- 
- 
Method Details- 
load
- 
read
- 
labelColDescription copied from interface:HasLabelColParam for label column name.- Specified by:
- labelColin interface- HasLabelCol
- Returns:
- (undocumented)
 
- 
predictionColDescription copied from interface:HasPredictionColParam for prediction column name.- Specified by:
- predictionColin interface- HasPredictionCol
- Returns:
- (undocumented)
 
- 
uidDescription copied from interface:IdentifiableAn immutable unique ID for the object and its derivatives.- Specified by:
- uidin interface- Identifiable
- Returns:
- (undocumented)
 
- 
metricNameparam for metric name in evaluation (supports"f1Measure"(default),"subsetAccuracy","accuracy","hammingLoss","precision","recall","precisionByLabel","recallByLabel","f1MeasureByLabel","microPrecision","microRecall","microF1Measure")- Returns:
- (undocumented)
 
- 
getMetricName
- 
setMetricName
- 
metricLabelparam for the class whose metric will be computed in"precisionByLabel","recallByLabel","f1MeasureByLabel".- Returns:
- (undocumented)
 
- 
getMetricLabelpublic double getMetricLabel()
- 
setMetricLabel
- 
setPredictionCol
- 
setLabelCol
- 
evaluateDescription copied from class:EvaluatorEvaluates model output and returns a scalar metric. The value ofEvaluator.isLargerBetter()specifies whether larger values are better.
- 
getMetricsGet a MultilabelMetrics, which can be used to get multilabel classification metrics such as accuracy, precision, precisionByLabel, etc.- Parameters:
- dataset- a dataset that contains labels/observations and predictions.
- Returns:
- MultilabelMetrics
 
- 
isLargerBetterpublic boolean isLargerBetter()Description copied from class:EvaluatorIndicates whether the metric returned byevaluateshould be maximized (true, default) or minimized (false). A given evaluator may support multiple metrics which may be maximized or minimized.- Overrides:
- isLargerBetterin class- Evaluator
- Returns:
- (undocumented)
 
- 
copyDescription copied from interface:ParamsCreates a copy of this instance with the same UID and some extra params. Subclasses should implement this method and set the return type properly. SeedefaultCopy().
- 
toString- Specified by:
- toStringin interface- Identifiable
- Overrides:
- toStringin class- Object
 
 
-