I have a small dataset that has 66 samples and 19 features. It is a numerical and tabular dataset. The goal is to predict a value according to these 19 features. The data is about a medical physics parameter about the lungs. Since the lung has a great difference in different people, this number also changes drastically in different people, so according to the iqr method, 50% of the data are considered outliers. As a result, I have to remove or replace a large amount of data, which causes severe weakness in the results of the models. Do you have any suggestions on this matter?
this is thee code that is used for IQR:
def remove_outliers(df):
for column in df.columns:
Q1 = df[column].quantile(0.25)
Q3 = df[column].quantile(0.75)
IQR = Q3 - Q1
lower_bound = Q1 -5 * IQR
upper_bound = Q3 + 5 * IQR
df = df[(df[column] >= lower_bound) & (df[column] <= upper_bound)]
return df
X_cleaned = remove_outliers(X)
print(X_cleaned.shape)