public abstract class ClassificationModel<FeaturesType,M extends ClassificationModel<FeaturesType,M>> extends PredictionModel<FeaturesType,M> implements ClassifierParams
Classifier
.
Classes are indexed {0, 1, ..., numClasses - 1}.
Constructor and Description |
---|
ClassificationModel() |
Modifier and Type | Method and Description |
---|---|
abstract int |
numClasses()
Number of classes (values which the label can take).
|
M |
setRawPredictionCol(String value) |
DataFrame |
transform(DataFrame dataset,
ParamMap paramMap)
Transforms dataset by reading from
featuresCol , and appending new columns as specified by
parameters:
- predicted labels as predictionCol of type Double
- raw predictions (confidences) as rawPredictionCol of type Vector . |
static <FeaturesType> |
transformColumnsImpl(DataFrame dataset,
ClassificationModel<FeaturesType,?> model,
ParamMap map)
Added prediction column(s).
|
setFeaturesCol, setPredictionCol, transformSchema
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
getRawPredictionCol, rawPredictionCol
initializeIfNecessary, initializeLogging, isTraceEnabled, log_, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning
public static <FeaturesType> scala.Tuple2<Object,DataFrame> transformColumnsImpl(DataFrame dataset, ClassificationModel<FeaturesType,?> model, ParamMap map)
ClassificationModel.transform()
since it is used by ProbabilisticClassificationModel
.dataset
- Input datasetmap
- Parameter map. This will NOT be merged with the embedded paramMap; the merge
should already be done.public M setRawPredictionCol(String value)
public abstract int numClasses()
public DataFrame transform(DataFrame dataset, ParamMap paramMap)
featuresCol
, and appending new columns as specified by
parameters:
- predicted labels as predictionCol
of type Double
- raw predictions (confidences) as rawPredictionCol
of type Vector
.
transform
in class PredictionModel<FeaturesType,M extends ClassificationModel<FeaturesType,M>>
dataset
- input datasetparamMap
- additional parameters, overwrite embedded params