public abstract class PredictionModel<FeaturesType,M extends PredictionModel<FeaturesType,M>> extends Model<M> implements PredictorParams
Abstraction for a model for prediction tasks (regression and classification).
Constructor and Description |
---|
PredictionModel() |
Modifier and Type | Method and Description |
---|---|
M |
setFeaturesCol(String value) |
M |
setPredictionCol(String value) |
DataFrame |
transform(DataFrame dataset,
ParamMap paramMap)
Transforms dataset by reading from
featuresCol , calling predict() , and storing
the predictions as a new column predictionCol . |
org.apache.spark.sql.types.StructType |
transformSchema(org.apache.spark.sql.types.StructType schema,
ParamMap paramMap)
:: DeveloperAPI ::
|
fittingParamMap, parent
transform, transform
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 M setFeaturesCol(String value)
public M setPredictionCol(String value)
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 stagepublic DataFrame transform(DataFrame dataset, ParamMap paramMap)
featuresCol
, calling predict()
, and storing
the predictions as a new column predictionCol
.
transform
in class Transformer
dataset
- input datasetparamMap
- additional parameters, overwrite embedded paramspredictionCol
of type Double