Fit dummy classifier and Logistic regression models

fit_classifier(
  train_df,
  target_col,
  numeric_feats = NULL,
  categorical_feats = NULL,
  cv = 5
)

Arguments

train_df

dataframe that will be used to train the model

target_col

The column that needs to be classified as a string

numeric_feats

The numeric columns as a list

categorical_feats

The categorical columns as a list

cv

The number of cross validation folds as an integer

Value

A data frame

Examples

gapminder <- gapminder::gapminder |> dplyr::filter(continent=="Asia" | continent=="Europe")
gapminder$country <- as.character(gapminder$country)
gapminder$continent <- as.character(gapminder$continent)
gapminder$year <- as.numeric(gapminder$year)
gapminder$pop <- as.numeric(gapminder$pop)
fit_classifier(gapminder, target_col = 'continent', numeric_feats = list('gdpPercap'), categorical_feats = list('country'), cv = 5)
#> Loading required package: ggplot2
#> Loading required package: lattice
#> Warning: glm.fit: algorithm did not converge
#> Warning: prediction from a rank-deficient fit may be misleading
#> Warning: glm.fit: algorithm did not converge
#> Warning: prediction from a rank-deficient fit may be misleading
#> Warning: glm.fit: algorithm did not converge
#> Warning: prediction from a rank-deficient fit may be misleading
#> Warning: glm.fit: algorithm did not converge
#> Warning: prediction from a rank-deficient fit may be misleading
#> Warning: glm.fit: algorithm did not converge
#> Warning: prediction from a rank-deficient fit may be misleading
#> Warning: glm.fit: algorithm did not converge
#>   dummy_classifier logistic_regression
#> 1        0.5238062                   1