Skip to main content

A Python package for building reduced-order models to interpolate univariate data.

Project description

Welcome to romSpline

romSpline is an easy-to-use Python code for compressing and interpolating 1d data using reduced-order modeling and statistical learning methods.

romSpline uses a greedy algorithm to find a nearly optimal subset of data samples that recovers the original data, to the requested tolerance, with a univariate spline interpolant. The output is the optimal subset of data and the corresponding reduced-order spline interpolant.

romSpline also contains code to estimate the prediction errors at new samples due to interpolation. These methods are largely based on Monte Carlo K-fold cross-validation studies. The mean of the resulting validation errors can be used as a global and useful upper bound on the interpolation errors.

This code should be useful for downsampling or compressing large data arrays to their essential components from which the original information can be constructed and new data predicted through interpolation. The degree of downsampling can be significant (e.g., orders of magnitude) for relatively smooth data. Furthermore, the distribution of the resulting reduced dataset provides information into features and structures of the data that might otherwise not be readily observed.

Future releases of romSpline will provide locally adapted interpolation error estimations based on more refined cross-validation studies. In addition, enhancements to the greedy algorithm will incorporate possible additional information about data quality (such as uncertainties in the data values being compressed and interpolated, if available).

If you use this code for academic work then please cite the following paper describing the method and algorithm:

  • C. R. Galley and P. Schmidt, "Fast and efficient evaluation of gravitational waveforms via reduced-order spline interpolation" arXiv:1611.07529

Installation

romspline is available through PyPI:

pip install romspline

From source

git clone https://github.com/crgalley/romspline.git
cd romspline
python setup.py install

If you do not have root permissions, replace the last step with python setup.py install --user. Instead of using setup.py manually, you can also replace the last step with pip install . or pip install --user ..

Alternatively, you can download or clone this repository and add the download path to your PYTHONPATH variable.

As another alternative, include the following lines in your Python code:

import sys
sys.path.append(<path to romspline>)
import romspline

Dependencies

All of these can be installed through pip or conda.

romSpline requires NumPy, SciPy, and H5py, which come with most Python distributions. For parallelization, which is useful but not necessary for some of the cross-validation routines, romSpline currently uses the concurrent.futures module. If you are using Python 2 and do not have concurrent.futures installed you may install it using pip:

pip install futures

Future versions of romSpline will not use concurrent.futures.

Getting started

See the accompanying IPython notebooks (romSpline_example.ipynb and errors_example.ipynb) for simple tutorials on using the code and estimating errors of the reduced-order spline interpolant for predicting new values.

Author information

Copyright (C) 2015 Chad Galley (crgalley "at" tapir "dot" caltech "dot" edu). Released under the MIT/X Consortium license. Comments and requests welcome.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

romspline-1.1.2.tar.gz (28.4 kB view details)

Uploaded Source

Built Distribution

romspline-1.1.2-py2-none-any.whl (32.8 kB view details)

Uploaded Python 2

File details

Details for the file romspline-1.1.2.tar.gz.

File metadata

  • Download URL: romspline-1.1.2.tar.gz
  • Upload date:
  • Size: 28.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.4

File hashes

Hashes for romspline-1.1.2.tar.gz
Algorithm Hash digest
SHA256 7b5026ed1b2db7498ee63c057f11876c8db43d2adf414a02ef683ea2d273c6e2
MD5 52146bcab4dd49a487bf3a1a41b93ae2
BLAKE2b-256 48197a4eca20f4a34e5670171bd101ee62ac62d68b4e2dee8564f08016665f22

See more details on using hashes here.

File details

Details for the file romspline-1.1.2-py2-none-any.whl.

File metadata

  • Download URL: romspline-1.1.2-py2-none-any.whl
  • Upload date:
  • Size: 32.8 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.4

File hashes

Hashes for romspline-1.1.2-py2-none-any.whl
Algorithm Hash digest
SHA256 b78e99d969f939ce1c195dff3980508cc81e81cc214ed13b5d366b04f392de0a
MD5 671e3b41f21c641244034044e7376641
BLAKE2b-256 45a8f6d8becf4d025fc7928ce3279b7bf6a3802b77da96acaf51b5e4f0f8cb6b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page