plot.mtlr {MTLR} | R Documentation |
Plot the weights of an mtlr object. If packages ggplot2 and reshape2 are not installed, a bargraph of feature influence is given where influence is defined as the sum of absolute values of the feature weights across time. If ggplot2 and reshape2 are installed then a plot of feature weight across time is given.
## S3 method for class 'mtlr' plot(x, numfeatures = 5, featurenames = c(), digits, ...)
x |
an object of class mtlr (result from calling |
numfeatures |
the number of weight to plot. Default is 5. The most influential features are chosen first. |
featurenames |
the names of the specific weight to plot. These should correspond to the names in x$weight_matrix. If featurenames are supplied, then numfeatures is ignored. |
digits |
the number of digits to round to for the value of the time points. |
... |
for future methods |
#These examples are geared towards users who have installed ggplot2 and reshape2. library(survival) mod <- mtlr(Surv(time,status)~., data = lung) #Basic plot with 5 most influential features plot(mod) #Plot all 8 features plot(mod, numfeatures = 8) #Suppose we want to see specifically the "meal.cal" and "ph.karno" features: plot(mod, featurenames = c("meal.cal", "ph.karno"))