Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Jan Mühlnikel
commited on
Commit
·
9fefc7d
1
Parent(s):
5f41368
experiment
Browse files
functions/calc_matches.py
CHANGED
@@ -19,7 +19,6 @@ def calc_matches(filtered_df, project_df, similarity_matrix, top_x):
|
|
19 |
|
20 |
# Create mapping dictionaries
|
21 |
filtered_df_index_map = {i: index for i, index in enumerate(filtered_df_indices)}
|
22 |
-
st.write(filtered_df_index_map)
|
23 |
project_df_index_map = {i: index for i, index in enumerate(project_df_indices)}
|
24 |
|
25 |
# Select submatrix based on indices from both dataframes
|
@@ -40,10 +39,12 @@ def calc_matches(filtered_df, project_df, similarity_matrix, top_x):
|
|
40 |
top_n_row_indices = row_indices[top_n_indices]
|
41 |
top_n_col_indices = col_indices[top_n_indices]
|
42 |
|
43 |
-
original_row_indices =
|
44 |
-
original_col_indices =
|
45 |
|
46 |
st.write(match_matrix.shape)
|
|
|
|
|
47 |
|
48 |
# Get the linear indices of the top 'top_x' values
|
49 |
# (flattened index to handle the sparse matrix more effectively)
|
|
|
19 |
|
20 |
# Create mapping dictionaries
|
21 |
filtered_df_index_map = {i: index for i, index in enumerate(filtered_df_indices)}
|
|
|
22 |
project_df_index_map = {i: index for i, index in enumerate(project_df_indices)}
|
23 |
|
24 |
# Select submatrix based on indices from both dataframes
|
|
|
39 |
top_n_row_indices = row_indices[top_n_indices]
|
40 |
top_n_col_indices = col_indices[top_n_indices]
|
41 |
|
42 |
+
original_row_indices = filtered_df_index_map[top_n_row_indices]
|
43 |
+
original_col_indices = project_df_index_map[top_n_col_indices]
|
44 |
|
45 |
st.write(match_matrix.shape)
|
46 |
+
st.write(original_row_indices)
|
47 |
+
st.write(original_col_indices)
|
48 |
|
49 |
# Get the linear indices of the top 'top_x' values
|
50 |
# (flattened index to handle the sparse matrix more effectively)
|