Convert sparse similarity matrix from package data to a dense version with 1 on its diagonal. This matrix can then be used by pareg.

as_dense_sim(mat_sparse)

Arguments

mat_sparse

Sparse matrix.

Value

Dense matrix

Examples

transform_y(c(0, 0.5, 1))
#> [1] 0.1666667 0.5000000 0.8333333