Running the multiDA algorithm

Hey, so you are interested in using the multiDA package for your analysis - awesome! Here are a few examples to get your work going. Loading the package using the library(multiDA) function, we can run a model on the inbuilt SRBCT data set as follows:

library(multiDA)

vy   <- SRBCT$vy
mX   <- SRBCT$mX
res  <- multiDA(mX=mX, vy=vy, penalty="EBIC", equal.var=TRUE, set.options="exhaustive")

If we want to predict class labels, we can use the `predict function in order to do so. In this case, we will find the resubstitution error rate for this dataset using the multiDA algorithm.

vals <- predict(res, newdata=mX)$vy.pred          
rser <- sum(vals!=vy)/length(vy)
rser

Exploring the print and plot functions

We can use the print command to look at a quick summary of the model fitted.

print(res)

Further, we can plot the kernel density estimates of features we are interested in. By default, the plot function plots the top 10 ranked features. If `ranked=FALSE, then the user can specify which features to be plotted (specified by column names).

plot(res, ranks = 1)

An example using specified features

plot(res, ranked=FALSE, features = c("V22", "V122"))

multiDA "broom" functions

multiDA "glimpse" function

a one row data frame, with quick summaries from the algorithm. In the spirit of the "glance" function from the broom package.

glimpse_multiDA(res)

multiDA "tidy" function

This returns a tidy data frame, with key results from the trained multiDA object, namely, a data.frame of significant features and their ranks. In the spirit of "tidy" from the broom package.

tidy_res <- tidy_multiDA(res)
head(tidy_res)

multiDA "augment" function

Returns a tidy data frame, returning back the original class, matrix of features, augmented with the paritioning of each feature as given by the algorithm. In the spirit of "augment" from the broom package.

augment_res <- augment_multiDA(res)
dim(augment_res) #twice as long!


sarahromanes/multiDA documentation built on July 14, 2019, 9:41 p.m.