Overview

hldr is a collection of heterscedastic linear dimension reduction methods mainly used in supervised learning or classification. This package also leverages these methods in slow_learn() to improve classification.

hldr uses classfy() to create reduced classification objects. Currently, the methods only support qda() since they are heterscedastic methods but there is flexibiliy to use other discriminant functions such as lda() though it might not make since. hldr does allow the use of predict(), but a pretty print method hasn’t been developed yet so best to assign to a variable.

In developing sildR we found it useful to have it play nice with the “tidyverse” such as tidyr and modelr. At this point we have not thought of all the uses and combinations with these packages so if you think of something not currently implemented please file a minimal reproducible example on github.

Installation

You can install the latest development version from github with

if (packageVersion("devtools") < 1.6) {
  install.packages("devtools")
}
devtools::install_github("benbarnard/hldr")
## Using GitHub PAT from envvar GITHUB_PAT
## Downloading GitHub repo benbarnard/hldr@master
## from URL https://api.github.com/repos/benbarnard/hldr/zipball/master
## Installing hldr
## '/home/travis/R-bin/lib/R/bin/R' --no-site-file --no-environ --no-save  \
##   --no-restore --quiet CMD INSTALL  \
##   '/tmp/Rtmpischeg/devtools3da929ea919e/BenBarnard-hldr-8a7f7f7'  \
##   --library='/home/travis/R/Library' --install-tests
## 

If you encounter a clear bug, please file a minimal reproducible example on github.

Example

This is a basic example which shows you how to solve a common problem:

library(tidyverse)
library(modelr)
library(hldr)

df <- iris %>% group_by(Species) %>% crossv_mc(100)

classifier <- df$train %>% map(SYS, targetDim = 1) %>% map(classify)

predicted <- map2(classifier, df$test, predict)