org.apache.spark.ml
Class Predictor<FeaturesType,Learner extends Predictor<FeaturesType,Learner,M>,M extends PredictionModel<FeaturesType,M>>

Object
  extended by org.apache.spark.ml.PipelineStage
      extended by org.apache.spark.ml.Estimator<M>
          extended by org.apache.spark.ml.Predictor<FeaturesType,Learner,M>
All Implemented Interfaces:
java.io.Serializable, Logging, Params
Direct Known Subclasses:
Classifier, DecisionTreeClassifier, DecisionTreeRegressor, GBTClassifier, GBTRegressor, LinearRegression, RandomForestClassifier, RandomForestRegressor

public abstract class Predictor<FeaturesType,Learner extends Predictor<FeaturesType,Learner,M>,M extends PredictionModel<FeaturesType,M>>
extends Estimator<M>

:: DeveloperApi :: Abstraction for prediction problems (regression and classification).

See Also:
Serialized Form

Constructor Summary
Predictor()
           
 
Method Summary
abstract  Learner copy(ParamMap extra)
          Creates a copy of this instance with the same UID and some extra params.
 M fit(DataFrame dataset)
          Fits a model to the input data.
 Learner setFeaturesCol(String value)
           
 Learner setLabelCol(String value)
           
 Learner setPredictionCol(String value)
           
 StructType transformSchema(StructType schema)
          :: DeveloperApi ::
 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.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

Predictor

public Predictor()
Method Detail

setLabelCol

public Learner setLabelCol(String value)

setFeaturesCol

public Learner setFeaturesCol(String value)

setPredictionCol

public Learner setPredictionCol(String value)

fit

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

Specified by:
fit in class Estimator<M extends PredictionModel<FeaturesType,M>>
Parameters:
dataset - (undocumented)
Returns:
(undocumented)

copy

public abstract Learner 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<M extends PredictionModel<FeaturesType,M>>
Parameters:
extra - (undocumented)
Returns:
(undocumented)
See Also:
defaultCopy()

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)

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