Skip to content
프로젝트

소개

All the convenience of lme4 in python

과학 및 공학

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
+1
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Pymer4: Generalized Linear & Multi-level Models in Python

image image image
image image image

pymer4 is a statistics library for estimating various regression models, multi-level models, and generalized-linear-mixed models in Python. Jealous of R's lovely model syntax but prefer to work in the scientific Python ecosystem? This package has got you covered! pymer4 provides a clean interface that hides the back-and-forth code required when moving between R and Python. This is accomplished using rpy2 to interface between languages.

Check out the documentation here

from pymer4.models import lm, lmer
from pymer4 import load_dataset

sleep = load_dataset('sleep')

# Linear regression
ols = lm('Reaction ~ Days', data=sleep)
ols.fit()

# Multi-level model
lmm = lmer('Reaction ~ Days + (Days | Subject)', data=sleep)
lmm.fit()

Why?

The scientific Python ecosystem has tons of fantastic libraries for data-analysis and statistical modeling such as statsmodels, pingouin, scikit-learn, and bambi for bayesian models to name a few. However, Python still sorely lacks a unified formula-based modeling interface that rivals what's available in R (and the tidyverse) for frequentist statistics. This makes it frustrating for beginners and advanced Python analysts-alike to jump between different tools in order to accomplish a single task. So, rather than completely reinvent the wheel, pymer4 aims to bring the best R's robust modeling capabilities to Python for the most common General(ized)-Linear-(Mixed)-Modeling (GLMMs) needs in the social and behavioral sciences.

At the same time, pymer4 includes numerous quality-of-life features for common tasks you're likely to do when working with models (e.g. automatically calculated fit statistics, residuals, p-values for mixed-models, bootstrapped confidence-intervals, random-effects deviances, etc). By bringing together functionality spread across several popular R tools, we've aimed for intuitive-usability. pymer4 also notably builds on top of the polars Dataframe library rather than pandas. This keeps code simple, fast, and efficient, while opening the door for enhanced future functionality.

Citing

If you use pymer4 in your own work, please cite:

Jolly, (2018). Pymer4: Connecting R and Python for Linear Mixed Modeling. Journal of Open Source Software, 3(31), 862, https://doi.org/10.21105/joss.00862

Contributing

Contributions are always welcome!
If you are interested in contributing feel free to check out the open issues and check out the contribution guidelines.

관련 프로젝트 살펴보기

불러오는 중…