Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Move detrending from AverageModel to its own Filter #63

Open
oesteban opened this issue Jan 22, 2025 · 0 comments · May be fixed by #71
Open

Move detrending from AverageModel to its own Filter #63

oesteban opened this issue Jan 22, 2025 · 0 comments · May be fixed by #71

Comments

@oesteban
Copy link
Member

In the context of #62, I'm simplifying the AverageModel (renamed as ExpectationModel to better capture that the statistic can be changed) and removing this code:

        # Regress out global signal differences
        if kwargs.pop("equalize", False):
            data = data.copy().astype("float32")
            reshaped_data = (
                data.reshape((-1, data.shape[-1])) if self._mask is None else data[self._mask]
            )
            p5 = np.percentile(reshaped_data, 5.0, axis=0)
            p95 = np.percentile(reshaped_data, 95.0, axis=0) - p5
            data = (data - p5) * p95.mean() / p95 + p5.mean()

This code was there to "detrend" global signals. It should be a filter and not part of the model.

@jhlegarreta jhlegarreta linked a pull request Jan 25, 2025 that will close this issue
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant