Git Product home page Git Product logo

brainets / frites Goto Github PK

View Code? Open in Web Editor NEW
73.0 73.0 19.0 421.73 MB

Framework for Information Theoretical analysis of Electrophysiological data and Statistics

Home Page: https://brainets.github.io/frites/

License: BSD 3-Clause "New" or "Revised" License

Python 99.94% Makefile 0.06%
brainhack brainhack-marseille brainweb cluster-based electrophysiological-data ffx functional-connectivity gaussian-copula group-level information-theory institut-neurosciences-timone neurophysiological-data rfx statistics

frites's People

Contributors

allcontributors[bot] avatar aopy avatar brovelli avatar dependabot[bot] avatar etiennecmb avatar stansstanman avatar viniciuslima94 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

frites's Issues

FIT directed to unidirectionnal

@brovelli as you pointed out, the current FIT input parameter for computing directed FIT is a boolean value called directed. As you said, it's not really explicit since it's always directed and it would be better to have a "uni/bidirectional" input parameter.

We should discuss about it. Usually I prefer using short input parameters therefore I would exclude the use of the complete words "unidirectional" or "bidirectional".

I propose the two following solutions instead of having directed=True/False :
1 - direction="uni"/"bi"
2 - unidirectional=True/False
3 - net=True/False

My favorite order is 3 / 2 / 1. Do you have other propositions?

`subject` and `subjects` dimension

When exporting conjunction analysis of get_params, the first one contains a subject dimension while the second is subjects. This can be problematic when saving datasets. Need to be fixed.

Personal sanity check problem

Hi, after that I used frites a lot, I ran a sanity check on me and I found out that my cholesterol level is too high.
I suggest to change the oil more often.
Thanks in advance.

MI values when cholesky failed

@nvoges @brovelli

The current version of the code failed on Nicoles' simulated data, because of the cholesky decomposition when the data are redundant.

@brovelli suggested np.clip(mi, 0, mi). This avoid negative MI values (I think it should also works on negative infinite). @nvoges do you get infinite values or NaN values? Because if NaN, the clip is not going to make a difference. In addition, I've seen negative MI because of the bias correction so I'm not sure it's a good idea to put a hard threshold at 0, especially because we also compute permutations and I'm afraid of having many permutations to zero because of that.

What do u think?

Interest in merging work into mne-connectivity?

Hi,

I spoke with the MNE core dev team earlier and we saw that you built a package on top of MNE-Python. Exciting!

We recently moved all the connectivity submodule into a new package called mne-connectivity (https://github.com/mne-tools/mne-connectivity). We've made some abstractions for data structures concerning connectivity and also have a CI/unit-testing pipeline in place with MNE. In favor of trying to pool resources together and have a 1-stop shop for MNE connectivity type analyses, would you be interested in joining forces with mne-connectivity?

Lmk if I missed anything.

PS. I did a year at Aix-Marseille actually 2017-18 under a fellowship during my PhD :p

cc: @drammock

CI

Github action for :

  1. Test different versions of Python
  2. Build the doc
  3. Flake
  4. PR

GPU integrations (Brainhack Marseille 2020)

Follow up the Brainhack Marseille :

  • Integration of the contributors
  • Integration of the core functions
  • Integration in connectivity functions (agnostic)
  • Integration into the documentation

KeyError: 'y' when using wf.fit()

Here is the code:

import numpy as np

from mne import EpochsArray, create_info
from frites.dataset import DatasetEphy

import matplotlib.pyplot as plt
n_subjects = 5
n_epochs = 10
n_channels = 5
n_times = 100
sf = 512

x, ch = [], []
for k in range(n_subjects):
    # generate single subject data
    x_suj = np.random.rand(n_epochs, n_channels, n_times)
    # generate some random channel names
    ch_suj = np.array([f"ch_{r}" for r in range(n_channels)])
    # concatenate in a list
    x.append(x_suj)
    ch.append(ch_suj)
# finally lets create a time vector
times = np.arange(n_times) / sf

x_mne = []
for k in range(n_subjects):
    # create some informations
    info = create_info(ch[k].tolist(), sf)
    # create the Epoch of this subject
    epoch = EpochsArray(x[k], info, tmin=times[0], verbose=False)
    # finally, replace it in the original list
    x_mne.append(epoch)

dt = DatasetEphy(x_mne)

mi_type = 'cc'

# define the workflow
wf = WfMi(mi_type=mi_type)
# compute the mutual information
mi, _ = wf.fit(dt, mcp=None, n_jobs=1)

Using the development version of Frites

HTML representation of the `DatasetEphy`

When printing a DatasetEphy, a xarray.Dataset is created. However, two issues emerge with this definition :

  1. It creates a duplicates of the data
  2. To be able to align the data across subjects, xarray fill the missing cases with NaN. This can potentially lead to misleading interpretations

Need to be fixed (see here)

4d (multiple frequencies) reshape issue in DatasetEphy

Hello @EtienneCmb ,
when 4d arrays are used in DatasetEphy as x (analysis on multiples frequency bands), the reshape in 3d form does not take in consideration the single subject's number of epochs.
Here the code I'm referring at:
in frites/dataset/ds_ephy.py in line 142

n_e, n_r, n_f, n_t = x[0].shape
for k in range(len(x)):
    x[k] = x[k].reshape(n_e, n_r, n_f * n_t)

Thank you so much BG! 😘

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.