{ "info": { "author": "", "author_email": "", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Science/Research", "License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication", "Operating System :: MacOS", "Operating System :: POSIX", "Operating System :: Unix", "Programming Language :: Python", "Programming Language :: Python :: 3.7", "Topic :: Scientific/Engineering" ], "description": ".. -*- mode: rst -*-\n\n|Travis|_ |AppVeyor|_ |Codecov|_ |CircleCI|_ |ReadTheDocs|_\n\n.. |Travis| image:: https://travis-ci.org/nimh-mbdu/sklearn-lmer.svg?branch=master\n.. _Travis: https://travis-ci.org/nimh-mbdu/sklearn-lmer\n\n.. |AppVeyor| image:: https://ci.appveyor.com/api/projects/status/pifxyfnev94kbej4/branch/master?svg=true\n.. _AppVeyor: https://ci.appveyor.com/project/Shotgunosine/sklearn-lmer/branch/master\n\n.. |Codecov| image:: https://codecov.io/gh/nimh-mbdu/sklearn-lmer/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/nimh-mbdu/sklearn-lmer\n.. _Codecov: https://codecov.io/gh/nimh-mbdu/sklearn-lmer\n\n.. |CircleCI| image:: https://circleci.com/gh/nimh-mbdu/sklearn-lmer.svg?style=shield&circle-token=:circle-token\n.. _CircleCI: https://circleci.com/gh/nimh-mbdu/sklearn-lmer/tree/master\n\n.. |ReadTheDocs| image:: https://readthedocs.org/projects/sklearn-lmer/badge/?version=latest\n.. _ReadTheDocs: https://sklearn-lmer.readthedocs.io/en/latest/?badge=latest\n\nsklearn-lmer - Scikit-learn estimator wrappers for pymer4 wrapped LME4 mixed effects models\n===========================================================================================\n\n.. _sklearn: https://scikit-learn.org\n.. _pymer4: http://eshinjolly.com/pymer4/\n.. _lme4: https://cran.r-project.org/web/packages/lme4/index.html\n.. _documentation: https://sklearn-lmer.readthedocs.io/en/latest/\n\nsklearn-lmer is a simple package to wrap the convienience \nof pymer4_'s lme4_ wrapping in a *mostly* sklearn_ compatible regressor class.\n\nRefer to the documentation_ for examples and api.\n\nLinear mixed effects regressions\n--------------------------------\n\nLinear mixed effects regressions are great, but if you're here,\nyou probably already agree. You can find more infomration about\nthem elsewhere, the links lme4_ aren't a bad place to start. \n\nInstallation\n------------\n\nMixing r and python used to be a bit more fraught, but rpy2 and conda\nseem to be working together better these days.\nTo install first get a conda environment with the dependencies::\n\n >>> conda create -n sklmer numpy scipy rpy2=2.9.4 r-lme4 r-lmertest r-lsmeans tzlocal\n\nThen pip install sklearn-lmer::\n\n >>> pip install sklearn-lmer\n\nUsage\n-----\nIt can be imported as::\n\n >>> from sklmer import LmerRegressor\n\nNow the *mostly* part of that compatiblity is that init does have two required paramters:\na formula and the names of the columns holding independent variables and grouping variables\n(I've called this parameter ``X_cols`` even though it is more than just X). When I use this I've got my data in a dataframe and just pass ``dataframe.columns`` with ``X_cols`` like so ::\n\n >>> df = pd.read_csv(os.path.join(get_resource_path(),'sample_data.csv'))\n >>> lreg = LmerRegressor('DV ~ IV2 + (IV2|Group)', X_cols=df.columns)\n\nIf you want the best compatibility with sklearn it probably makes sense to split\nout the dataframe into X, y, and group variables, though since you've defined a formula\nit's ok if the y and group columns are in X ::\n\n >>> X = df.values\n >>> y = df.DV.values\n >>> groups = df.Group.values\n\nOnce you've done that, it seems to work fine with other sklearn tools, like ``cross_val_score`` ::\n\n >>> logo = LeaveOneGroupOut()\n >>> cross_val_score(lreg, X=X, y=y, cv=logo.split(X, groups=groups), scoring='neg_mean_squared_error')\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/nimh-mbdu/sklearn-lmer", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/nimh-mbdu/sklearn-lmer", "keywords": "", "license": "CC0", "maintainer": "D. Nielson", "maintainer_email": "dylan.nielson@gmail.com", "name": "sklearn-lmer", "package_url": "https://pypi.org/project/sklearn-lmer/", "platform": "", "project_url": "https://pypi.org/project/sklearn-lmer/", "project_urls": { "Download": "https://github.com/nimh-mbdu/sklearn-lmer", "Homepage": "https://github.com/nimh-mbdu/sklearn-lmer" }, "release_url": "https://pypi.org/project/sklearn-lmer/0.0.4/", "requires_dist": [ "numpy", "scipy", "scikit-learn", "pandas", "pymer4", "sphinx ; extra == 'docs'", "sphinx-gallery ; extra == 'docs'", "sphinx-rtd-theme ; extra == 'docs'", "numpydoc ; extra == 'docs'", "matplotlib ; extra == 'docs'", "pytest ; extra == 'tests'", "pytest-cov ; extra == 'tests'" ], "requires_python": "", "summary": "Scikit-learn estimator wrappers for pymer4 wrapped LME4 mixed effects models", "version": "0.0.4" }, "last_serial": 5793018, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "30f8011cb1372bc1b056350470aa90b4", "sha256": "2a47b73adc2d862330711c59c01f92062c2c58338ac86d16ed419999c1a7cdd9" }, "downloads": -1, "filename": "sklearn_lmer-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "30f8011cb1372bc1b056350470aa90b4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8384, "upload_time": "2019-09-06T15:18:55", "url": "https://files.pythonhosted.org/packages/63/c7/b91fb7341999880f664f5d832600f1c98c1c495824c169f787a00809136e/sklearn_lmer-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "db0b7f1ff2fb1a3ad5a907981dd9e346", "sha256": "9d0fb03c1908b557bd3c2473f2e281492ba0028bb76b66d14acdb973c0ac3636" }, "downloads": -1, "filename": "sklearn-lmer-0.0.2.tar.gz", "has_sig": false, "md5_digest": "db0b7f1ff2fb1a3ad5a907981dd9e346", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20708, "upload_time": "2019-09-06T15:18:57", "url": "https://files.pythonhosted.org/packages/c1/e0/9354ab47d8effc3122c3d01e0c4e9ec728ec332e16d09bc315c8eb68994e/sklearn-lmer-0.0.2.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "b9e6fedd2b8bcfb35768e70cdc3f9b65", "sha256": "603e14057a128eb968887fd8aba3475a78c82a32e735d22d606e50a310815951" }, "downloads": -1, "filename": "sklearn_lmer-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "b9e6fedd2b8bcfb35768e70cdc3f9b65", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9090, "upload_time": "2019-09-06T16:12:16", "url": "https://files.pythonhosted.org/packages/0d/3c/388770d31cee6b10fb25272ded761e9e1ccdba2612d3261e405f1dff1442/sklearn_lmer-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6f6696f4f96c565443d6ba344f4140f8", "sha256": "df71f187608b8513be09bf5cc1965a982f48de26bda716ff9bd1358412d3ac46" }, "downloads": -1, "filename": "sklearn-lmer-0.0.4.tar.gz", "has_sig": false, "md5_digest": "6f6696f4f96c565443d6ba344f4140f8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21406, "upload_time": "2019-09-06T16:12:17", "url": "https://files.pythonhosted.org/packages/b9/7f/364fa42cda145bd2f10baa7e77aa16be9838be177b07f46dbfdd9800642f/sklearn-lmer-0.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b9e6fedd2b8bcfb35768e70cdc3f9b65", "sha256": "603e14057a128eb968887fd8aba3475a78c82a32e735d22d606e50a310815951" }, "downloads": -1, "filename": "sklearn_lmer-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "b9e6fedd2b8bcfb35768e70cdc3f9b65", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9090, "upload_time": "2019-09-06T16:12:16", "url": "https://files.pythonhosted.org/packages/0d/3c/388770d31cee6b10fb25272ded761e9e1ccdba2612d3261e405f1dff1442/sklearn_lmer-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6f6696f4f96c565443d6ba344f4140f8", "sha256": "df71f187608b8513be09bf5cc1965a982f48de26bda716ff9bd1358412d3ac46" }, "downloads": -1, "filename": "sklearn-lmer-0.0.4.tar.gz", "has_sig": false, "md5_digest": "6f6696f4f96c565443d6ba344f4140f8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21406, "upload_time": "2019-09-06T16:12:17", "url": "https://files.pythonhosted.org/packages/b9/7f/364fa42cda145bd2f10baa7e77aa16be9838be177b07f46dbfdd9800642f/sklearn-lmer-0.0.4.tar.gz" } ] }