Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vame.community() fail when transition_matrix is 0 in some pairs. #118

Open
chenxinfeng4 opened this issue Jun 5, 2023 · 0 comments
Open

Comments

@chenxinfeng4
Copy link

I set K=30. When I run the code vame.community(config, show_umap=False, cut_tree=2) . It report:

VAME/vame/analysis/tree_hierarchy.py in graph_to_tree(motif_usage, transition_matrix, n_cluster, merge_sel)
    103 #        max_tr = np.max(trans_mat_temp) #merge function
    104 #        nodes = np.where(max_tr == trans_mat_temp)
--> 105         nodes = merge_func(trans_mat_temp, n_cluster, motif_norm_temp, merge_sel)
...
---> 67                     cost = (motif_norm[i] + motif_norm[j]) / np.abs(transition_matrix[i,j] + transition_matrix[j,i] )
     68                 except ZeroDivisionError:

Here is the transition_matrix

array([[0.        , 0.        , 0.        , 0.        , 0.        ,
        0.        , 0.        , 0.        , 0.28571429, 0.02597403,
        0.        , 0.        , 0.        , 0.02597403, 0.        ,
        0.07792208, 0.        , 0.01298701, 0.        , 0.        ,
        0.        , 0.        , 0.01298701, 0.01298701, 0.12987013,
        0.06493506, 0.        , 0.03896104, 0.31168831, 0.        ],
       [0.        , 0.        , 0.        , 0.        , 0.        ,
        0.        , 0.        , 0.        , 0.        , 0.        ,
        0.5       , 0.        , 0.        , 0.        , 0.        ,
        0.        , 0.        , 0.        , 0.        , 0.        ,
        0.        , 0.        , 0.        , 0.        , 0.        ,
        0.        , 0.        , 0.        , 0.5       , 0.        ],
       [0.        , 0.        , 0.        , 0.        , 0.        ,
        0.        , 0.        , 0.19354839, 0.        , 0.        ,
        0.        , 0.        , 0.16129032, 0.        , 0.        ,
        0.48387097, 0.        , 0.        , 0.06451613, 0.        ,
        0.        , 0.        , 0.        , 0.        , 0.        ,
        0.09677419, 0.        , 0.        , 0.        , 0.        ],
.....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant