Giter Club home page Giter Club logo

Comments (8)

GaelVaroquaux avatar GaelVaroquaux commented on June 18, 2024

After discussion with Philippe, we find much more consistant to ignore masker
parameters given to MultiPCA in this case (if the user gives us a masker, we
assume that he knows what he's doing).

I'd rather have it the other way: explicit is better than implicit.

from nilearn.

AlexandreAbraham avatar AlexandreAbraham commented on June 18, 2024

Reverted.

from nilearn.

pgervais avatar pgervais commented on June 18, 2024

My thoughts on this.

MultiPCA needs a mask for its computations. The user can provide it or let the object compute it from data. The latter situation can be handled in two ways: either by providing a masker object, or by providing the options taken by the masker object (and let MultiPCA create one). What the user would write is respectively (in extremely simplified form, for the purpose of the example):

MultiPCA(smoothing_fwhm=2)

or

masker = MultiNiftiMasker(smoothing_fwhm=2)
MultiPCA(mask=masker)

The second situation being useful when the same masker (not mask) is to be reused in different places.

The question raised in this issue is what should happen in this situation:

masker = MultiNiftiMasker(smoothing_fwhm=2)
MultiPCA(mask=masker, smoothing_fwhm=3)

What I think after talking with Alexandre is that this situation must not happen: this is an error. The Python langage prevents a keyword argument from being provided twice. Let's do the same. The present example is a conflict, which is ambiguous. Giving priority to either value (that in masker or that provided to MultiPCA itself) is implicit in all cases.

from nilearn.

AlexandreAbraham avatar AlexandreAbraham commented on June 18, 2024

For the moment, if we are in such a case, the value of the MultiPCA is taken and we raise a warning. If it's OK, then we can close this issue.

from nilearn.

GaelVaroquaux avatar GaelVaroquaux commented on June 18, 2024

For the moment, if we are in such a case, the value of the MultiPCA is taken
and we raise a warning.

I am not sure what your sentence mean.

from nilearn.

AlexandreAbraham avatar AlexandreAbraham commented on June 18, 2024

if there is a conflict between the parameters of the MultiNiftiMasker and of the MultiPCA, the parameters of the MultiPCA are kept and a warning message tell the user that parameters of the masker were overridden

from nilearn.

GaelVaroquaux avatar GaelVaroquaux commented on June 18, 2024

if there is a conflict between the parameters of the MultiNiftiMasker and of
the MultiPCA, the parameters of the MultiPCA are kept and a warning message
tell the user that parameters of the masker were overridden

All good!

from nilearn.

AlexandreAbraham avatar AlexandreAbraham commented on June 18, 2024

OK, I close this issue then.

from nilearn.

Related Issues (20)

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.