Winsorizer<T>
Models & Types · AiDotNet.Preprocessing.OutlierHandling
Winsorizes data by replacing extreme values with percentile bounds.
Inheritance: TransformerBase<T, Matrix<T>, Matrix<T>> → Winsorizer<T>
For Beginners
Winsorization is named after biostatistician Charles Winsor. Instead of removing outliers, it replaces them with the nearest “normal” values:
- If you Winsorize at 5%, the bottom 5% of values become equal to the 5th percentile
- The top 5% of values become equal to the 95th percentile
This preserves sample size while reducing outlier impact.
How It Works
Winsorizer is a statistical technique that limits extreme values in the data to reduce the effect of outliers. Unlike trimming (which removes outliers), Winsorization replaces them with less extreme values.
This is equivalent to OutlierClipper but follows the traditional Winsorization terminology where you specify the percentage of data to Winsorize at each tail.
Constructors
| Constructor | Summary |
|---|---|
Winsorizer(double lowerLimit, double upperLimit, WinsorizerLimitType limitType, int[] columnIndices) |
Creates a new instance of Winsorizer. |
Properties
| Property | Summary |
|---|---|
Vector<T> LowerBounds { get; } |
Gets the computed lower bounds for each feature. |
Vector<T> UpperBounds { get; } |
Gets the computed upper bounds for each feature. |
WinsorizerLimitType LimitType { get; } |
Gets the type of limit (percentile or IQR). |
bool SupportsInverseTransform { get; } |
Gets whether this transformer supports inverse transformation. |
double LowerLimit { get; } |
Gets the lower limit value. |
double UpperLimit { get; } |
Gets the upper limit value. |
Methods
| Method | Summary |
|---|---|
string[] GetFeatureNamesOut(string[] inputFeatureNames) |
Gets the output feature names after transformation. |