public abstract class Predictor<FeaturesType,Learner extends Predictor<FeaturesType,Learner,M>,M extends PredictionModel<FeaturesType,M>> extends Estimator<M> implements PredictorParams
Abstraction for prediction problems (regression and classification).
Constructor and Description |
---|
Predictor() |
Modifier and Type | Method and Description |
---|---|
M |
fit(DataFrame dataset,
ParamMap paramMap)
Fits a single model to the input data with provided parameter map.
|
Learner |
setFeaturesCol(String value) |
Learner |
setLabelCol(String value) |
Learner |
setPredictionCol(String value) |
org.apache.spark.sql.types.StructType |
transformSchema(org.apache.spark.sql.types.StructType schema,
ParamMap paramMap)
:: DeveloperAPI ::
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
validateAndTransformSchema
getLabelCol, labelCol
featuresCol, getFeaturesCol
getPredictionCol, predictionCol
addOutputColumn, checkInputColumn, explainParams, get, getParam, isSet, paramMap, params, set, set, validate, validate
uid
initializeIfNecessary, initializeLogging, isTraceEnabled, log_, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning
public Learner setLabelCol(String value)
public Learner setFeaturesCol(String value)
public Learner setPredictionCol(String value)
public M fit(DataFrame dataset, ParamMap paramMap)
Estimator
fit
in class Estimator<M extends PredictionModel<FeaturesType,M>>
dataset
- input datasetparamMap
- Parameter map.
These values override any specified in this Estimator's embedded ParamMap.public org.apache.spark.sql.types.StructType transformSchema(org.apache.spark.sql.types.StructType schema, ParamMap paramMap)
PipelineStage
Derives the output schema from the input schema and parameters. The schema describes the columns and types of the data.
transformSchema
in class PipelineStage
schema
- Input schema to this stageparamMap
- Parameters passed to this stage