Package smile.classification
Interface DataFrameClassifier
- All Superinterfaces:
Classifier<Tuple>
,Serializable
,ToDoubleFunction<Tuple>
,ToIntFunction<Tuple>
- All Known Implementing Classes:
AdaBoost
,DecisionTree
,GradientTreeBoost
,RandomForest
Classification trait on DataFrame.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
The classifier trainer. -
Method Summary
Modifier and TypeMethodDescriptionstatic DataFrameClassifier
ensemble
(DataFrameClassifier... models) Return an ensemble of multiple base models to obtain better predictive performance.formula()
Returns the formula associated with the model.static DataFrameClassifier
of
(Formula formula, DataFrame data, Properties params, Classifier.Trainer<double[], ?> trainer) Fits a vector classifier on data frame.default int[]
Predicts the class labels of a data frame.default int[]
Predicts the class labels of a dataset.schema()
Returns the predictor schema.Methods inherited from interface smile.classification.Classifier
applyAsDouble, applyAsInt, classes, numClasses, online, predict, predict, predict, predict, predict, predict, predict, predict, score, soft, update, update, update
-
Method Details
-
formula
Formula formula()Returns the formula associated with the model.- Returns:
- the formula associated with the model.
-
schema
StructType schema()Returns the predictor schema.- Returns:
- the predictor schema.
-
predict
Predicts the class labels of a data frame.- Parameters:
data
- the data frame.- Returns:
- the predicted class labels.
-
predict
Predicts the class labels of a dataset.- Parameters:
data
- the data frame.posteriori
- an empty list to store a posteriori probabilities on output.- Returns:
- the predicted class labels.
-
of
static DataFrameClassifier of(Formula formula, DataFrame data, Properties params, Classifier.Trainer<double[], ?> trainer) Fits a vector classifier on data frame.- Parameters:
formula
- a symbolic description of the model to be fitted.data
- the data frame of the explanatory and response variables.params
- the hyper-parameters.trainer
- the training lambda.- Returns:
- the model.
-
ensemble
Return an ensemble of multiple base models to obtain better predictive performance.- Parameters:
models
- the base models.- Returns:
- the ensemble model.
-