HotDeck
- class geoanalytics.imputation.HotDeck.HotDeck(dataframe)[source]
Bases:
objectAbout this algorithm
- Description:
Hot Deck Imputation is a simple, non-parametric method for handling missing values by replacing each missing entry with a randomly selected observed value from the same column. This method is suitable for datasets where missing values are not patterned or large in volume.
- Parameters:
Dataset (pandas DataFrame) must be provided during object initialization.
- Attributes:
df (pd.DataFrame) – The input data with ‘x’, ‘y’ coordinates and features.
imputedDF (pd.DataFrame) – DataFrame after filling in missing values.
startTime, endTime (float) – Variables to track execution time.
memoryUSS, memoryRSS (float) – Memory usage of the imputation process in kilobytes.
Execution methods
Calling from a Python program
import pandas as pd from geoanalytics.imputation import HotDeck df = pd.read_csv("input.csv") imputer = HotDeck(df) imputed_df = imputer.run() imputer.getRuntime() imputer.getMemoryUSS() imputer.getMemoryRSS() imputer.save('HotDeck.csv')
Credits
This implementation was created by Raashika and revised by M.Charan Teja under the guidance of Professor Rage Uday Kiran.