|
import pandas as pd |
|
import numpy as np |
|
from scipy.sparse import csr_matrix, coo_matrix |
|
import streamlit as st |
|
|
|
|
|
def calc_matches(filtered_df, project_df, similarity_matrix, top_x): |
|
st.write(filtered_df.shape) |
|
st.write(project_df.shape) |
|
st.write(similarity_matrix.shape) |
|
|
|
|
|
if not isinstance(similarity_matrix, csr_matrix): |
|
similarity_matrix = csr_matrix(similarity_matrix) |
|
|
|
filtered_indices = filtered_df.index.to_list() |
|
project_indices = project_df.index.to_list() |
|
|
|
st.write(filtered_indices[:100]) |
|
st.write(project_indices[:100]) |
|
|
|
""" |
|
p1_df = filtered_df.loc[top_col_indices].copy() |
|
p1_df['similarity'] = top_values |
|
|
|
p2_df = project_df.loc[top_row_indices].copy() |
|
p2_df['similarity'] = top_values |
|
print("finished calc matches") |
|
|
|
return p1_df, p2_df |
|
""" |
|
|