public final class OneVsRest extends Estimator<OneVsRestModel>
Reduction of Multiclass Classification to Binary Classification. Performs reduction using one against all strategy. For a multiclass classification with k classes, train k models (one per class). Each example is scored against all k models and the model with highest score is picked to label the example.
Constructor and Description |
---|
OneVsRest() |
OneVsRest(java.lang.String uid) |
Modifier and Type | Method and Description |
---|---|
Param<Classifier<?,? extends Classifier<java.lang.Object,Classifier,ClassificationModel>,? extends ClassificationModel<java.lang.Object,ClassificationModel>>> |
classifier()
param for the base binary classifier that we reduce multiclass classification into.
|
OneVsRest |
copy(ParamMap extra)
Creates a copy of this instance with the same UID and some extra params.
|
OneVsRestModel |
fit(DataFrame dataset)
Fits a model to the input data.
|
Classifier<?,? extends Classifier<java.lang.Object,Classifier,ClassificationModel>,? extends ClassificationModel<java.lang.Object,ClassificationModel>> |
getClassifier() |
OneVsRest |
setClassifier(Classifier<?,?,?> value) |
OneVsRest |
setFeaturesCol(java.lang.String value) |
OneVsRest |
setLabelCol(java.lang.String value) |
OneVsRest |
setPredictionCol(java.lang.String value) |
StructType |
transformSchema(StructType schema)
:: DeveloperApi ::
|
java.lang.String |
uid()
An immutable unique ID for the object and its derivatives.
|
transformSchema
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clear, copyValues, defaultCopy, defaultParamMap, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, paramMap, params, set, set, set, setDefault, setDefault, shouldOwn, validateParams
toString
initializeIfNecessary, initializeLogging, isTraceEnabled, log_, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning
public java.lang.String uid()
Identifiable
uid
in interface Identifiable
public OneVsRest setClassifier(Classifier<?,?,?> value)
public OneVsRest setLabelCol(java.lang.String value)
public OneVsRest setFeaturesCol(java.lang.String value)
public OneVsRest setPredictionCol(java.lang.String value)
public StructType transformSchema(StructType schema)
PipelineStage
Derives the output schema from the input schema.
transformSchema
in class PipelineStage
schema
- (undocumented)public OneVsRestModel fit(DataFrame dataset)
Estimator
fit
in class Estimator<OneVsRestModel>
dataset
- (undocumented)public OneVsRest copy(ParamMap extra)
Params
copy
in interface Params
copy
in class Estimator<OneVsRestModel>
extra
- (undocumented)defaultCopy()
public Param<Classifier<?,? extends Classifier<java.lang.Object,Classifier,ClassificationModel>,? extends ClassificationModel<java.lang.Object,ClassificationModel>>> classifier()
OneVsRest
.public Classifier<?,? extends Classifier<java.lang.Object,Classifier,ClassificationModel>,? extends ClassificationModel<java.lang.Object,ClassificationModel>> getClassifier()