Skip to content

ADA-research/VPint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VPInt

This repository contains the code required to run VPint (value propagation-based spatial interpolation). It is associated with our Data Mining and Knowledge Discovery (DAMI) paper "VPint: value propagation-based spatial interpolation", which can be found at https://doi.org/10.1007/s10618-022-00843-2 . However, this repository contains only a static version of the code from the time of our final submission to DAMI (for reproducibility). For up-to-date code that is actively undergoing further development, particularly adding functionality relevant for remote sensing applications, please see the repository at https://github.com/LaurensArp/VPint .

Although working code is available for spatio-temporal interpolation, we recommend spatial interpolation as its preferred use case.

There are currently two versions of VPint, both of which are governed by update rules inspired by Markov reward processes. In the ideal case WP-MRP is used, which requires a target image (with NaNs denoting missing values, or with a mask of missing values) and a feature image containing values of the same area adhering to a similar spatial structure. If no feature data is available, SD-MRP can be used, though this will tend to regress to initialisation values over distance.

Documentation

Please refer to the VPint documentation page at https://vpint.readthedocs.io/en/latest/ for detailed documentation of the code.

Installation

To install VPint, please download the repository, navigate to the root folder, and run python setup.py install

Dependencies:

  • Python 3.6.12
  • Numpy 1.19.0

Optional depdendencies:

  • Scikit-image 0.17.2 (used for computing the SSIM performance metric)

Running VPint

A minimal example to run VPint (WP-MRP), assuming appropriate data is already loaded:

from VPint.WP_MRP import WP_SMRP

MRP = WP_SMRP(target_data,feature_data)
result_data = MRP.run()

To run SD-MRP instead:

from VPint.SD_MRP import SD_SMRP

MRP = SD_SMRP(target_data)
# 100 iterations of random search for the best gamma parameter setting
MRP.find_gamma(100) 
result_data = MRP.run()

To run WP-MRP with randomly generated data:

from VPint.WP_MRP import WP_SMRP
from VPint.utils.hide_spatial_data import hide_values_uniform
import numpy as np

feature_scaling_param = 50 # for generating data
feature_noise_param = 0.5 # for generating data

true_data = np.random.rand(50,50) # create random ground truth data
target_data = hide_values_uniform(true_data,0.8) # hide 80% of true values
feature_data = true_data.copy() # identical features
feature_data = feature_data * feature_scaling_param # features in a different range
feature_data = feature_data + np.random.rand(50,50) * feature_noise_param # Adding noise

MRP = WP_SMRP(target_data,feature_data)
result_data = MRP.run()

To run WP-MRP with a machine learning model instead (useful in cases where the correlation between features and targets is less pronounced, but they are still related):

from VPint.WP_MRP import WP_SMRP
from sklearn.linear_model import LinearRegression

# Use any sklearn model (or other objects with train() and run() functions)
model = LinearRegression() 
MRP = WP_SMRP(target_data,feature_data,model=model)
MRP.train() # Train ML model on available data
result_data = MRP.run(method='predict')

Citing this work

To read our 2022 DAMI paper on VPint, please see: https://doi.org/10.1007/s10618-022-00843-2 . When publishing work using VPint, please cite:

@article{ArpEtAl22,
    author = "Arp, Laurens and Baratchi, Mitra and Hoos, Holger",
    title = "VPint: value propagation-based spatial interpolation",
    journal = "Data Mining and Knowledge Discovery",
    volume = "36",
    pages = "",
    publisher = "Springer",
    year = "2022",
    issn = "1573-756X",
    doi = "https://doi.org/10.1007/s10618-022-00843-2",
    url = "https://link.springer.com/article/10.1007/s10618-022-00843-2",
}

About

Code for the paper "VPint: Value Propagation-based Spatial Interpolation"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages