Learn R Programming

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

Quick start

Welcome to the exprso GitHub page! Let's get started.

library(devtools)
devtools::install_github("tpq/exprso")
library(exprso)

Importing data

To import data, we use the exprso function. This function has two arguments.

data(iris)
array <- exprso(iris[1:80, 1:4], iris[1:80, 5])
## [1] "Preparing data for binary classification."

Pre-processing data

Functions with a mod prefix pre-process the data.

array <- modTransform(array)
array <- modNormalize(array, c(1, 2))

Split data

Functions with a split prefix split the data into training and test sets.

arrays <- splitSample(array, percent.include = 67)
array.train <- arrays$array.train
array.test <- arrays$array.valid

Select features

Functions with a fs prefix select features.

array.train <- fsStats(array.train, top = 0, how = "t.test")

Build models

Functions with a build prefix build models.

mach <- buildSVM(array.train,
                 top = 50,
                 kernel = "linear",
                 cost = 1)
## Setting probability to TRUE (forced behavior, cannot override)...
## Setting cross to 0 (forced behavior, cannot override)...
pred <- predict(mach, array.train)
## Individual classifier performance:
## Arguments not provided in an ROCR AUC format. Calculating accuracy outside of ROCR...
## Classification confusion table:
##          actual
## predicted Control Case
##   Control      29    0
##   Case          0   25
##   acc sens spec
## 1   1    1    1
pred <- predict(mach, array.test)
## Individual classifier performance:
## Arguments not provided in an ROCR AUC format. Calculating accuracy outside of ROCR...
## Classification confusion table:
##          actual
## predicted Control Case
##   Control      21    0
##   Case          0    5
##   acc sens spec
## 1   1    1    1
calcStats(pred)

Deploy pipelines

Functions with a pl prefix deploy high-throughput learning pipelines.

pl <- plGrid(array.train,
             array.test,
             how = "buildSVM",
             top = c(2, 4),
             kernel = "linear",
             cost = 10^(-3:3),
             fold = NULL)
pl
## Accuracy summary (complete summary stored in @summary slot):
## 
##      build top kernel  cost train.acc train.sens train.spec train.auc
## 1 buildSVM   2 linear 0.001  0.537037          0          1         0
## 2 buildSVM   4 linear 0.001  0.537037          0          1         0
## 3 buildSVM   2 linear 0.010  1.000000          1          1         1
## 4 buildSVM   4 linear 0.010  1.000000          1          1         1
##   valid.acc valid.sens valid.spec valid.auc
## 1 0.8076923          0          1         0
## 2 0.8076923          0          1         0
## 3 1.0000000          1          1         1
## 4 1.0000000          1          1         1
## ...
##       build top kernel cost train.acc train.sens train.spec train.auc
## 11 buildSVM   2 linear  100         1          1          1         1
## 12 buildSVM   4 linear  100         1          1          1         1
## 13 buildSVM   2 linear 1000         1          1          1         1
## 14 buildSVM   4 linear 1000         1          1          1         1
##    valid.acc valid.sens valid.spec valid.auc
## 11         1          1          1         1
## 12         1          1          1         1
## 13         1          1          1         1
## 14         1          1          1         1
## 
## Machine summary (all machines stored in @machs slot):
## 
## ##Number of classes: 2 
## @preFilter summary: 4 2 
## @reductionModel summary: logical logical 
## @mach class: svm.formula svm 
## ...
## ##Number of classes: 2 
## @preFilter summary: 4 4 
## @reductionModel summary: logical logical 
## @mach class: svm.formula svm

Read the exprso vignettes for more details.

Copy Link

Version

Install

install.packages('exprso')

Monthly Downloads

21

Version

0.4.7

License

GPL-2

Issues

Pull Requests

Stars

Forks

Maintainer

Thomas Quinn

Last Published

December 12th, 2018

Functions in exprso (0.4.7)

ExprsMulti-class

An S4 class to store feature and annotation data
build.

Workhorse for build Methods
build

Build Models
buildDT

Build Decision Tree Model
ExprsModule-class

An S4 class to store the model
GSE2eSet

Convert GSE to eSet
ExprsArray-class

An S4 class to store feature and annotation data
RegrsPredict-class

An S4 class to store model predictions
buildEnsemble

Build Ensemble
buildSVM

Build Support Vector Machine Model
buildANN

Build Artificial Neural Network Model
buildDNN

Build Deep Neural Network Model
buildLM

Build Linear Model
ExprsEnsemble-class

An S4 class to store multiple models
calcMonteCarlo

Calculate plMonteCarlo Performance
array

Sample ExprsBinary Data
ExprsMachine-class

An S4 class to store the model
defaultArg

Set an args List Element to Default Value
buildFRB

Build Fuzzy Rule Based Model
doMulti

Perform Multiple "1 vs. all" Tasks
ExprsBinary-class

An S4 class to store feature and annotation data
arrayExprs

Import Data as ExprsArray
fsPrcomp

Reduce Dimensions by PCA
fsPropd

Select Features by Differential Proportionality Analysis
RegrsArray-class

An S4 class to store feature and annotation data
buildLDA

Build Linear Discriminant Analysis Model
buildLASSO

Build LASSO or Ridge Model
RegrsModel-class

An S4 class to store the model
buildRF

Build Random Forest Model
arrayMulti

Sample ExprsMulti Data
buildNB

Build Naive Bayes Model
ctrlFeatureSelect

Manage fs Arguments
buildLR

Build Logistic Regression Model
ctrlGridSearch

Manage plGrid Arguments
modAcomp

Compositionally Constrain Data
conjoin

Combine exprso Objects
compare

Compare ExprsArray Objects
check.ctrlGS

Check ctrlGS Arguments
buildGLM

Build Generalized Linear Model
ctrlModSet

Manage mod Arguments
calcNested

Calculate plNested Performance
ctrlSplitSet

Manage split Arguments
calcStats

Calculate Model Performance
fsEbayes

Select Features by Moderated t-test
exprso-predict

Deploy Model
fsEdger

Selects Features by Exact Test
exprso

The exprso Package
modHistory

Replicate Data Process History
fsBalance

Convert Features into Balances
modCLR

Log-ratio Transform Data
fsCor

Select Features by Correlation
modInclude

Select Features from Data
classCheck

Class Check
fs

Select Features
forceArg

Force an args List Element to Value
pl

Deploy Pipeline
fsRankProd

Select Features by Rank Product Analysis
fsStats

Select Features by Statistical Testing
fs.

Workhorse for fs Methods
fsANOVA

Select Features by ANOVA
plCV

Perform Simple Cross-Validation
plGrid

Perform High-Throughput Machine Learning
fsInclude

Select Features by Explicit Reference
plGridMulti

Perform High-Throughput Multi-Class Classification
validationSet

Extract Validation Set
fsNULL

Null Feature Selection
fsMrmre

Select Features by mRMR
fsPathClassRFE

Select Features by Recursive Feature Elimination
makeGridFromArgs

Build Argument Grid
getFeatures

Retrieve Feature Set
getArgs

Build an args List
getWeights

Retrieve LASSO Weights
fsSample

Select Features by Random Sampling
mod

Process Data
modNormalize

Normalize Data
modFilter

Hard Filter Data
modCluster

Cluster Subjects
modRatios

Recast Data as Feature (Log-)Ratios
modSample

Sample Features from Data
modScale

Scale Data by Factor Range
modPermute

Permute Features in Data
packageCheck

Package Check
pipe

Process Pipelines
modSkew

Skew Data by Factor Range
splitBy

Split by User-defined Group
modTMM

Normalize Data
splitSample

Split by Random Sampling
pipeFilter

Filter ExprsPipeline Object
splitStratify

Split by Stratified Sampling
modSubset

Tidy Subset Wrapper
pipeUnboot

Rename "boot" Column
trainingSet

Extract Training Set
progress

Make Progress Bar
modSwap

Swap Case Subjects
modTransform

Log Transform Data
split

Split Data
reRank

Serialize "1 vs. all" Feature Selection
plMonteCarlo

Monte Carlo Cross-Validation
plNested

Nested Cross-Validation
splitBalanced

Split by Balanced Sampling
ExprsPredict-class

An S4 class to store model predictions
ExprsPipeline-class

An S4 class to store models built during high-throughput learning
ExprsModel-class

An S4 class to store the model