org.apache.spark.ml.classification
Class DecisionTreeClassifier

Object
  extended by org.apache.spark.ml.PipelineStage
      extended by org.apache.spark.ml.Estimator<M>
          extended by org.apache.spark.ml.Predictor<Vector,DecisionTreeClassifier,DecisionTreeClassificationModel>
              extended by org.apache.spark.ml.classification.DecisionTreeClassifier
All Implemented Interfaces:
java.io.Serializable, Logging, Params

public final class DecisionTreeClassifier
extends Predictor<Vector,DecisionTreeClassifier,DecisionTreeClassificationModel>

:: Experimental :: Decision tree learning algorithm for classification. It supports both binary and multiclass labels, as well as both continuous and categorical features.

See Also:
Serialized Form

Constructor Summary
DecisionTreeClassifier()
           
DecisionTreeClassifier(String uid)
           
 
Method Summary
 DecisionTreeClassifier copy(ParamMap extra)
          Creates a copy of this instance with the same UID and some extra params.
 DecisionTreeClassifier setCacheNodeIds(boolean value)
           
 DecisionTreeClassifier setCheckpointInterval(int value)
           
 DecisionTreeClassifier setImpurity(String value)
           
 DecisionTreeClassifier setMaxBins(int value)
           
 DecisionTreeClassifier setMaxDepth(int value)
           
 DecisionTreeClassifier setMaxMemoryInMB(int value)
           
 DecisionTreeClassifier setMinInfoGain(double value)
           
 DecisionTreeClassifier setMinInstancesPerNode(int value)
           
static String[] supportedImpurities()
          Accessor for supported impurities: entropy, gini
 String uid()
           
 StructType validateAndTransformSchema(StructType schema, boolean fitting, DataType featuresDataType)
          Validates and transforms the input schema with the provided param map.
 
Methods inherited from class org.apache.spark.ml.Predictor
fit, setFeaturesCol, setLabelCol, setPredictionCol, transformSchema
 
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

DecisionTreeClassifier

public DecisionTreeClassifier(String uid)

DecisionTreeClassifier

public DecisionTreeClassifier()
Method Detail

supportedImpurities

public static final String[] supportedImpurities()
Accessor for supported impurities: entropy, gini


uid

public String uid()

setMaxDepth

public DecisionTreeClassifier setMaxDepth(int value)

setMaxBins

public DecisionTreeClassifier setMaxBins(int value)

setMinInstancesPerNode

public DecisionTreeClassifier setMinInstancesPerNode(int value)

setMinInfoGain

public DecisionTreeClassifier setMinInfoGain(double value)

setMaxMemoryInMB

public DecisionTreeClassifier setMaxMemoryInMB(int value)

setCacheNodeIds

public DecisionTreeClassifier setCacheNodeIds(boolean value)

setCheckpointInterval

public DecisionTreeClassifier setCheckpointInterval(int value)

setImpurity

public DecisionTreeClassifier setImpurity(String value)

copy

public DecisionTreeClassifier 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 Predictor<Vector,DecisionTreeClassifier,DecisionTreeClassificationModel>
Parameters:
extra - (undocumented)
Returns:
(undocumented)
See Also:
defaultCopy()

validateAndTransformSchema

public StructType validateAndTransformSchema(StructType schema,
                                             boolean fitting,
                                             DataType featuresDataType)
Validates and transforms the input schema with the provided param map.

Parameters:
schema - input schema
fitting - whether this is in fitting
featuresDataType - SQL DataType for FeaturesType. E.g., VectorUDT for vector features.
Returns:
output schema