Predicts ethnicity from last names, using self-trained model with customized labels.
This is designed for advanced users who wish to use their own models.
For most use cases, use predict_ethnicity()
for prediction.
predict_lastname(
lastnames,
na.rm = FALSE,
threads = 0L,
labels = NULL,
model_path = NULL
)
character vector, last names
bool, default to FALSE, whether to remove the na in the lastnames
int, number of threads for multi-threading
character vector, labels of the classification model, needs to be in the same order as the trained model
character file path, the path to the trained model in .json format (converted from Keras by frugally-deep)
data.frame with predicted probability and predicted ethnicity