Validates the frame against the bundle's feature contract (validate_feature_frame()), fills remaining NA with
each feature's impute value, blends and calibrates. Mirror of Python score_cohort.
Usage
score_cohort(
bundle,
features,
key_columns = NULL,
on_violation = "raise",
return_validation = FALSE,
check_concepts = NULL,
unit_check = FALSE
)Arguments
- bundle
A
model_bundleor a bundle directory path.- features
A data.frame, or the path of a
.csv/.parquetfile (parquet needs thearrowpackage).- key_columns
Columns to return alongside the score (default: non-feature columns ending in
_id).- on_violation
"raise","clip"or"nullify".- return_validation
If
TRUE, returnlist(scores =, validation =).- check_concepts
A DBI connection, a registry or a registry JSON file: first check the custom concept ids recorded in the bundle's feature spec against this site's (
validate_bundle_concepts()) and stop on a mismatch.- unit_check
If
TRUE, warn when a lab's median is more than 3x off the reference median (check_unit_sanity()).
