How to use the pymer4.Lmer function in pymer4

To help you get started, we’ve selected a few pymer4 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nimh-mbdu / sklearn-lmer / sklmer / _estimators.py View on Github external
y : array-like, shape (n_samples,)
            The target values (class labels in classification, real numbers in
            regression).
        data: pandas.DataFrame
            Data can also be passed to fit as a dataframe.

        Returns
        -------
        self : object
            Returns self.
        """

        self._response_name = self.formula.split("~")[0].strip()

        self.data_ = self._make_data(X=X, y=y, data=data)
        self.model = Lmer(self.formula, data=self.data_, family=self.family)

        self.model.fit(summarize=False, verbose=False)
        if self.model.warnings is not None:
            if ("converge" in self.model.warnings) | np.any(
                ["converge" in mw for mw in self.model.warnings]
            ):
                self.converged = False
            else:
                self.converged = True
        else:
            self.converged = True
        self.coef_ = self.model.coefs.iloc[1:, 0].values
        self.intercept_ = self.model.coefs.iloc[0, 0]
        return self