IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
def get_bokeh_plot(embedding, selectidx, clusteridx, trait_df, umap_string, color_palette = hex_colors_40): plot_dict =dict( x = embedding[selectidx, 0], y = embedding[selectidx, 1], trait_type_code = [f"{x}"for x in clusteridx], h2_alpha = [min(0.6, 10* x) for x in trait_df['estimates.final.h2_observed'].fillna(1e-6).tolist()], fulldesc = [f"{i} | {trait_df.loc[i, 'short_description']} | {trait_df.loc[i, 'estimates.final.h2_observed']:.3f} | {trait_df.loc[i, 'Neff']:.2f}"for i in selectidx], ) color_mapping = CategoricalColorMapper(factors = [f"{x}"for x in np.unique(clusteridx)], palette = color_palette) plot_tooltips = [ ("Desc", "@fulldesc"), ] ax = bokeh_figure( width =800, height =800, tooltips = plot_tooltips, title = umap_string , ) ax.circle('x', 'y', size =10, source = ColumnDataSource(plot_dict), color =dict(field='trait_type_code', transform = color_mapping), line_alpha =dict(field='h2_alpha'), fill_alpha =dict(field='h2_alpha'), ) ax.title.text_font_size ='20pt' ax.axis.major_label_text_font_size ='20pt' ax.axis.axis_line_width =2 ax.axis.major_tick_line_width =2 ax.grid.visible =Falsereturn ax
Code
selectidx = np.array(trait_df.index)clusteridx = get_llm_cluster_index(selectidx, "ls-da3m0ns/bge_large_medical", "kmeans")axlist = [get_bokeh_plot(embedding, selectidx, clusteridx, trait_df, metric) for metric, embedding in umap_embeddings.items()]# put all the plots in a VBoxp = bokeh_column(*axlist)# show the resultsbokeh_show(p)
Code
# plot_dict = dict(# x = tsvd_embedding[selectidx, 0],# y = tsvd_embedding[selectidx, 1],# trait_type_code = trait_df['trait_type'].tolist(),# desc = trait_df['description'].tolist(),# h2 = [f"{x:.3f}" for x in trait_df['estimates.final.h2_observed'].tolist()],# Neff = [f"{x:.2f}" for x in trait_df['Neff'].tolist()],# tidx = list(selectidx),# fulldesc = [f"{trait_df.loc[i, 'short_description']} | {trait_df.loc[i, 'estimates.final.h2_observed']:.3f} | {trait_df.loc[i, 'Neff']:.2f}" for i in selectidx]# )# plot_tooltips = [# ("index", "$index"),# ("Desc", "@desc"),# ("h2", "@h2"),# ("N_eff", "@Neff"),# ]# color_mapping = CategoricalColorMapper(factors = trait_type_unique, palette = hex_colors)selectidx = np.array(trait_df.index)axlist =list()for llm_method in llm_methods:for llm_ctype in llm_ctypes: clusteridx = get_llm_cluster_index(selectidx, llm_method, llm_ctype) alpha_factor =10if llm_ctype =="kmeans"else100 plot_title =f"{llm_method} + {llm_ctype} clustering" axlist.append(get_bokeh_plot(X_embedding_cosine_30_01, selectidx, clusteridx, trait_df, plot_title, alpha_factor = alpha_factor))# put all the plots in a VBoxp = bokeh_column(*axlist)# show the resultsbokeh_show(p)