awe: Analyze, Wrap, Explain

awe is an end-to-end R framework that carries a data set through the entire analytical workflow in one call:

Import -> Explore -> Model -> Ensemble/Tune -> Wrap -> Explain -> Evaluate -> Communicate

Installation

# from a local source tarball
install.packages("awe_0.2.0.tar.gz", repos = NULL, type = "source")

# or, once pushed to GitHub
# install.packages("remotes")
remotes::install_github("olawaleawe/awe")

Quick start

library(awe)

fit <- awe(mtcars, target = "mpg")            # silent by default in scripts
fit <- awe(mtcars, target = "mpg", verbose = TRUE)  # progress via message()

summary(fit)                          # exploratory summary + leaderboard + evaluation + story
plot(fit)                             # permutation importance
plot(fit, type = "pdp", var = "wt")   # partial dependence (with ICE curves)
plot(fit, type = "leaderboard")       # cross-validated model comparison
plot(fit, type = "residuals")         # regression diagnostics (continuous targets)
predict(fit)                          # predictions on the training split
explain(fit)                          # AWEExplainer object
report(fit, format = "html")          # writes a report (HTML if rmarkdown/pandoc available)

Classification works the same way: the target type (continuous, binary, multiclass) is detected automatically, and binary targets additionally get ROC/AUC and a confusion-matrix heatmap:

fit <- awe(iris, target = "Species")
plot(fit, type = "roc")         # binary targets only
plot(fit, type = "confusion")

Step-by-step (each stage is also its own function)

e    <- awe_explore(mtcars, target = "mpg")
sp   <- awe_preprocess(mtcars, target = "mpg")
m    <- awe_model(sp$train, target = "mpg")
ens  <- awe_ensemble(m, top_n = 3)      # performance-weighted ensemble of top candidates
tn   <- awe_tune(sp$train, target = "mpg", model = "random_forest")  # grid-search tuning
w    <- awe_wrap(m)
xp   <- awe_explain(w)
ev   <- awe_evaluate(w, newdata = sp$test)
st   <- awe_story(list(explore = e, model = m, explainer = xp, evaluation = ev))

Design

Model bank

Base learners (lm/glm, rpart, and a dependency-free k-NN) always run so awe_model() never fails for lack of a suggested package. When installed, these are added automatically as extra candidates. Call awe_registry("continuous") / awe_registry("binary") / awe_registry("multiclass") to list everything that would be tried, without fitting anything.

Package Candidate(s)
randomForest Random forest
ranger Fast random forest (+ probability variant)
nnet Multinomial logistic / neural net
e1071 SVM (radial & linear), naive Bayes
kernlab SVM (ksvm, radial)
glmnet Ridge, lasso, elastic net, regularized logistic
gbm Gradient boosting
class k-nearest neighbours (classification)
MASS LDA, QDA, robust regression (rlm)
earth MARS
pls Partial least squares regression
xgboost XGBoost

Restrict the candidates tried with awe_model(data, target, models = c(...)).

Plots

A consistent visual identity (theme_awe(), awe_palette()) is used throughout; every plotting function uses ggplot2 when installed and falls back to base graphics otherwise, so nothing here requires a specific plotting package.

Everything degrades gracefully: the package depends only on base R plus rpart, so awe() always runs. Every other engine listed above is optional (Suggests) and used automatically whenever installed.

Status

v0.2.0: passes R CMD check cleanly (one environment-only NOTE about suggested packages not installable offline) with a 36-test testthat suite. Routine engine warnings/messages (convergence notices, verbosity from glm/nnet/glmnet/gbm/etc.) are suppressed internally so awe() output stays readable; genuine fitting failures still surface with an informative message and that one candidate is dropped.