Code Monkey home page Code Monkey logo

fastsrm's People

Contributors

bthirion avatar hugorichard avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

emdupre

fastsrm's Issues

add_subjects() fails if used on a model that is not fit

I tried to use add_subjects() to generate subject-level spatial maps corresponding to temporal components on a FastSRM model that was defined but not fit. This is the error traceback I get:

TypeError Traceback (most recent call last)
in
----> 1 fast_srm_ica.add_subjects(sub_movie, shared_resp_ica)

~/FastSRM/fastsrm/fastsrm.py in add_subjects(self, imgs, shared_response)
1752 else:
1753 path = os.path.join(
-> 1754 self.temp_dir, "basis_%i" % (len(self.basis_list) + i))
1755 np.save(path, basis_i)
1756 basis.append(path + ".npy")

TypeError: object of type 'NoneType' has no len()

add_subjects() works well if I use it on a model that has been fit previously.

Add a proper error message when n_components > min(n_features, n_samples)

When run on
`
X = [np.random.rand(10, 12) for _ in range(2)]
Xnew = [np.random.rand(10, 12)]
srm = FastSRM(n_components=12, n_iter=10, verbose=True,)
srm.fit(X)
S = srm.transform(X)
print(S.shape)
srm.add_subjects(Xnew, S)

`
The fit does not complain and an error is thrown on add_subjects.
This is missleadind. An error should be thrown at fit time when n_components > min(n_features, n_samples).

Update FastSRM install_requires for pip deprecation

When adding fastSRM as an fmralign dependency, we see a build failure. Local installation confirms this is a deprecation from pip:

DEPRECATION: fastsrm 0.0.4 has a non-standard dependency specifier scipy>=0.18.0numpy>=1.12scikit-learn>=0.23joblib>=1.1.0matplotlib>=2.0.0pytest>=6.2.5. pip 23.3 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of fastsrm or contact the author to suggest that they release a version with a conforming dependency specifiers. Discussion can be found at pypa/pip#12063

We can correct this by adding delimiters in fastSRM's install_requires.

I'll open a PR for this, but please let me know how you'd like to handle longer term maintenance, @hugorichard ! i.e., should we vendor the relevant code within fmralign ? Any thoughts are appreciated !

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.