From a935134760ffe6207871eda2c14fa6a0ffaeeeac Mon Sep 17 00:00:00 2001 From: Vladimir Berezhnev Date: Wed, 30 Oct 2024 13:28:22 +1000 Subject: [PATCH] Small updates --- service/src/operations.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service/src/operations.rs b/service/src/operations.rs index da71cf7..eeba324 100644 --- a/service/src/operations.rs +++ b/service/src/operations.rs @@ -1505,7 +1505,7 @@ pub fn read_mutual_scores( for (node, score) in ranks { let info = self.node_info_from_id(node).clone(); - if score > 0.0 { + if score > 0.0 && info.kind == NodeKind::User { let reversed_score = self.fetch_score_reversed(context, ego_id, node); v.push((ego.to_string(), info.name.clone(), reversed_score)); points.push((node, reversed_score)); @@ -1516,7 +1516,7 @@ pub fn read_mutual_scores( let normalized_points = Self::normalize_data(&points); // Perform k-means clustering on normalized points - let cluster_count = 3; // Define the number of clusters here + let cluster_count = 3; let max_iterations = 100; let tolerance = 0.01; let clusters = Self::kmeans(&normalized_points, cluster_count, max_iterations, tolerance);