Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Using additional packages #36

Open
LucWeber opened this issue Oct 24, 2023 · 5 comments
Open

Using additional packages #36

LucWeber opened this issue Oct 24, 2023 · 5 comments

Comments

@LucWeber
Copy link
Contributor

LucWeber commented Oct 24, 2023

Hey GenBench team!
I was checking why the test on my PR (ICL-consistency test) failed and saw that it is due to an additional module (statsmodels) I am using.
Is there a way of specifying requirements such that statsmodels will be automatically installed?

Thanks a lot for your great work,
Lucas

@kazemnejad
Copy link
Contributor

Hey Lucas.

Thanks for bringing up the issue. Could you please mention which part/functionality of the statsmodels do you need in your codebase?

@LucWeber
Copy link
Contributor Author

LucWeber commented Oct 25, 2023

I am using the statsmodel.api to fit a GLM in my analysis:

import statsmodels.api as sm

...

class IclConsistencyTestAnli(Task):
    """Python implementation of the ICL consistency test task."""

    ...

    @staticmethod
    def _calculate_main_effects(X: ndarray, y: ndarray) -> Tuple[ndarray, ndarray]:
        """

        :return:
        """
        # Add a constant column to X for the intercept
        X = sm.add_constant(X)

        # Fit GLM
        model = sm.GLM(y, X)
        results = model.fit()

        return results.params[1], results.pvalues[1]

@LucWeber
Copy link
Contributor Author

Hey @kazemnejad ,
I was wondering what happened to this issue. Should I change the PR or will it be possible to use statsmodel?
All the best,
Lucas

@kazemnejad
Copy link
Contributor

Hey Lucas, Sorry for my late reply. Yes, we will add this dependency to the framework to support your task. Thanks..

@LucWeber
Copy link
Contributor Author

No problem, thanks for letting me know!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants