========
A Python implementation of Jerome Friedman's Multivariate Adaptive Regression Splines algorithm,
in the style of scikit-learn. The py-earth package implements Multivariate Adaptive Regression Splines using Cython and provides an interface that is compatible with scikit-learn's Estimator, Predictor, Transformer, and Model interfaces. For more information about
Multivariate Adaptive Regression Splines, see the references below.
## Now With Missing Data Support!
The py-earth package now supports missingness in its predictors. Just set `allow_missing=True` when constructing an `Earth` object.
## Requesting Feedback
If there are other features or improvements you'd like to see in py-earth, please send me an email or open or comment on an issue. In particular, please let me know if any of the following are important to you:
1. Improved speed
2. Exporting models to additional formats
3. Support for shared memory multiprocessing during fitting
4. Support for cyclic predictors (such as time of day)
5. Better support for categorical predictors
6. Better support for large data sets
7. Iterative reweighting during fitting
## Installation
Make sure you have numpy and scikit-learn installed. Then do the following:
```
git clone git://github.com/scikit-learn-contrib/py-earth.git
cd py-earth
sudo python setup.py install
```
## Usage
```python
import numpy
from pyearth import Earth
from matplotlib import pyplot
#Create some fake data
numpy.random.seed(0)
m = 1000
n = 10
X = 80*numpy.random.uniform(size=(m,n)) - 40
y = numpy.abs(X[:,6] - 4.0) + 1*numpy.random.normal(size=m)
#Fit an Earth model
model = Earth()
model.fit(X,y)
#Print the model
print(model.trace())
print(model.summary())
#Plot the model
y_hat = model.predict(X)
pyplot.figure()
pyplot.plot(X[:,6],y,'r.')
pyplot.plot(X[:,6],y_hat,'b.')
pyplot.xlabel('x_6')
pyplot.ylabel('y')
pyplot.title('Simple Earth Example')
pyplot.show()
```
## Other Implementations
I am aware of the following implementations of Multivariate Adaptive Regression Splines:
1. The R package earth (coded in C by Stephen Millborrow): http://cran.r-project.org/web/packages/earth/index.html
2. The R package mda (coded in Fortran by Trevor Hastie and Robert Tibshirani): http://cran.r-project.org/web/packages/mda/index.html
3. The Orange data mining library for Python (uses the C code from 1): http://orange.biolab.si/
4. The xtal package (uses Fortran code written in 1991 by Jerome Friedman): http://www.ece.umn.edu/users/cherkass/ee4389/xtalpackage.html
5. MARSplines by StatSoft: http://www.statsoft.com/textbook/multivariate-adaptive-regression-splines/
6. MARS by Salford Systems (also uses Friedman's code): http://www.salford-systems.com/products/mars
7. ARESLab (written in Matlab by Gints Jekabsons): http://www.cs.rtu.lv/jekabsons/regression.html
The R package earth was most useful to me in understanding the algorithm, particularly because of Stephen Milborrow's
thorough and easy to read vignette (http://www.milbo.org/doc/earth-notes.pdf).
## References
1. Friedman, J. (1991). Multivariate adaptive regression splines. The annals of statistics,
19(1), 1–67. http://www.jstor.org/stable/10.2307/2241837
2. Stephen Milborrow. Derived from mda:mars by Trevor Hastie and Rob Tibshirani.
(2012). earth: Multivariate Adaptive Regression Spline Models. R package
version 3.2-3. http://CRAN.R-project.org/package=earth
3. Friedman, J. (1993). Fast MARS. Stanford University Department of Statistics, Technical Report No 110.
https://statistics.stanford.edu/sites/default/files/LCS%20110.pdf
4. Friedman, J. (1991). Estimating functions of mixed ordinal and categorical variables using adaptive splines.
Stanford University Department of Statistics, Technical Report No 108.
http://media.salford-systems.com/library/MARS_V2_JHF_LCS-108.pdf
5. Stewart, G.W. Matrix Algorithms, Volume 1: Basic Decompositions. (1998). Society for Industrial and Applied
Mathematics.
6. Bjorck, A. Numerical Methods for Least Squares Problems. (1996). Society for Industrial and Applied
Mathematics.
7. Hastie, T., Tibshirani, R., & Friedman, J. The Elements of Statistical Learning (2nd Edition). (2009).
Springer Series in Statistics
8. Golub, G., & Van Loan, C. Matrix Computations (3rd Edition). (1996). Johns Hopkins University Press.
References 7, 2, 1, 3, and 4 contain discussions likely to be useful to users of py-earth. References 1, 2, 6, 5,
8, 3, and 4 were useful during the implementation process.
Metadata
Release files for sklearn-contrib-py-earth 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sklearn-contrib-py-earth-0.1.0.tar.gz | 1.0 MB | Without provenance | Details for sklearn-contrib-py-earth-0.1.0.tar.gz |
Built distributions (wheels)
Total release size: 16.3 MB
Release files / sklearn-contrib-py-earth-0.1.0.tar.gz
| Download URL | sklearn-contrib-py-earth-0.1.0.tar.gz |
|---|---|
| Size | 1.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3d0f1efa5f5508610500deec0fe1084716acce1d0fc4fc81d48c52791ce7ba0c
|
|
BLAKE2b-256 checksum How to use checksums |
f8c453a24835bafac880036446cc13839471a025b41de1436543f30d15d846c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / sklearn_contrib_py_earth-0.1.0-cp36-cp36m-win_amd64.whl
| Download URL | sklearn_contrib_py_earth-0.1.0-cp36-cp36m-win_amd64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 3.6 CPython 3.6 pymalloc Windows x86-64 |
|
SHA-256 checksum How to use checksums |
2d56eaf8fab09390dbcc98e4c88b9e277de89c041b68b5211b1f40af76a569d8
|
|
BLAKE2b-256 checksum How to use checksums |
4089ac892d8b1cbee7a03b5e01a6dd88251108435fe820227084fee9bb2b0f18
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / sklearn_contrib_py_earth-0.1.0-cp36-cp36m-win32.whl
| Download URL | sklearn_contrib_py_earth-0.1.0-cp36-cp36m-win32.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.6 CPython 3.6 pymalloc Windows x86-32 |
|
SHA-256 checksum How to use checksums |
4c8676ba36574a079645a6d02f096cafcd98b569ef63c84b954048082281271a
|
|
BLAKE2b-256 checksum How to use checksums |
240bf408a3c0763388f6cea4de087136458bcf83615a5012e1ceb8884810581f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / sklearn_contrib_py_earth-0.1.0-cp36-cp36m-macosx_10_7_x86_64.whl
| Download URL | sklearn_contrib_py_earth-0.1.0-cp36-cp36m-macosx_10_7_x86_64.whl |
|---|---|
| Size | 1.8 MB |
| Tags | CPython 3.6 CPython 3.6 pymalloc macOS 10.7+ x86-64 |
|
SHA-256 checksum How to use checksums |
dab98cde502092562c3ae0d1cb19e1af4658ce77d2ebffe908c9a44c1a56eddb
|
|
BLAKE2b-256 checksum How to use checksums |
46e7fa6d528e952028b650f3f032b038e2f7b186ff4af6e3a5d7b9d75cd358da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / sklearn_contrib_py_earth-0.1.0-cp35-cp35m-win_amd64.whl
| Download URL | sklearn_contrib_py_earth-0.1.0-cp35-cp35m-win_amd64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 3.5 CPython 3.5 pymalloc Windows x86-64 |
|
SHA-256 checksum How to use checksums |
a1477fde2223cd000154c73bae82f5aaedef0d7191a1e16fbfa8bc7a7ce6147b
|
|
BLAKE2b-256 checksum How to use checksums |
d89f2decb9d969d9069e9c5bc1b41e9f6d4615e5bba927e70bd73d6cc49dd404
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / sklearn_contrib_py_earth-0.1.0-cp35-cp35m-win32.whl
| Download URL | sklearn_contrib_py_earth-0.1.0-cp35-cp35m-win32.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.5 CPython 3.5 pymalloc Windows x86-32 |
|
SHA-256 checksum How to use checksums |
67d329f3104a1fbe968ed463f6ccc77c72eab15ff36e8ef49098d644c6c25a3c
|
|
BLAKE2b-256 checksum How to use checksums |
74de6764a77acb7ab36b0e4f4f36cb4691d187d1ef3c668489fe6be18e58bd24
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / sklearn_contrib_py_earth-0.1.0-cp35-cp35m-macosx_10_7_x86_64.whl
| Download URL | sklearn_contrib_py_earth-0.1.0-cp35-cp35m-macosx_10_7_x86_64.whl |
|---|---|
| Size | 1.8 MB |
| Tags | CPython 3.5 CPython 3.5 pymalloc macOS 10.7+ x86-64 |
|
SHA-256 checksum How to use checksums |
477b3ada2aaed25cfd59c6a4a244c9f37708d503ee80acc65150941cb7b00f6f
|
|
BLAKE2b-256 checksum How to use checksums |
3228d54c12f42c97521650d168b0d444e8991509ccdd20144a82ee196bcddc3d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / sklearn_contrib_py_earth-0.1.0-cp27-cp27m-win_amd64.whl
| Download URL | sklearn_contrib_py_earth-0.1.0-cp27-cp27m-win_amd64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 2.7 CPython 2.7 pymalloc Windows x86-64 |
|
SHA-256 checksum How to use checksums |
f2c8fc6b6edf0b97056db6c77237b7c65ed7a8e7bbbd7c4656065c3a1f46a88e
|
|
BLAKE2b-256 checksum How to use checksums |
c31a879614e14f7e73af839aed0182f82aeba826c1e3411b51d8708feeae2069
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / sklearn_contrib_py_earth-0.1.0-cp27-cp27m-win32.whl
| Download URL | sklearn_contrib_py_earth-0.1.0-cp27-cp27m-win32.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 2.7 CPython 2.7 pymalloc Windows x86-32 |
|
SHA-256 checksum How to use checksums |
1666018d8ba706fb31fe70338eca017f9afacce113abc28739256b0073d39705
|
|
BLAKE2b-256 checksum How to use checksums |
9921ae93ed73100913fb1e8f9c837c83ec70f5e9250d72813ded191ae3fb6148
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / sklearn_contrib_py_earth-0.1.0-cp27-cp27m-macosx_10_7_x86_64.whl
| Download URL | sklearn_contrib_py_earth-0.1.0-cp27-cp27m-macosx_10_7_x86_64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 2.7 CPython 2.7 pymalloc macOS 10.7+ x86-64 |
|
SHA-256 checksum How to use checksums |
986caff5ccae7cbf5c04b46ec443756674797df598314dd4417a1dc64001c05d
|
|
BLAKE2b-256 checksum How to use checksums |
85d3b9b539855059cf2f14f423b8d197769994c3023543b994f82f3f1590cd48
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for sklearn-contrib-py-earth 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.