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.
  • Current support for 52 established models from 27 R packages.
  • 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 variable importance.
  • Model tuning over automatically generated grids of parameter values and randomly sampled grid points.
  • Model selection and comparisons for any combination of models and model parameter values.
  • 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("Introduction", package = "MachineShop")

Copy Link

Version

Install

install.packages('MachineShop')

Monthly Downloads

649

Version

2.8.0

License

GPL-3

Maintainer

Last Published

April 16th, 2021

Functions in MachineShop (2.8.0)

BARTModel

Bayesian Additive Regression Trees Model
CoxModel

Proportional Hazards Regression Model
C50Model

C5.0 Decision Trees and Rule-Based Model
EarthModel

Multivariate Adaptive Regression Splines Model
DiscreteVariate

Discrete Variate Constructors
CForestModel

Conditional Random Forest Model
BlackBoostModel

Gradient Boosting with Regression Trees
BARTMachineModel

Bayesian Additive Regression Trees Model
AdaBagModel

Bagging with Classification Trees
AdaBoostModel

Boosting with Classification Trees
Grid

Tuning Grid Control
GLMNetModel

GLM Lasso or Elasticnet Model
ModeledInput

ModeledInput Classes
GLMModel

Generalized Linear Model
GLMBoostModel

Gradient Boosting with Linear Models
MLControl

Resampling Controls
GBMModel

Generalized Boosted Regression Model
MDAModel

Mixture Discriminant Analysis Model
ICHomes

Iowa City Home Sales Dataset
RPartModel

Recursive Partitioning and Regression Tree Models
NNetModel

Neural Network Model
RandomForestModel

Random Forest Model
ModelFrame

ModelFrame Class
RFSRCModel

Fast Random Forest (SRC) Model
QDAModel

Quadratic Discriminant Analysis Model
MachineShop-package

MachineShop: Machine Learning Models and Tools
LARSModel

Least Angle Regression, Lasso and Infinitesimal Forward Stagewise Models
KNNModel

Weighted k-Nearest Neighbor Model
LDAModel

Linear Discriminant Analysis Model
FDAModel

Flexible and Penalized Discriminant Analysis Models
NaiveBayesModel

Naive Bayes Classifier Model
POLRModel

Ordered Logistic or Probit Regression Model
LMModel

Linear Models
TreeModel

Classification and Regression Tree Models
TunedInput

Tuned Model Inputs
SelectedInput

Selected Model Inputs
ParameterGrid

Tuning Parameters Grid
SelectedModel

Selected Model
confusion

Confusion Matrix
combine

Combine MachineShop Objects
PLSModel

Partial Least Squares Model
diff

Model Performance Differences
dependence

Partial Dependence
expand_params

Model Parameters Expansion
expand_steps

Recipe Step Parameters Expansion
fit

Model Fitting
lift

Model Lift Curves
extract

Extract Elements of an Object
inputs

Model Inputs
performance

Model Performance Metrics
performance_curve

Model Performance Curves
XGBModel

Extreme Gradient Boosting Models
calibration

Model Calibration
TunedModel

Tuned Model
as.MLModel

Coerce to an MLModel
SurvMatrix

SurvMatrix Class Constructors
settings

MachineShop Settings
response

Extract Response Variable
SurvRegModel

Parametric Survival Model
metricinfo

Display Performance Metric Information
models

Models
resample

Resample Estimation of Model Performance
modelinfo

Display Model Information
recipe_roles

Set Recipe Roles
print

Print MachineShop Objects
quote

Quote Operator
MLMetric

MLMetric Class Constructor
RangerModel

Fast Random Forest Model
GAMBoostModel

Gradient Boosting with Additive Models
MLModel

MLModel Class Constructor
metrics

Performance Metrics
varimp

Variable Importance
step_sbf

Variable Selection by Filtering
step_lincomp

Linear Components Variable Reduction
step_kmeans

K-Means Clustering Variable Reduction
t.test

Paired t-Tests for Model Comparisons
step_kmedoids

K-Medoids Clustering Variable Selection
unMLModelFit

Revert an MLModelFit Object
StackedModel

Stacked Regression Model
expand_model

Model Expansion Over Tuning Parameters
SuperModel

Super Learner Model
expand_modelgrid

Model Tuning Grid Expansion
SVMModel

Support Vector Machine Models
plot

Model Performance Plots
predict

Model Prediction
summary

Model Performance Summaries
step_spca

Sparse Principal Components Analysis Variable Reduction