knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

mixBag

mixBag is a package that encapsulates several repeated tasks that a data scientist performs regularly in data analysis and modeling into some simple wrapper functions. The main goals of mixBag are to make repeat activities faster and more efficient.

Installation

This package is only available in GitHub. You can install the latest development version from GitHub with:

# install.packages("devtools")
devtools::install_github("Curious-Joe/mixBag")

Usage

mixBag has several useful functions aimed at simplifying tasks in different areas of work that a data analysis. Couple of examples are shown below:

qtile_plot()

Plotting percentage of different target feature labels in different quantile groups of a predictor feature.

library(mixBag)

# plot percentage of different target labels in different quartiles of a predictor
qtile_plot(iris,x_feat = Sepal.Length, y_feat = Species, quantile = 10)

compare_classifiers()

Fit 5 classifiers on a training data and compare results based on ROC on provided test data. mixBag model related functions rely heavily upon the suite of packages that come along with tidymodels package.

library(tidymodels)
library(rsample)
split <- initial_split(wine, strata = quality_bin)
train <- training(split)
test <- testing(split)
recipe <- recipe(quality_bin ~ ., data = train) %>%
  update_role(ID, new_role = 'identification') %>%
  step_string2factor(all_nominal()) %>%
  step_knnimpute(all_predictors()) %>%
  step_normalize(all_numeric())

compare_classifiers(recipe = recipe, test_df = test, target_lab = 1)

Getting Help

For any question or bug fix feel free to send email at a.h.fahad90@gmail.com.



Curious-Joe/mixBag documentation built on Aug. 30, 2021, 6:48 p.m.