predx data frames contain valid predx_class and predx columns and created them if needed.predx_df.Rdis.predx_df will verify that a predx data frame contains valid predx_class and predx columns. as.predx_df will create a predx data frame from a list or tibble and add the predx_class column if not found.
validate_predx_df(x, return = F) is.predx_df(x) as.predx_df(x)
| x | A list or a tibble including a list or column named |
|---|
Error message or TRUE.
as.predx_df(list( location = c('Mercury', 'Venus', 'Earth'), target = 'habitability', predx = list(Binary(0), Binary(0), Binary(1)) ))#> # A tibble: 3 x 4 #> location target predx predx_class #> <chr> <chr> <list> <chr> #> 1 Mercury habitability <Binary> Binary #> 2 Venus habitability <Binary> Binary #> 3 Earth habitability <Binary> Binary