Package smile.classification
Interface DataFrameClassifier
- All Superinterfaces:
Classifier<smile.data.Tuple>,Serializable,ToDoubleFunction<smile.data.Tuple>,ToIntFunction<smile.data.Tuple>
- All Known Implementing Classes:
AdaBoost,DecisionTree,GradientTreeBoost,RandomForest
Classification trait on DataFrame.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceThe classifier trainer. -
Method Summary
Modifier and TypeMethodDescriptionstatic DataFrameClassifierensemble(DataFrameClassifier... models) Return an ensemble of multiple base models to obtain better predictive performance.smile.data.formula.Formulaformula()Returns the formula associated with the model.static DataFrameClassifierof(smile.data.formula.Formula formula, smile.data.DataFrame data, Properties params, Classifier.Trainer<double[], ?> trainer) Fits a vector classifier on data frame.default int[]predict(smile.data.DataFrame data) Predicts the class labels of a data frame.default int[]Predicts the class labels of a dataset.smile.data.type.StructTypeschema()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
smile.data.formula.Formula formula()Returns the formula associated with the model.- Returns:
- the formula associated with the model.
-
schema
smile.data.type.StructType schema()Returns the predictor schema.- Returns:
- the predictor schema.
-
predict
default int[] predict(smile.data.DataFrame data) 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(smile.data.formula.Formula formula, smile.data.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.
-