https://github.com/zsailer/skspline
A Scikit-learn interface on Scipy's spline.
https://github.com/zsailer/skspline
scikit-learn scipy
Last synced: 2 months ago
JSON representation
A Scikit-learn interface on Scipy's spline.
- Host: GitHub
- URL: https://github.com/zsailer/skspline
- Owner: Zsailer
- Created: 2018-04-11T04:41:02.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-07-02T23:26:30.000Z (almost 7 years ago)
- Last Synced: 2025-04-08T17:53:28.445Z (about 1 year ago)
- Topics: scikit-learn, scipy
- Language: Python
- Size: 108 KB
- Stars: 0
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
Scikit Spline
=============
A Scikit-learn interface on Scipy's ``Univariate Spline``.
.. code-block:: python
import matplotlib.pyplot as plt
import numpy as np
import skspline
# Simulate data.
x = np.linspace(0, 4, 100)
y = 10*np.sin(x)
yerr = np.random.randn(len(y))
# Add noise to y.
y = y + yerr
# Initialize a Scikit Spline model and fit.
m = skspline.Spline(k=2)
m.fit(x, y)
# Get model
xmodel = np.linspace(0, 4, 1000)
ymodel = m.predict(xmodel)
# plot data and model
plt.scatter(x, y)
plt.plot(xmodel,ymodel, color='k', linewidth=5)
plt.show()
.. image:: docs/_img/example.png
:scale: 50 %