rsklpr


Namersklpr JSON
Version 0.8.1 PyPI version JSON
download
home_pagehttps://github.com/yaniv-shulman/rsklpr
SummaryImplementation of the Robust Local Polynomial Regression with Similarity Kernel draft paper
upload_time2024-08-02 01:54:16
maintainerNone
docs_urlNone
authorYaniv Shulman
requires_python<3.12,>=3.8.0
licenseNone
keywords statistics robust statistics regression robust regression local polynomial regression machine learning locally weighted regression
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Robust Local Polynomial Regression with Similarity Kernels #

[![Downloads](https://static.pepy.tech/badge/rsklpr)](https://pepy.tech/project/rsklpr) ![Tests](https://github.com/yaniv-shulman/rsklpr/actions/workflows/linting_and_tests.yml/badge.svg?branch=main) [![phorm.ai](https://img.shields.io/badge/ask%20phorm.ai-8A2BE2)](https://www.phorm.ai/query?projectId=04cda149-26bc-4050-bfa6-5b28ee16ceda) [![Pyversions](https://img.shields.io/pypi/pyversions/rsklpr.svg?style=flat-square)](https://pypi.python.org/pypi/rsklpr)

## TL;DR ##
This library is useful to perform robust locally weighted regression (similar to [LOESS](https://en.wikipedia.org/wiki/Local_regression)) in Python when:
1. There are no particular assumptions on the underlying function except that it is "reasonably smooth". In particular,
you don't know which parametric model to specify or if an appropriate model exists. 
1. There are no particular assumptions on the type and intensity of noise present.
1. There are no particular assumptions on the presence of outliers and their extent.
1. You may want to predict in locations not explicitly present in the dataset but also not too far from existing
observations or far outside the areas where observations exist. 
1. The independent inputs are univariate or multivariate.
1. The dependent variable is univariate.
1. You want a straightforward hassle-free way to tune the model and the smoothness of fit.
1. You may want to calculate confidence intervals.
1. You may want to filter noise to recover the original underlying process.
1. You may want to impute or resample the data. 

If the above use cases hold then this library could be useful for you. Have a look at this notebook
https://nbviewer.org/github/yaniv-shulman/rsklpr/tree/main/docs/usage.ipynb for an example of how to use
this library to perform regression easily.

## Installation ##
Install from [PyPI](https://pypi.org/project/rsklpr/) using pip (preferred method):
```bash
pip install rsklpr
```

### What's new? ###
- Version 0.7.0 - Metrics including local R-Squared and more efficient computation of WLS. 
- Version 0.6.0 - Bootstrap inference and confidence intervals


## Details ##
Local polynomial regression (LPR) is a powerful and flexible statistical technique that has gained increasing popularity
in recent years due to its ability to model complex relationships between variables. Local polynomial regression
generalizes the polynomial regression and moving average methods by fitting a low-degree polynomial to a nearest
neighbors subset of the data at the location. The polynomial is fitted using weighted ordinary least squares, giving
more weight to nearby points and less weight to points further away. Local polynomial regression is however susceptible
to outliers and high leverage points which may cause an adverse impact on the estimation accuracy. This library 
implements a variant of LPR presented in the 
[Robust Local Polynomial Regression with Similarity Kernels draft paper](https://github.com/yaniv-shulman/rsklpr/tree/main/paper/rsklpr.pdf) which uses a generalized similarity kernel
that assign robust weights to mitigate the adverse effect of outliers in the local neighborhood by estimating and
utilizing the density at the local locations. 


### Experimental results ###
The experimental results and demonstration of the library for various experimental settings are available as interactive
Jupyter notebooks at https://nbviewer.org/github/yaniv-shulman/rsklpr/tree/main/src/experiments/

### KDE Implementation ###
KDE implementation is a copy of the code from statsmodels https://www.statsmodels.org/stable/index.html. The copy is done to
remove statsmodels as a dependency of this package since statsmodels is quite heavy and pulls a lot of additional
packages.

## Contribution and feedback ##
The paper is work in progress and the library in early stages of development but both are in a useful state.
Contributions and feedback are most welcome both to the paper and the code. Please see
[CONTRIBUTING.md](https://github.com/yaniv-shulman/rsklpr/tree/main/CONTRIBUTING.md) for further details.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/yaniv-shulman/rsklpr",
    "name": "rsklpr",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.12,>=3.8.0",
    "maintainer_email": null,
    "keywords": "statistics, robust statistics, regression, robust regression, local polynomial regression, machine learning, locally weighted regression",
    "author": "Yaniv Shulman",
    "author_email": "yaniv@shulman.info",
    "download_url": "https://files.pythonhosted.org/packages/07/7e/52b9844e4803a0089ab4196e54c5b12b453131b38ea23a68a5f01d4130c5/rsklpr-0.8.1.tar.gz",
    "platform": null,
    "description": "# Robust Local Polynomial Regression with Similarity Kernels #\n\n[![Downloads](https://static.pepy.tech/badge/rsklpr)](https://pepy.tech/project/rsklpr) ![Tests](https://github.com/yaniv-shulman/rsklpr/actions/workflows/linting_and_tests.yml/badge.svg?branch=main) [![phorm.ai](https://img.shields.io/badge/ask%20phorm.ai-8A2BE2)](https://www.phorm.ai/query?projectId=04cda149-26bc-4050-bfa6-5b28ee16ceda) [![Pyversions](https://img.shields.io/pypi/pyversions/rsklpr.svg?style=flat-square)](https://pypi.python.org/pypi/rsklpr)\n\n## TL;DR ##\nThis library is useful to perform robust locally weighted regression (similar to [LOESS](https://en.wikipedia.org/wiki/Local_regression)) in Python when:\n1. There are no particular assumptions on the underlying function except that it is \"reasonably smooth\". In particular,\nyou don't know which parametric model to specify or if an appropriate model exists. \n1. There are no particular assumptions on the type and intensity of noise present.\n1. There are no particular assumptions on the presence of outliers and their extent.\n1. You may want to predict in locations not explicitly present in the dataset but also not too far from existing\nobservations or far outside the areas where observations exist. \n1. The independent inputs are univariate or multivariate.\n1. The dependent variable is univariate.\n1. You want a straightforward hassle-free way to tune the model and the smoothness of fit.\n1. You may want to calculate confidence intervals.\n1. You may want to filter noise to recover the original underlying process.\n1. You may want to impute or resample the data. \n\nIf the above use cases hold then this library could be useful for you. Have a look at this notebook\nhttps://nbviewer.org/github/yaniv-shulman/rsklpr/tree/main/docs/usage.ipynb for an example of how to use\nthis library to perform regression easily.\n\n## Installation ##\nInstall from [PyPI](https://pypi.org/project/rsklpr/) using pip (preferred method):\n```bash\npip install rsklpr\n```\n\n### What's new? ###\n- Version 0.7.0 - Metrics including local R-Squared and more efficient computation of WLS. \n- Version 0.6.0 - Bootstrap inference and confidence intervals\n\n\n## Details ##\nLocal polynomial regression (LPR) is a powerful and flexible statistical technique that has gained increasing popularity\nin recent years due to its ability to model complex relationships between variables. Local polynomial regression\ngeneralizes the polynomial regression and moving average methods by fitting a low-degree polynomial to a nearest\nneighbors subset of the data at the location. The polynomial is fitted using weighted ordinary least squares, giving\nmore weight to nearby points and less weight to points further away. Local polynomial regression is however susceptible\nto outliers and high leverage points which may cause an adverse impact on the estimation accuracy. This library \nimplements a variant of LPR presented in the \n[Robust Local Polynomial Regression with Similarity Kernels draft paper](https://github.com/yaniv-shulman/rsklpr/tree/main/paper/rsklpr.pdf) which uses a generalized similarity kernel\nthat assign robust weights to mitigate the adverse effect of outliers in the local neighborhood by estimating and\nutilizing the density at the local locations. \n\n\n### Experimental results ###\nThe experimental results and demonstration of the library for various experimental settings are available as interactive\nJupyter notebooks at https://nbviewer.org/github/yaniv-shulman/rsklpr/tree/main/src/experiments/\n\n### KDE Implementation ###\nKDE implementation is a copy of the code from statsmodels https://www.statsmodels.org/stable/index.html. The copy is done to\nremove statsmodels as a dependency of this package since statsmodels is quite heavy and pulls a lot of additional\npackages.\n\n## Contribution and feedback ##\nThe paper is work in progress and the library in early stages of development but both are in a useful state.\nContributions and feedback are most welcome both to the paper and the code. Please see\n[CONTRIBUTING.md](https://github.com/yaniv-shulman/rsklpr/tree/main/CONTRIBUTING.md) for further details.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Implementation of the Robust Local Polynomial Regression with Similarity Kernel draft paper",
    "version": "0.8.1",
    "project_urls": {
        "Homepage": "https://github.com/yaniv-shulman/rsklpr",
        "Repository": "https://github.com/yaniv-shulman/rsklpr"
    },
    "split_keywords": [
        "statistics",
        " robust statistics",
        " regression",
        " robust regression",
        " local polynomial regression",
        " machine learning",
        " locally weighted regression"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "91bfa2e224a67b330e40553c6dd3a12f354ad53e4d4e441b311994a1ae87e528",
                "md5": "a363c29c792d31fa2b7822bbc5e35b89",
                "sha256": "377199230816f92493aefcaafb6b4d23518be6edc68473e3ab5337f94e65ab52"
            },
            "downloads": -1,
            "filename": "rsklpr-0.8.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a363c29c792d31fa2b7822bbc5e35b89",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.12,>=3.8.0",
            "size": 33851,
            "upload_time": "2024-08-02T01:54:14",
            "upload_time_iso_8601": "2024-08-02T01:54:14.460619Z",
            "url": "https://files.pythonhosted.org/packages/91/bf/a2e224a67b330e40553c6dd3a12f354ad53e4d4e441b311994a1ae87e528/rsklpr-0.8.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "077e52b9844e4803a0089ab4196e54c5b12b453131b38ea23a68a5f01d4130c5",
                "md5": "e8e5da72592c5ec9d1c279767f635cda",
                "sha256": "5c9f7649ad4b437188ad9fa670feddf4f5c9b2542d8b2efe3ef305d70d85b649"
            },
            "downloads": -1,
            "filename": "rsklpr-0.8.1.tar.gz",
            "has_sig": false,
            "md5_digest": "e8e5da72592c5ec9d1c279767f635cda",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.12,>=3.8.0",
            "size": 32548,
            "upload_time": "2024-08-02T01:54:16",
            "upload_time_iso_8601": "2024-08-02T01:54:16.602547Z",
            "url": "https://files.pythonhosted.org/packages/07/7e/52b9844e4803a0089ab4196e54c5b12b453131b38ea23a68a5f01d4130c5/rsklpr-0.8.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-02 01:54:16",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yaniv-shulman",
    "github_project": "rsklpr",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "rsklpr"
}
        
Elapsed time: 4.33343s