ModeImputation
- class geoanalytics.imputation.ModeImputation.ModeImputation(dataframe)[source]
Bases:
objectAbout this algorithm
- Description:
Mode Imputation replaces missing values in each column of a dataset with the most frequent value (mode) of that column. It is a simple and fast technique for handling missing data, particularly useful when the dataset has categorical features or dominant repeated values.
- Parameters:
Dataset (pandas DataFrame) must be provided during object initialization.
No parameters are needed for run().
- Attributes:
df (pd.DataFrame) – The input data with ‘x’, ‘y’ coordinates and features.
imputedDF (pd.DataFrame) – DataFrame after filling in missing values with mode.
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 ModeImputation df = pd.read_csv("input.csv") mode_imputer = ModeImputation(df) imputed_df = mode_imputer.run() mode_imputer.getRuntime() mode_imputer.getMemoryUSS() mode_imputer.getMemoryRSS() mode_imputer.save('ModeImputation.csv')
Credits
This implementation was created by Raashika and revised by M.Charan Teja under the guidance of Professor Rage Uday Kiran.