Jan Mühlnikel
commited on
Commit
·
e54232c
1
Parent(s):
3137797
experiment
Browse files
functions/calc_matches.py
CHANGED
|
@@ -45,7 +45,15 @@ def calc_matches(filtered_df, project_df, similarity_matrix, top_x):
|
|
| 45 |
|
| 46 |
# Take the first k indices to get the top k maximum values
|
| 47 |
top_indices = sorted_indices[:top_x]
|
| 48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
# Convert flat indices to 2D row and column indices
|
| 50 |
#row_indices, col_indices = match_matrix.nonzero()
|
| 51 |
#row_indices = row_indices[top_indices]
|
|
|
|
| 45 |
|
| 46 |
# Take the first k indices to get the top k maximum values
|
| 47 |
top_indices = sorted_indices[:top_x]
|
| 48 |
+
top_row_indices = []
|
| 49 |
+
top_col_indices = []
|
| 50 |
+
|
| 51 |
+
for idx in top_indices:
|
| 52 |
+
row, col = np.unravel_index(idx, match_matrix.shape)
|
| 53 |
+
top_row_indices.append(row)
|
| 54 |
+
top_col_indices.append(col)
|
| 55 |
+
|
| 56 |
+
st.write(top_col_indices)
|
| 57 |
# Convert flat indices to 2D row and column indices
|
| 58 |
#row_indices, col_indices = match_matrix.nonzero()
|
| 59 |
#row_indices = row_indices[top_indices]
|