Self-Supervised Learning R - Matrix Transformation
05:27 05 Jan 2026

I've been reading the R library Semi-Supervised Classification (SSC) here

On page 7, there is a transformation applied to train/test matrices:

ktrain <- as.matrix(exp(- 0.048 * dtrain^2))
kitest <- as.matrix(exp(- 0.048 * ditest^2))

Overall, I'd like to understand the logic of the transformation. Namely, why is the matrix exponentiated and multiplied by the square?

Is it to ensure distances are all positive, and also, would the same transformation be applied if using other distance metrics such as Manhattan?

r linear-algebra