Skip to content

Commit

Permalink
Force type of matrix indices in Louvain
Browse files Browse the repository at this point in the history
  • Loading branch information
tbonald authored and mclegrand committed Jun 7, 2024
1 parent 27aa364 commit ec8d3ca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sknetwork/clustering/louvain.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ def _optimize(self, labels, adjacency, out_weights, in_weights):
increase :
Gain in modularity after optimization.
"""
labels = labels.astype(np.int32)
indices = adjacency.indices
indptr = adjacency.indptr
labels = labels.astype(np.int64)
indices = adjacency.indices.astype(np.int64)
indptr = adjacency.indptr.astype(np.int64)
data = adjacency.data.astype(np.float32)
out_weights = out_weights.astype(np.float32)
in_weights = in_weights.astype(np.float32)
Expand Down

0 comments on commit ec8d3ca

Please sign in to comment.