options(width=100)
In step II, we use the masta.fit
function to fit penalized proportional odds (PO) models to the labeled time-to-event data with features derived in step I. When fitting the penalized PO models, the non-parametric baseline function is approximated using B-splines.
library(MASTA)
# step I system.time(obj <- masta.fpca(data_org))
# step II system.time(fit <- masta.fit(obj))
bgbbest <- fit$bgbbest_FromChengInit_BFGS colnames(bgbbest)[2] <- "MLE" DF.wide <- data.frame(i = 1:nrow(bgbbest), bgbbest) DF.wide
The output from the masta.fit
function is a list with components:
details of the fitted model
C-statistics and adjusted Brier scores of the derived algorithm
A vector of consecutive integers describing the grouping coefficients
library(ggplot2) DF.long <- tidyr::gather(DF.wide, key = "type", value = "coef", bgbm.init:BIC.Orig) ggplot(DF.long, aes(x = i, y = coef)) + geom_bar(stat="identity") + facet_wrap(~ type) + theme_bw() + xlab("") + ylab("")
fit
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.