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 51 established models from 26 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

496

Version

2.2.0

License

GPL-3

Maintainer

Brian Smith

Last Published

March 18th, 2020

Functions in MachineShop (2.2.0)

CForestModel

Conditional Random Forest Model
SurvRegModel

Parametric Survival Model
extract

Extract Elements of an Object
TreeModel

Classification and Regression Tree Models
settings

MachineShop Settings
expand_params

Model Parameters Expansion
fit

Model Fitting
expand_steps

Recipe Step Parameters Expansion
DiscreteVariate

Discrete Variate Constructors
EarthModel

Multivariate Adaptive Regression Splines Model
GLMBoostModel

Gradient Boosting with Linear Models
as.MLModel

Coerce to an MLModel
ParameterGrid

Tuning Parameters Grid
NNetModel

Neural Network Model
XGBModel

Extreme Gradient Boosting Models
POLRModel

Ordered Logistic or Probit Regression Model
ModeledInput

ModeledInput Classes
GBMModel

Generalized Boosted Regression Model
step_kmeans

K-Means Clustering Variable Reduction
deprecated

Deprecated Functions
BARTMachineModel

Bayesian Additive Regression Trees Model
BARTModel

Bayesian Additive Regression Trees Model
diff

Model Performance Differences
lift

Model Lift Curves
inputs

Model Inputs
step_spca

Sparse Principal Components Analysis Variable Reduction
step_kmedoids

K-Medoids Clustering Variable Selection
ModelFrame

ModelFrame Class
KNNModel

Weighted k-Nearest Neighbor Model
AdaBoostModel

Boosting with Classification Trees
summary

Model Performance Summaries
t.test

Paired t-Tests for Model Comparisons
LARSModel

Least Angle Regression, Lasso and Infinitesimal Forward Stagewise Models
LMModel

Linear Models
QDAModel

Quadratic Discriminant Analysis Model
LDAModel

Linear Discriminant Analysis Model
C50Model

C5.0 Decision Trees and Rule-Based Model
RangerModel

Fast Random Forest Model
RPartModel

Recursive Partitioning and Regression Tree Models
SelectedModel

Selected Model
plot

Model Performance Plots
StackedModel

Stacked Regression Model
metrics

Performance Metrics
metricinfo

Display Performance Metric Information
calibration

Model Calibration
combine

Combine MachineShop Objects
predict

Model Prediction
BlackBoostModel

Gradient Boosting with Regression Trees
GLMModel

Generalized Linear Model
SurvMatrix

SurvMatrix Class Constructors
GLMNetModel

GLM Lasso or Elasticnet Model
confusion

Confusion Matrix
MachineShop-package

MachineShop: Machine Learning Models and Tools
RandomForestModel

Random Forest Model
SuperModel

Super Learner Model
dependence

Partial Dependence
SVMModel

Support Vector Machine Models
performance

Model Performance Metrics
response

Extract Response Variable
MDAModel

Mixture Discriminant Analysis Model
varimp

Variable Importance
AdaBagModel

Bagging with Classification Trees
print

Print MachineShop Objects
Grid

Tuning Grid Control
performance_curve

Model Performance Curves
resample

Resample Estimation of Model Performance
TunedModel

Tuned Model
ICHomes

Iowa City Home Sales Dataset
.

Quote Operator
MLControl

Resampling Controls
SelectedInput

Selected Model Inputs
TunedInput

Tuned Model Inputs
modelinfo

Display Model Information
expand_model

Model Expansion Over Tuning Parameters
models

Models
recipe_roles

Set Recipe Roles
CoxModel

Proportional Hazards Regression Model
FDAModel

Flexible and Penalized Discriminant Analysis Models
MLModel

MLModel Class Constructor
GAMBoostModel

Gradient Boosting with Additive Models
MLMetric

MLMetric Class Constructor
NaiveBayesModel

Naive Bayes Classifier Model
PLSModel

Partial Least Squares Model