Skip to contents

Plots the dendrogram of a fitted cv.hfr model. The heights of the levels in the dendrogram are given by a shrinkage vector, with a maximum (unregularized) overall graph height of \(p\) (the number of covariates in the regression). Stronger shrinkage leads to a shallower hierarchy.


# S3 method for cv.hfr
plot(x, kappa = NULL, show_details = TRUE, max_leaf_size = 3, ...)



Fitted 'cv.hfr' model.


The hyperparameter used for plotting. If empty, the optimal value is used.


print model details on the plot.


maximum size of the leaf nodes. Default is max_leaf_size=3.


additional methods passed to plot.


A plotted dendrogram.


The dendrogram is generated using hierarchical clustering and modified so that the height differential between any two splits is the shrinkage weight of the lower split (ranging between 0 and 1). With no shrinkage, all shrinkage weights are equal to 1 and the dendrogram has a height of \(p\). With shrinkage the dendrogram has a height of \((\kappa \times p)\).

The leaf nodes are colored to indicate the coefficient sign, with the size indicating the absolute magnitude of the coefficients.

A color bar on the right indicates the relative contribution of each level to the coefficient of determination, with darker hues representing a larger contribution.

See also

cv.hfr, predict and coef methods


Johann Pfitzinger


x = matrix(rnorm(100 * 20), 100, 20)
y = rnorm(100)
fit = cv.hfr(x, y, kappa = seq(0, 1, by = 0.1))
plot(fit, kappa = 0.5)