All Projects → innolitics → natural-neighbor-interpolation

innolitics / natural-neighbor-interpolation

Licence: MIT license
Fast, discrete natural neighbor interpolation in 3D on the CPU.

Programming Languages

C++
36643 projects - #6 most used programming language
python
139335 projects - #7 most used programming language
CMake
9771 projects
shell
77523 projects

Projects that are alternatives of or similar to natural-neighbor-interpolation

covid-19
Data ETL & Analysis on the global and Mexican datasets of the COVID-19 pandemic.
Stars: ✭ 14 (-77.78%)
Mutual labels:  numpy
Data-Science-Resources
A guide to getting started with Data Science and ML.
Stars: ✭ 17 (-73.02%)
Mutual labels:  numpy
SimplePythonCNN
Only in native python & numpy with Keras interface
Stars: ✭ 31 (-50.79%)
Mutual labels:  numpy
NumPyANN
Implementation of Artificial Neural Networks using NumPy
Stars: ✭ 85 (+34.92%)
Mutual labels:  numpy
Datscan
DatScan is an initiative to build an open-source CMS that will have the capability to solve any problem using data Analysis just with the help of various modules and a vast standardized module library
Stars: ✭ 13 (-79.37%)
Mutual labels:  numpy
Batch-First
A JIT compiled chess engine which traverses the search tree in batches in a best-first manner, allowing for neural network batching, asynchronous GPU use, and vectorized CPU computations.
Stars: ✭ 27 (-57.14%)
Mutual labels:  numpy
Data-Wrangling-with-Python
Simplify your ETL processes with these hands-on data sanitation tips, tricks, and best practices
Stars: ✭ 90 (+42.86%)
Mutual labels:  numpy
onelinerhub
2.5k code solutions with clear explanation @ onelinerhub.com
Stars: ✭ 645 (+923.81%)
Mutual labels:  numpy
skinner
Skin export / import tools for Autodesk Maya
Stars: ✭ 68 (+7.94%)
Mutual labels:  numpy
introduction to ml with python
도서 "[개정판] 파이썬 라이브러리를 활용한 머신 러닝"의 주피터 노트북과 코드입니다.
Stars: ✭ 211 (+234.92%)
Mutual labels:  numpy
CC33Z
Curso de Ciência da Computação
Stars: ✭ 50 (-20.63%)
Mutual labels:  numpy
transonic
🚀 Make your Python code fly at transonic speeds!
Stars: ✭ 93 (+47.62%)
Mutual labels:  numpy
hamilton
A scalable general purpose micro-framework for defining dataflows. You can use it to create dataframes, numpy matrices, python objects, ML models, etc.
Stars: ✭ 612 (+871.43%)
Mutual labels:  numpy
Engezny
Engezny is a python package that quickly generates all possible charts from your dataframe and saves them for you, and engezny is only supporting now uni-parameter visualization using the pie, bar and barh visualizations.
Stars: ✭ 25 (-60.32%)
Mutual labels:  numpy
numpy-neuralnet-exercise
Implementation of key concepts of neuralnetwork via numpy
Stars: ✭ 49 (-22.22%)
Mutual labels:  numpy
xtensor-r
R bindings for xtensor
Stars: ✭ 83 (+31.75%)
Mutual labels:  numpy
datascienv
datascienv is package that helps you to setup your environment in single line of code with all dependency and it is also include pyforest that provide single line of import all required ml libraries
Stars: ✭ 53 (-15.87%)
Mutual labels:  numpy
audiophile
Audio fingerprinting and recognition
Stars: ✭ 17 (-73.02%)
Mutual labels:  numpy
saddle
SADDLE: Scala Data Library
Stars: ✭ 23 (-63.49%)
Mutual labels:  numpy
PVMismatch
An explicit Python PV system IV & PV curve trace calculator which can also calculate mismatch.
Stars: ✭ 51 (-19.05%)
Mutual labels:  numpy

Discrete Sibson (Natural Neighbor) Interpolation

Natural neighbor interpolation is a method for interpolating scattered data (i.e. you know the values of a function at scattered locations). It is often superior to linear barycentric interpolation, which is a commonly used method of interpolation provided by Scipy's griddata function.

There are several implementations of 2D natural neighbor interpolation in Python. We needed a fast 3D implementation that could run without a GPU, so we wrote an implementation of Discrete Sibson Interpolation (a version of natural neighbor interpolation that is fast but introduces slight errors as compared to "geometric" natural neighbor interpolation).

See https://doi.org/10.1109/TVCG.2006.27 for details.

Installation

pip install naturalneighbor

Dependencies

  • Python 3.5+
  • Numpy (has been tested with 1.13+)

Demonstration

Natural neighbor interpolation can be more accurate than linear barycentric interpolation (Scipy's default) for smoothly varying functions.

Also, the final result looks better.

https://raw.githubusercontent.com/innolitics/natural-neighbor-interpolation/master/demo/linear_comparison.png https://raw.githubusercontent.com/innolitics/natural-neighbor-interpolation/master/demo/sin_sin_comparison.png

Note that the natural neighbor values usually are extrapolated; they were cut off in the demo to fairly compare with Scipy's linear barycentric method, which does not extrapolate.

Usage

This module exposes a single function, griddata.

The API for naturalneighbor.griddata is similar to scipy.interpolate.griddata. Unlike Scipy, the third argument is not a dense mgrid, but instead is just the ranges that would have been passed to mgrid. This is because the discrete Sibson approach requires the interpolated points to lie on an evenly spaced grid.

import scipy.interpolate
import numpy as np

import naturalneighbor

num_points = 10
num_dimensions = 3
points = np.random.rand(num_points, num_dimensions)
values = np.random.rand(num_points)

grids = tuple(np.mgrid[0:100:1, 0:50:100j, 0:100:2])
scipy_interpolated_values = scipy.interpolate.griddata(points, values, grids)

grid_ranges = [[0, 100, 1], [0, 50, 100j], [0, 100, 2]]
nn_interpolated_values = naturalneighbor.griddata(points, values, grid_ranges)

Future Work

  • Provide options for extrapolation handling
  • Support floats and complex numbers (only support doubles at the moment)
  • Support 2D (only support 3D)
  • Add documentation with discussion on limitations of discrete sibson's method
  • Uncomment cpplint from tox.ini and cleanup C++ code
  • Generalize the threading model (currently it uses 8 threads---one for each quadrant)

Other Resources

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].