public final class RandomForestRegressor extends Predictor<Vector,RandomForestRegressor,RandomForestRegressionModel>
Random Forest
learning algorithm for regression.
It supports both continuous and categorical features.Constructor and Description |
---|
RandomForestRegressor() |
RandomForestRegressor(java.lang.String uid) |
Modifier and Type | Method and Description |
---|---|
RandomForestRegressor |
copy(ParamMap extra)
Creates a copy of this instance with the same UID and some extra params.
|
Param<java.lang.String> |
featuresCol()
Param for features column name.
|
java.lang.String |
getFeaturesCol() |
java.lang.String |
getLabelCol() |
java.lang.String |
getPredictionCol() |
Param<java.lang.String> |
labelCol()
Param for label column name.
|
Param<java.lang.String> |
predictionCol()
Param for prediction column name.
|
RandomForestRegressor |
setCacheNodeIds(boolean value) |
RandomForestRegressor |
setCheckpointInterval(int value) |
RandomForestRegressor |
setFeatureSubsetStrategy(java.lang.String value) |
RandomForestRegressor |
setImpurity(java.lang.String value) |
RandomForestRegressor |
setMaxBins(int value) |
RandomForestRegressor |
setMaxDepth(int value) |
RandomForestRegressor |
setMaxMemoryInMB(int value) |
RandomForestRegressor |
setMinInfoGain(double value) |
RandomForestRegressor |
setMinInstancesPerNode(int value) |
RandomForestRegressor |
setNumTrees(int value) |
RandomForestRegressor |
setSeed(long value) |
RandomForestRegressor |
setSubsamplingRate(double value) |
static java.lang.String[] |
supportedFeatureSubsetStrategies()
Accessor for supported featureSubsetStrategy settings: auto, all, onethird, sqrt, log2
|
static java.lang.String[] |
supportedImpurities()
Accessor for supported impurity settings: variance
|
protected RandomForestRegressionModel |
train(DataFrame dataset)
Train a model using the given dataset and parameters.
|
java.lang.String |
uid()
An immutable unique ID for the object and its derivatives.
|
StructType |
validateAndTransformSchema(StructType schema,
boolean fitting,
DataType featuresDataType)
Validates and transforms the input schema with the provided param map.
|
extractLabeledPoints, fit, setFeaturesCol, setLabelCol, setPredictionCol, transformSchema
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 RandomForestRegressor(java.lang.String uid)
public RandomForestRegressor()
public static final java.lang.String[] supportedImpurities()
public static final java.lang.String[] supportedFeatureSubsetStrategies()
public java.lang.String uid()
Identifiable
public RandomForestRegressor setMaxDepth(int value)
public RandomForestRegressor setMaxBins(int value)
public RandomForestRegressor setMinInstancesPerNode(int value)
public RandomForestRegressor setMinInfoGain(double value)
public RandomForestRegressor setMaxMemoryInMB(int value)
public RandomForestRegressor setCacheNodeIds(boolean value)
public RandomForestRegressor setCheckpointInterval(int value)
public RandomForestRegressor setImpurity(java.lang.String value)
public RandomForestRegressor setSubsamplingRate(double value)
public RandomForestRegressor setSeed(long value)
public RandomForestRegressor setNumTrees(int value)
public RandomForestRegressor setFeatureSubsetStrategy(java.lang.String value)
protected RandomForestRegressionModel train(DataFrame dataset)
Predictor
fit()
to avoid dealing with schema validation
and copying parameters into the model.
train
in class Predictor<Vector,RandomForestRegressor,RandomForestRegressionModel>
dataset
- Training datasetpublic RandomForestRegressor copy(ParamMap extra)
Params
copy
in interface Params
copy
in class Predictor<Vector,RandomForestRegressor,RandomForestRegressionModel>
extra
- (undocumented)defaultCopy()
public StructType validateAndTransformSchema(StructType schema, boolean fitting, DataType featuresDataType)
schema
- input schemafitting
- whether this is in fittingfeaturesDataType
- SQL DataType for FeaturesType.
E.g., VectorUDT
for vector features.public Param<java.lang.String> labelCol()
public java.lang.String getLabelCol()
public Param<java.lang.String> featuresCol()
public java.lang.String getFeaturesCol()
public Param<java.lang.String> predictionCol()
public java.lang.String getPredictionCol()