Learn R Programming

⚠️There's a newer version (3.8.0) of this package.Take me there.

MachineShop: Machine Learning Models and Tools for R

Description

MachineShop is a meta-package for statistical and machine learning with a unified interface for model fitting, prediction, performance assessment, and presentation of results. Support is provided for predictive modeling of numerical, categorical, and censored time-to-event outcomes and for resample (bootstrap, cross-validation, and split training-test sets) estimation of model performance. This vignette introduces the package interface with a survival data analysis example, followed by supported methods of variable specification; applications to other response variable types; available performance metrics, resampling techniques, and graphical and tabular summaries; and modeling strategies.

Features

  • Unified and concise interface for model fitting, prediction, and performance assessment.
  • Support for 53+ models from 28 R packages, including model specifications from the parsnip package.
  • Dynamic model parameters.
  • Ensemble modeling with stacked regression and super learners.
  • Modeling of response variables types: binary factors, multi-class nominal and ordinal factors, numeric vectors and matrices, and censored time-to-event survival.
  • Model specification with traditional formulas, design matrices, and flexible pre-processing recipes.
  • Resample estimation of predictive performance, including cross-validation, bootstrap resampling, and split training-test set validation.
  • Parallel execution of resampling algorithms.
  • Choices of performance metrics: accuracy, areas under ROC and precision recall curves, Brier score, coefficient of determination (R2), concordance index, cross entropy, F score, Gini coefficient, unweighted and weighted Cohen’s kappa, mean absolute error, mean squared error, mean squared log error, positive and negative predictive values, precision and recall, and sensitivity and specificity.
  • Graphical and tabular performance summaries: calibration curves, confusion matrices, partial dependence plots, performance curves, lift curves, and model-specific and permutation-based variable importance.
  • Model tuning over automatically generated grids and with exhaustive and random grid searches, Bayesian optimization, particle swarm optimization, quasi-Newton BFGS optimization, simulated annealing, and support for user-defined optimization functions.
  • Model selection and comparisons for any combination of models and model parameter values.
  • Recursive feature elimination.
  • User-definable models and performance metrics.

Getting Started

Installation

# Current release from CRAN
install.packages("MachineShop")

# Development version from GitHub
# install.packages("devtools")
devtools::install_github("brian-j-smith/MachineShop")

# Development version with vignettes
devtools::install_github("brian-j-smith/MachineShop", build_vignettes = TRUE)

Documentation

Once installed, the following R commands will load the package and display its help system documentation. Online documentation and examples are available at the MachineShop website.

library(MachineShop)

# Package help summary
?MachineShop

# Vignette
RShowDoc("UserGuide", package = "MachineShop")

Copy Link

Version

Install

install.packages('MachineShop')

Monthly Downloads

702

Version

3.5.0

License

GPL-3

Maintainer

Last Published

June 3rd, 2022

Functions in MachineShop (3.5.0)

CoxModel

Proportional Hazards Regression Model
EarthModel

Multivariate Adaptive Regression Splines Model
BARTMachineModel

Bayesian Additive Regression Trees Model
AdaBoostModel

Boosting with Classification Trees
DiscreteVariate

Discrete Variate Constructors
CForestModel

Conditional Random Forest Model
BlackBoostModel

Gradient Boosting with Regression Trees
BARTModel

Bayesian Additive Regression Trees Model
AdaBagModel

Bagging with Classification Trees
ICHomes

Iowa City Home Sales Dataset
C50Model

C5.0 Decision Trees and Rule-Based Model
KNNModel

Weighted k-Nearest Neighbor Model
RFSRCModel

Fast Random Forest (SRC) Model
SelectedInput

Selected Model Inputs
QDAModel

Quadratic Discriminant Analysis Model
GLMBoostModel

Gradient Boosting with Linear Models
ParameterGrid

Tuning Parameters Grid
GBMModel

Generalized Boosted Regression Model
ModelSpecification

Model Specification
ModelFrame

ModelFrame Class
ParsnipModel

Parsnip Model
SurvMatrix

SurvMatrix Class Constructors
expand_params

Model Parameters Expansion
modelinfo

Display Model Information
SelectedModel

Selected Model
expand_steps

Recipe Step Parameters Expansion
models

Models
MachineShop-package

MachineShop: Machine Learning Models and Tools
GLMNetModel

GLM Lasso or Elasticnet Model
MLModel

MLModel and MLModelFunction Class Constructors
GLMModel

Generalized Linear Model
StackedModel

Stacked Regression Model
SurvRegModel

Parametric Survival Model
LDAModel

Linear Discriminant Analysis Model
LMModel

Linear Models
LARSModel

Least Angle Regression, Lasso and Infinitesimal Forward Stagewise Models
step_kmeans

K-Means Clustering Variable Reduction
confusion

Confusion Matrix
SuperModel

Super Learner Model
dependence

Partial Dependence
t.test

Paired t-Tests for Model Comparisons
step_kmedoids

K-Medoids Clustering Variable Selection
unMLModelFit

Revert an MLModelFit Object
MDAModel

Mixture Discriminant Analysis Model
RangerModel

Fast Random Forest Model
FDAModel

Flexible and Penalized Discriminant Analysis Models
GAMBoostModel

Gradient Boosting with Additive Models
NNetModel

Neural Network Model
MLMetric

MLMetric Class Constructor
MLControl

Resampling Controls
RPartModel

Recursive Partitioning and Regression Tree Models
inputs

Model Inputs
case_weights

Extract Case Weights
RandomForestModel

Random Forest Model
lift

Model Lift Curves
performance

Model Performance Metrics
combine

Combine MachineShop Objects
TreeModel

Classification and Regression Tree Models
plot

Model Performance Plots
metricinfo

Display Performance Metric Information
XGBModel

Extreme Gradient Boosting Models
metrics

Performance Metrics
as.MLInput

Coerce to an MLInput
TunedInput

Tuned Model Inputs
set_optim

Tuning Parameter Optimization
NaiveBayesModel

Naive Bayes Classifier Model
PLSModel

Partial Least Squares Model
set_predict

Resampling Prediction Control
TunedModel

Tuned Model
as.MLModel

Coerce to an MLModel
TuningGrid

Tuning Grid Control
SVMModel

Support Vector Machine Models
performance_curve

Model Performance Curves
resample

Resample Estimation of Model Performance
response

Extract Response Variable
step_spca

Sparse Principal Components Analysis Variable Reduction
summary

Model Performance Summaries
varimp

Variable Importance
predict

Model Prediction
POLRModel

Ordered Logistic or Probit Regression Model
expand_model

Model Expansion Over Tuning Parameters
diff

Model Performance Differences
expand_modelgrid

Model Tuning Grid Expansion
deprecated

Deprecated Functions
print

Print MachineShop Objects
calibration

Model Calibration
extract

Extract Elements of an Object
quote

Quote Operator
step_lincomp

Linear Components Variable Reduction
rfe

Recursive Feature Elimination
step_sbf

Variable Selection by Filtering
set_monitor

Training Parameters Monitoring Control
fit

Model Fitting
recipe_roles

Set Recipe Roles
reexports

Objects exported from other packages
settings

MachineShop Settings
set_strata

Resampling Stratification Control