GenBench / genbench_cbt_2023

The official Genbench Collaborative Benchmarking Task repository 2023 (Archived)
Other
14 stars 18 forks source link

Using additional packages #36

Open LucWeber opened 11 months ago

LucWeber commented 11 months ago

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 commented 11 months ago

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 commented 11 months ago

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 commented 11 months ago

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 commented 11 months ago

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

LucWeber commented 11 months ago

No problem, thanks for letting me know!