Skip to content

Commit

Permalink
kmeans dtype issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mtorabi59 committed Sep 24, 2024
1 parent 2620c37 commit badef61
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pydfc/dfc_methods/cap.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def estimate_FCS(self, time_series):
act_vecs=act_center_1st_level, n_clusters=self.params["n_states"]
)
self.FCS_ = self.act_vec2FCS(group_act_centroids)
self.Z = self.kmeans_.predict(time_series.data.T)
self.Z = self.kmeans_.predict(time_series.data.T.astype(np.float32))

# mean activation of states
self.set_mean_activity(time_series)
Expand All @@ -149,7 +149,7 @@ def estimate_dFC(self, time_series):

act_vecs = time_series.data.T

Z = self.kmeans_.predict(act_vecs)
Z = self.kmeans_.predict(act_vecs.astype(np.float32))

# record time
self.set_dFC_assess_time(time.time() - tic)
Expand Down
4 changes: 2 additions & 2 deletions pydfc/dfc_methods/sliding_window_clustr.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def estimate_FCS(self, time_series):
n_clusters=self.params["n_states"],
n_regions=dFC_raw.n_regions,
)
self.Z = self.kmeans_.predict(self.dFC_mat2vec(SW_dFC))
self.Z = self.kmeans_.predict(self.dFC_mat2vec(SW_dFC).astype(np.float32))

# mean activation of states
self.set_mean_activity(time_series)
Expand Down Expand Up @@ -270,7 +270,7 @@ def estimate_dFC(self, time_series):
# Z = self.clusters_lst2idx(self.kmeans_.get_clusters())
else:
########### Euclidean Clustering ##############
Z = self.kmeans_.predict(F)
Z = self.kmeans_.predict(F.astype(np.float32))

# record time
self.set_dFC_assess_time(time.time() - tic)
Expand Down

0 comments on commit badef61

Please sign in to comment.