You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not super sure what you mean when you refer to the IQR technique, could you elaborate on it and also explain why it is so beneficial in ML pipelines?
IQR TRICK
The idea is to use the following approach: Credits
Calculate the first quartile (Q1) and third quartile (Q3) of the column (feeature). (eg q1=0.25 and q2=0.75 or any other of choice)
Compute the interquartile range (IQR) as the difference between Q3 and Q1 (IQR = Q3 – Q1).
Define the lower outlier threshold as Q1 – (constant * IQR) and the upper outlier threshold as Q3 + (constant * IQR).
Identify any data points that fall below the lower threshold or above the upper threshold. These observations are considered outliers.
It is a rather simple methodology but in some cases I think it is a nice starting point to get rid of some crazy values in the data without having a specific domain knowledge about the features.
In the proposed transformer, the idea is just to take the "IQR identified outliers" and replace them with some specific values.
The RobustScaler in scikit-learn is built around more or less the same idea, resulting in a scaling without considering the values flagged as outliers.
Hello,
In my Kaggle journey I use quite often the IQR technique to fill out-of-scale values with predefined or data driven values.
I already have a scikit-compatible implementation of such a method that I use in pipelines to easy validate my models against KFold.
I think that it would be a waste of code to do not include this feature in Sklego, so I'm proposing it to the community. 🧑🤝🧑
Use case scenario:
In this example I decide to fill the values with the column mean (excluding the out-of-scale values detected by IQR)
After transformation:
Do you think such feature will add value to the lego toolkit?
The text was updated successfully, but these errors were encountered: