dsmueller commited on
Commit
5e09d75
1 Parent(s): 37ee8fe

Add option to limit size of data visualization, umap parameters when creating

Browse files
Files changed (1) hide show
  1. scripts/pages/3_Visualize_Data.py +12 -2
scripts/pages/3_Visualize_Data.py CHANGED
@@ -62,11 +62,18 @@ with st.expander("Under the hood",expanded=True):
62
 
63
  with st.expander("Create visualization data",expanded=True):
64
  # Add a button to run the function
65
- vector_qty=st.number_input('Query size in database', min_value=1, step=10, value=50)
 
 
 
 
66
  export_df = st.checkbox('Export visualization data?', value=True)
67
  if export_df:
68
  current_time = datetime.now().strftime("%Y.%m.%d.%H.%M")
69
- df_export_path = st.text_input('Export file', f'../data/AMS/ams_data-400-0-{vector_qty}.json')
 
 
 
70
  if st.button('Create visualization data'):
71
  start_time = time.time() # Start the timer
72
 
@@ -74,6 +81,9 @@ with st.expander("Create visualization data",expanded=True):
74
  st.session_state.client.load_db(path_to_db='../db/chromadb/',index_name=sb['index_name'],
75
  df_export_path=df_export_path,
76
  vector_qty=vector_qty,
 
 
 
77
  verbose=True)
78
 
79
  end_time = time.time() # Stop the timer
 
62
 
63
  with st.expander("Create visualization data",expanded=True):
64
  # Add a button to run the function
65
+ limit_size = st.checkbox('Limit size of data visualization?', value=True)
66
+ if limit_size:
67
+ vector_qty=st.number_input('Query size in database', min_value=1, step=10, value=50)
68
+ else:
69
+ vector_qty=None
70
  export_df = st.checkbox('Export visualization data?', value=True)
71
  if export_df:
72
  current_time = datetime.now().strftime("%Y.%m.%d.%H.%M")
73
+ if limit_size:
74
+ df_export_path = st.text_input('Export file', f'../data/AMS/ams_data-400-0-{vector_qty}.json')
75
+ else:
76
+ df_export_path=st.text_input('Export file', f'../data/AMS/ams_data-400-0-all.json')
77
  if st.button('Create visualization data'):
78
  start_time = time.time() # Start the timer
79
 
 
81
  st.session_state.client.load_db(path_to_db='../db/chromadb/',index_name=sb['index_name'],
82
  df_export_path=df_export_path,
83
  vector_qty=vector_qty,
84
+ umap_params={'n_neighbors': 5,
85
+ 'n_components': 2,
86
+ 'random_state':42},
87
  verbose=True)
88
 
89
  end_time = time.time() # Stop the timer