Used to get the Euclidean distance as well by setting mcov
= diag(m)
.
mahalanobis_distance_cpp(
featureList,
Xtrain_mat,
Xtest_mat,
mcov,
S_scale_dist
)
List of vectors indicating all factor combinations that should be included in the computations. Assumes that the first one is empty.
Matrix
Matrix
Matrix. The Sigma-matrix in the Mahalanobis distance formula (stats::cov(Xtrain_mat)
) gives Mahalanobis distance,
diag(m)
gives the Euclidean distance.
Logical indicating
Array of three dimensions. Contains the squared distance for between all training and test observations for all feature combinations passed to the function.