Interpolation
- class geoanalytics.imputation.Interpolation.Interpolation(dataframe)[source]
Bases:
objectAbout this algorithm
- Description:
Interpolation is a missing data imputation technique that estimates NaN values using linear interpolation between known values. It fills values in both forward and backward directions to ensure completeness.
- Parameters:
Dataset (pandas DataFrame) must be provided during object initialization.
No other parameters are required during instantiation.
- Attributes:
df (pd.DataFrame) – The input data with ‘x’, ‘y’ coordinates and feature columns.
imputedDF (pd.DataFrame) – DataFrame containing ‘x’, ‘y’, and imputed values.
Execution methods
Calling from a Python program
import pandas as pd from geoanalytics.imputation import Interpolation df = pd.read_csv("input.csv") ip = Interpolation(df) output = ip.impute() ip.save('Interpolation.csv')
Credits
This implementation was created by and revised by under the guidance of Professor Rage Uday Kiran.
- run()[source]
Performs linear interpolation to fill missing values in the dataset.
The method: - Separates ‘x’ and ‘y’ columns from the rest of the data. - Applies linear interpolation along each column. - Uses both forward and backward filling to handle edge NaNs. - Reconstructs the complete DataFrame with imputed values.
- Returns:
Imputed DataFrame with original ‘x’, ‘y’ columns and interpolated features.