| plot_correlation | R Documentation |
Displays pairwise distances between task coefficient vectors as a
heatmap. Distance is computed as 1 - cosine_similarity.
Values near 0 indicate similar coefficient profiles; values near 1
indicate orthogonal profiles.
plot_correlation(x, midpoint = 0.5, limits = c(0, 1))
x |
Either a fitted |
midpoint |
Midpoint for the colour scale. Default: |
limits |
Numeric vector of length 2 for the colour scale limits.
Default: |
A ggplot2 object.
plot_heatmap
set.seed(42)
n <- 100; p <- 10; n_tasks <- 4
X <- matrix(rnorm(n * p), n, p)
colnames(X) <- paste0("V", seq_len(p))
Y <- X %*% matrix(rnorm(p * n_tasks), p) + matrix(rnorm(n * n_tasks), n) * 0.1
colnames(Y) <- c("T1", "T2", "T3", "T4")
K <- matrix(1, n_tasks, n_tasks); diag(K) <- 0.5
fit <- orthoMTL(X, Y, lambda = 1e-3, K = K)
plot_correlation(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.