Skip to content

Speed up effects function #214

Open
Open
@jschepers

Description

@jschepers
Collaborator

At the moment, calculating marginal effects for several subjects, channels, predictors etc. is rather time-consuming.
I think it would be worth checking whether there is optimization potential for the effects function.

Example: Computing the marginal effects for one subject with an Unfold model with 128 channels, 2 basis functions and specifying one predictor with 3 levels (with 9 predictor variables in total in the model), took about 99.4 seconds.

This does not scale well if one has 20-30 subjects and more predictor values.

Activity

behinger

behinger commented on Sep 2, 2024

@behinger
Member

acknowledged. I did a deep dive into the effects function to try to make it faster - and for small models I succeeded. But I also noticed I didnt get any gains for large models.

I already shifted every column to a special vector that encodes unique values as Ints (forgot the name right now). I will try to look into it again. I would also like to be able to calculate effects only for specific channels.

I did see much faster speeds, with me needing 200s for 30subjects with a slightly smaller model. So not entirely sure what happenening here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @behinger@jschepers

        Issue actions

          Speed up `effects` function · Issue #214 · unfoldtoolbox/Unfold.jl