From a3f1dd490cbfd3bd791bf7e0dd8d6d26c3f74a39 Mon Sep 17 00:00:00 2001 From: "D. Berge" Date: Tue, 19 Aug 2025 17:20:03 +0200 Subject: [PATCH] Fix non-existent method --- lib/www/server/lib/comparisons/pca.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/www/server/lib/comparisons/pca.js b/lib/www/server/lib/comparisons/pca.js index f4303b0..a44de89 100644 --- a/lib/www/server/lib/comparisons/pca.js +++ b/lib/www/server/lib/comparisons/pca.js @@ -15,9 +15,12 @@ function computePCA(deviations) { // Compute mean for centering (1 x 2 matrix) const mean = math.mean(D, 0); - // Explicitly repeat mean to match D's shape (n x 2) + // Manually repeat-mean to match D's shape (n x 2) const n = deviationMatrix.length; - const meanRepeated = math.repmat(mean, n, 1); + const meanArr = mean.toArray(); + const meanRepeated = math.matrix( + Array(n).fill().map(() => [meanArr[0], meanArr[1]]) + ); // Center the data const centered = math.subtract(D, meanRepeated);