public class DecisionTreeClassifier extends ProbabilisticClassifier<Vector,DecisionTreeClassifier,DecisionTreeClassificationModel> implements DecisionTreeClassifierParams, DefaultParamsWritable
Constructor and Description |
---|
DecisionTreeClassifier() |
DecisionTreeClassifier(String uid) |
Modifier and Type | Method and Description |
---|---|
BooleanParam |
cacheNodeIds()
If false, the algorithm will pass trees to executors to match instances with nodes.
|
IntParam |
checkpointInterval()
Param for set checkpoint interval (>= 1) or disable checkpoint (-1).
|
DecisionTreeClassifier |
copy(ParamMap extra)
Creates a copy of this instance with the same UID and some extra params.
|
Param<String> |
impurity()
Criterion used for information gain calculation (case-insensitive).
|
Param<String> |
leafCol()
Leaf indices column name.
|
static DecisionTreeClassifier |
load(String path) |
IntParam |
maxBins()
Maximum number of bins used for discretizing continuous features and for choosing how to split
on features at each node.
|
IntParam |
maxDepth()
Maximum depth of the tree (nonnegative).
|
IntParam |
maxMemoryInMB()
Maximum memory in MB allocated to histogram aggregation.
|
DoubleParam |
minInfoGain()
Minimum information gain for a split to be considered at a tree node.
|
IntParam |
minInstancesPerNode()
Minimum number of instances each child must have after split.
|
DoubleParam |
minWeightFractionPerNode()
Minimum fraction of the weighted sample count that each child must have after split.
|
static MLReader<T> |
read() |
LongParam |
seed()
Param for random seed.
|
DecisionTreeClassifier |
setCacheNodeIds(boolean value) |
DecisionTreeClassifier |
setCheckpointInterval(int value)
Specifies how often to checkpoint the cached node IDs.
|
DecisionTreeClassifier |
setImpurity(String value) |
DecisionTreeClassifier |
setMaxBins(int value) |
DecisionTreeClassifier |
setMaxDepth(int value) |
DecisionTreeClassifier |
setMaxMemoryInMB(int value) |
DecisionTreeClassifier |
setMinInfoGain(double value) |
DecisionTreeClassifier |
setMinInstancesPerNode(int value) |
DecisionTreeClassifier |
setMinWeightFractionPerNode(double value) |
DecisionTreeClassifier |
setSeed(long value) |
DecisionTreeClassifier |
setWeightCol(String value)
Sets the value of param
weightCol . |
static String[] |
supportedImpurities()
Accessor for supported impurities: entropy, gini
|
String |
uid()
An immutable unique ID for the object and its derivatives.
|
Param<String> |
weightCol()
Param for weight column name.
|
probabilityCol, setProbabilityCol, setThresholds, thresholds
rawPredictionCol, setRawPredictionCol
featuresCol, fit, labelCol, predictionCol, setFeaturesCol, setLabelCol, setPredictionCol, transformSchema
params
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
validateAndTransformSchema
getCacheNodeIds, getLeafCol, getMaxBins, getMaxDepth, getMaxMemoryInMB, getMinInfoGain, getMinInstancesPerNode, getMinWeightFractionPerNode, getOldStrategy, setLeafCol
getCheckpointInterval
getWeightCol
getImpurity, getOldImpurity
extractInstances
extractInstances, extractInstances
getLabelCol, labelCol
featuresCol, getFeaturesCol
getPredictionCol, predictionCol
clear, copyValues, defaultCopy, defaultParamMap, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, paramMap, params, set, set, set, setDefault, setDefault, shouldOwn
toString
getRawPredictionCol, rawPredictionCol
getProbabilityCol, probabilityCol
getThresholds, thresholds
write
save
$init$, initializeForcefully, initializeLogIfNecessary, initializeLogIfNecessary, initializeLogIfNecessary$default$2, initLock, isTraceEnabled, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning, org$apache$spark$internal$Logging$$log__$eq, org$apache$spark$internal$Logging$$log_, uninitialize
public DecisionTreeClassifier(String uid)
public DecisionTreeClassifier()
public static final String[] supportedImpurities()
public static DecisionTreeClassifier load(String path)
public static MLReader<T> read()
public final Param<String> impurity()
TreeClassifierParams
impurity
in interface TreeClassifierParams
public final Param<String> leafCol()
DecisionTreeParams
leafCol
in interface DecisionTreeParams
public final IntParam maxDepth()
DecisionTreeParams
maxDepth
in interface DecisionTreeParams
public final IntParam maxBins()
DecisionTreeParams
maxBins
in interface DecisionTreeParams
public final IntParam minInstancesPerNode()
DecisionTreeParams
minInstancesPerNode
in interface DecisionTreeParams
public final DoubleParam minWeightFractionPerNode()
DecisionTreeParams
minWeightFractionPerNode
in interface DecisionTreeParams
public final DoubleParam minInfoGain()
DecisionTreeParams
minInfoGain
in interface DecisionTreeParams
public final IntParam maxMemoryInMB()
DecisionTreeParams
maxMemoryInMB
in interface DecisionTreeParams
public final BooleanParam cacheNodeIds()
DecisionTreeParams
cacheNodeIds
in interface DecisionTreeParams
public final Param<String> weightCol()
HasWeightCol
weightCol
in interface HasWeightCol
public final LongParam seed()
HasSeed
public final IntParam checkpointInterval()
HasCheckpointInterval
checkpointInterval
in interface HasCheckpointInterval
public String uid()
Identifiable
uid
in interface Identifiable
public DecisionTreeClassifier setMaxDepth(int value)
public DecisionTreeClassifier setMaxBins(int value)
public DecisionTreeClassifier setMinInstancesPerNode(int value)
public DecisionTreeClassifier setMinWeightFractionPerNode(double value)
public DecisionTreeClassifier setMinInfoGain(double value)
public DecisionTreeClassifier setMaxMemoryInMB(int value)
public DecisionTreeClassifier setCacheNodeIds(boolean value)
public DecisionTreeClassifier setCheckpointInterval(int value)
SparkContext
.
Must be at least 1.
(default = 10)value
- (undocumented)public DecisionTreeClassifier setImpurity(String value)
public DecisionTreeClassifier setSeed(long value)
public DecisionTreeClassifier setWeightCol(String value)
weightCol
.
If this is not set or empty, we treat all instance weights as 1.0.
Default is not set, so all instances have weight one.
value
- (undocumented)public DecisionTreeClassifier copy(ParamMap extra)
Params
defaultCopy()
.copy
in interface Params
copy
in class Predictor<Vector,DecisionTreeClassifier,DecisionTreeClassificationModel>
extra
- (undocumented)