ForwardFill
- class geoanalytics.imputation.ForwardFill.ForwardFill(dataframe)[source]
Bases:
objectAbout this algorithm
- Description:
Forward Fill imputes missing values using the previous valid entry, with backward fill as a fallback for trailing NaNs.
- Parameters:
dataframe (pd.DataFrame): Input dataset where the first two columns are assumed to be spatial (‘x’, ‘y’) and all remaining columns are treated as features to be imputed.
- Attributes:
df (pd.DataFrame): Copy of the input data, with the first two columns renamed to ‘x’, ‘y’.
imputedDF (pd.DataFrame): Output DataFrame after missing value imputation.
Execution methods
import pandas as pd from geoanalytics.imputation import ForwardFill df = pd.read_csv("input.csv") ff = ForwardFill(df) imputed_df = ff.impute() ff.save("ForwardFilled.csv")
Credits
This implementation was created and revised under the guidance of Professor Rage Uday Kiran.