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. |
StructType |
transformSchema(StructType schema,
ParamMap paramMap)
:: DeveloperApi ::
|
fittingParamMap, parenttransform, transformequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitvalidateAndTransformSchemagetLabelCol, labelColfeaturesCol, getFeaturesColgetPredictionCol, predictionColaddOutputColumn, checkInputColumn, explainParams, get, getParam, isSet, paramMap, params, set, set, validate, validateuidinitializeIfNecessary, initializeLogging, isTraceEnabled, log_, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarningpublic M setFeaturesCol(String value)
public M setPredictionCol(String value)
public StructType transformSchema(StructType schema, ParamMap paramMap)
PipelineStageDerives the output schema from the input schema and parameters. The schema describes the columns and types of the data.
transformSchema in class PipelineStageschema - 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 Transformerdataset - input datasetparamMap - additional parameters, overwrite embedded paramspredictionCol of type Double