added example for FIT#59
Conversation
|
Hi @aopy. You pushed to Can you append to this PR the code you made for the PR inside xfrites? |
|
Thx @aopy. Can you check code quality? You need to install flake8 and, inside a terminal, go to frites directly and run |
|
Also, net computations is not correct for intracranial EEG data. In if net:
# get unique pairs
i_s, i_t = np.stack((i_s, i_t))[:, i_s < i_t]
# computes net transfer
fit = fit[i_s, :] - fit[i_t, :]
roi_p = np.array(roi_p)[i_s]by : if net:
roi_po = roi_p.copy()
done, roi_p, i_st = [], [], []
for n_s, (s, t) in enumerate(zip(i_s, i_t)):
# ignore if indices have already been stored
if ([s, t] in done) or ([t, s] in done): continue # noqa
# find [source, target] and [target, source]
result = np.where((i_s == t) & (i_t == s))[0]
assert len(result) == 1
n_t = result[0]
# decide if (x->y - y->x) or (y->x - x->y)
r_s, r_t = roi_po[n_s], roi_po[n_t]
if not np.all(np.array([r_s, r_t]) == np.sort([r_s, r_t])):
n_s, n_t = n_t, n_s
r_s, r_t = roi_po[n_s].split('->')[0], roi_po[n_t].split('->')[0]
# store results
i_st.append([n_s, n_t])
roi_p.append(f"{r_s}-{r_t}")
done.append([s, t])
# computes net transfer
i_s, i_t = np.array(i_st).T
fit = fit[i_s, :] - fit[i_t, :]Thank you in advance, |
|
@EtienneCmb thanks! |
EtienneCmb
left a comment
There was a problem hiding this comment.
Also, we need to put the conn_fit in the API tab of the doc. Below conn_pid, can you add conn_fit please?
EtienneCmb
left a comment
There was a problem hiding this comment.
Finally, can you add your contribution to What's new tab? Add a line below in the whatsnew file, something like :
- New function :func:`frites.conn.conn_fit` to estimate the feature specific information transfer (:PR:`59`) - :author:`aopy`
…n, save additional attributes in conn_fit
|
All lights are green @aopy !!! Thank you so much 👍 |
|
@EtienneCmb no problem :) thanks for your input! |
No description provided.