Open pinghongyeh opened 3 months ago
Hi @pinghongyeh thanks for spotting the issue, here is a quick fix:
from sklearn.preprocessing import scale
inputs = [scale(x) for x in inputs] # standardize the inputs (mean = 0, std = 1)
https://github.com/GidLev/cepy/commit/b97053c89a6f3017ea79b16f74667d747c55db0e
fixed in ce_prediction.ipynb
Sorry for my novice. I do not see any change. The error still exist.
Input In [94], in
NameError: name 'scale' is not defined
Thank you.
The fix was in the imports section, please run this import line before the scaling operation:
from sklearn.preprocessing import scale
Let me know if it solved it.
The problem of "scale" was solved. I have other questions, if you don't mind. In the "ce_subjects_pipeline" scripts, I was not able to find the "NKI_200_schaefer_sc_train_consensus_mat.npy". How was it created? In addition, in the session of the paper, "2.12. Predicting group-level functional from structural connectivity with deep learning", are the scripts regarding the deep learning algorithms described in this session available to the public?
Thank you.
Hi,
The consensus matrix was generated using Betzel et al. (2018) distance-dependent consensus thresholds. I don't think I'll manage to find the file you are referring to but you can generate it using this code: https://github.com/GidLev/consensus-thresholding
Predicting group-level functional from structural connectivity with deep learning, here is the relevant code: https://gist.github.com/GidLev/0a5bb6ddef7df1a49b430ec3957cdc9e
Hi Gidon, Thank you for providing the codes. For the distance matrix, the required input for the fcn_group_bins, how can it be created using the example data, e.g. NKI_200_schaefer_sc_matrices.npz?
Ping
Hi Gidon,
I am testing the ce_prediction scripts, but it failed in the following
for node_i in tqdm(np.arange(num_nodes)): # loop over all nodes
a boolean vector to remove the diagonal as a feature
NameError: name 'scale' is not defined
I have run the from matplotlib import pyplot as plt from matplotlib.colors import rgb2hex import numpy as np import seaborn as sns import pandas as pd from scipy import stats from sklearn.metrics.pairwise import cosine_similarity from sklearn.preprocessing import scale from sklearn.model_selection import KFold from sklearn.linear_model import LinearRegression from sklearn.linear_model import SGDRegressor from sklearn.base import clone from sklearn.metrics import explained_variance_score from tqdm import tqdm
It seems that scale(x) does not run within the bracket []
Do you have any suggestion? Thank you. Ping