org.apache.spark.ml.regression
Class RandomForestRegressor

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

public final class RandomForestRegressor
extends Predictor<Vector,RandomForestRegressor,RandomForestRegressionModel>

:: Experimental :: Random Forest learning algorithm for regression. It supports both continuous and categorical features.

See Also:
Serialized Form

Constructor Summary
RandomForestRegressor()
           
RandomForestRegressor(String uid)
           
 
Method Summary
 RandomForestRegressor copy(ParamMap extra)
          Creates a copy of this instance with the same UID and some extra params.
 RandomForestRegressor setCacheNodeIds(boolean value)
           
 RandomForestRegressor setCheckpointInterval(int value)
           
 RandomForestRegressor setFeatureSubsetStrategy(String value)
           
 RandomForestRegressor setImpurity(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 String[] supportedFeatureSubsetStrategies()
          Accessor for supported featureSubsetStrategy settings: auto, all, onethird, sqrt, log2
static String[] supportedImpurities()
          Accessor for supported impurity settings: variance
 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

RandomForestRegressor

public RandomForestRegressor(String uid)

RandomForestRegressor

public RandomForestRegressor()
Method Detail

supportedImpurities

public static final String[] supportedImpurities()
Accessor for supported impurity settings: variance


supportedFeatureSubsetStrategies

public static final String[] supportedFeatureSubsetStrategies()
Accessor for supported featureSubsetStrategy settings: auto, all, onethird, sqrt, log2


uid

public String uid()

setMaxDepth

public RandomForestRegressor setMaxDepth(int value)

setMaxBins

public RandomForestRegressor setMaxBins(int value)

setMinInstancesPerNode

public RandomForestRegressor setMinInstancesPerNode(int value)

setMinInfoGain

public RandomForestRegressor setMinInfoGain(double value)

setMaxMemoryInMB

public RandomForestRegressor setMaxMemoryInMB(int value)

setCacheNodeIds

public RandomForestRegressor setCacheNodeIds(boolean value)

setCheckpointInterval

public RandomForestRegressor setCheckpointInterval(int value)

setImpurity

public RandomForestRegressor setImpurity(String value)

setSubsamplingRate

public RandomForestRegressor setSubsamplingRate(double value)

setSeed

public RandomForestRegressor setSeed(long value)

setNumTrees

public RandomForestRegressor setNumTrees(int value)

setFeatureSubsetStrategy

public RandomForestRegressor setFeatureSubsetStrategy(String value)

copy

public RandomForestRegressor 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,RandomForestRegressor,RandomForestRegressionModel>
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