problem_type | R Documentation |
Whether the Y is a "classification", "regression" or ill-defined problem.
Returns a character: "classification", "regression", or an error for strange
classes. Minor redundancy with is_discrete, though explicit. Could be useful
for DALEX::explain(type)
as it also expects "classification" or
"regression".
problem_type(y)
y |
Response variable to be modeled |
Character either c("classification", "regression") specifying the assumed model task based on the discreteness of y.
Other cheem utility:
as_logical_index()
,
color_scale_of()
,
contains_nonnumeric()
,
is_discrete()
,
is_diverging()
,
linear_tform()
,
logistic_tform()
,
rnorm_from()
,
sug_basis()
,
sug_manip_var()
library(cheem)
problem_type(mtcars$mpg) ## Numeric, many values
problem_type(mtcars$cyl) ## Numeric column, labeled as discrete, because less than 25 unique values
problem_type(letters) ## Character to classification
problem_type(factor(letters)) ## Factor to classification
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.