inst/doc/advanced_usage.R

## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

## ----setup--------------------------------------------------------------------
library(rethnicity)

## -----------------------------------------------------------------------------
# remember the list of labels we mentioned?
labels <- c("asian", "black", "hispanic", "white")

# change to your own model file path
model_path <- system.file("models", "fullname_aligned_distill.json", package = "rethnicity", mustWork = TRUE)

# run the prediction
predict_fullname(firstnames = "Alan", lastnames = "Turing", labels = labels, model_path = model_path)

Try the rethnicity package in your browser

Any scripts or data that you put into this service are public.

rethnicity documentation built on Oct. 18, 2024, 5:07 p.m.