org.apache.spark.ml.classification
Class OneVsRest

Object
  extended by org.apache.spark.ml.PipelineStage
      extended by org.apache.spark.ml.Estimator<OneVsRestModel>
          extended by org.apache.spark.ml.classification.OneVsRest
All Implemented Interfaces:
java.io.Serializable, Logging, Params

public final class OneVsRest
extends Estimator<OneVsRestModel>

:: Experimental ::

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.

See Also:
Serialized Form

Constructor Summary
OneVsRest()
           
OneVsRest(String uid)
           
 
Method Summary
 Param<Classifier<?,? extends Classifier<Object,Classifier,ClassificationModel>,? extends ClassificationModel<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<Object,Classifier,ClassificationModel>,? extends ClassificationModel<Object,ClassificationModel>> getClassifier()
           
 OneVsRest setClassifier(Classifier<?,?,?> value)
           
 StructType transformSchema(StructType schema)
          :: DeveloperApi ::
 String uid()
           
 
Methods inherited from class org.apache.spark.ml.Estimator
fit, fit, fit, fit
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.spark.ml.param.Params
clear, copyValues, defaultCopy, defaultParamMap, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, paramMap, params, set, set, set, setDefault, setDefault, setDefault, shouldOwn, validateParams
 
Methods inherited from interface org.apache.spark.Logging
initializeIfNecessary, initializeLogging, isTraceEnabled, log_, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning
 

Constructor Detail

OneVsRest

public OneVsRest(String uid)

OneVsRest

public OneVsRest()
Method Detail

uid

public String uid()

setClassifier

public OneVsRest setClassifier(Classifier<?,?,?> value)

transformSchema

public StructType transformSchema(StructType schema)
Description copied from class: PipelineStage
:: DeveloperApi ::

Derives the output schema from the input schema.

Specified by:
transformSchema in class PipelineStage
Parameters:
schema - (undocumented)
Returns:
(undocumented)

fit

public OneVsRestModel fit(DataFrame dataset)
Description copied from class: Estimator
Fits a model to the input data.

Specified by:
fit in class Estimator<OneVsRestModel>
Parameters:
dataset - (undocumented)
Returns:
(undocumented)

copy

public OneVsRest copy(ParamMap extra)
Description copied from interface: Params
Creates a copy of this instance with the same UID and some extra params. Subclasses should implement this method and set the return type properly.

Specified by:
copy in interface Params
Specified by:
copy in class Estimator<OneVsRestModel>
Parameters:
extra - (undocumented)
Returns:
(undocumented)
See Also:
defaultCopy()

classifier

public Param<Classifier<?,? extends Classifier<Object,Classifier,ClassificationModel>,? extends ClassificationModel<Object,ClassificationModel>>> classifier()
param for the base binary classifier that we reduce multiclass classification into.

Returns:
(undocumented)

getClassifier

public Classifier<?,? extends Classifier<Object,Classifier,ClassificationModel>,? extends ClassificationModel<Object,ClassificationModel>> getClassifier()