fit_classifier.Rd
Fit dummy classifier and Logistic regression models
fit_classifier(
train_df,
target_col,
numeric_feats = NULL,
categorical_feats = NULL,
cv = 5
)
dataframe that will be used to train the model
The column that needs to be classified as a string
The numeric columns as a list
The categorical columns as a list
The number of cross validation folds as an integer
A data frame
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