From 7a30524998bf0ed65e505aae83eac2efbcf540d8 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 16 Apr 2023 16:23:33 +0200 Subject: [PATCH] Fix warnings I missed. --- mlpp/hypothesis_testing/hypothesis_testing.cpp | 8 ++++---- mlpp/kmeans/kmeans.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mlpp/hypothesis_testing/hypothesis_testing.cpp b/mlpp/hypothesis_testing/hypothesis_testing.cpp index 8c1b4d0..41e3995 100644 --- a/mlpp/hypothesis_testing/hypothesis_testing.cpp +++ b/mlpp/hypothesis_testing/hypothesis_testing.cpp @@ -8,10 +8,10 @@ std::tuple MLPPHypothesisTesting::chiSquareTest(std::vector observed, std::vector expected) { //real_t df = observed.size() - 1; // These are our degrees of freedom - real_t sum = 0; - for (uint32_t i = 0; i < observed.size(); i++) { - sum += (observed[i] - expected[i]) * (observed[i] - expected[i]) / expected[i]; - } + //real_t sum = 0; + //for (uint32_t i = 0; i < observed.size(); i++) { + // sum += (observed[i] - expected[i]) * (observed[i] - expected[i]) / expected[i]; + //} return std::tuple(); } diff --git a/mlpp/kmeans/kmeans.cpp b/mlpp/kmeans/kmeans.cpp index 597da47..fe0f0a9 100644 --- a/mlpp/kmeans/kmeans.cpp +++ b/mlpp/kmeans/kmeans.cpp @@ -243,7 +243,7 @@ Ref MLPPKMeans::silhouette_scores() { closest_centroids->get_row_into_mlpp_vector(i, closest_centroids_i_tempv); // COMPUTING b[i] - real_t b = INT_MAX; + real_t b = Math_INF; for (int j = 0; j < mu_size_y; ++j) { _mu->get_row_into_mlpp_vector(j, mu_j_tempv);