LogMeanVarianceScaler<T>
Models & Types · AiDotNet.Preprocessing.Scalers
Applies logarithmic transformation followed by mean-variance standardization.
Inheritance: TransformerBase<T, Matrix<T>, Matrix<T>> → LogMeanVarianceScaler<T>
For Beginners
This scaler is perfect for highly skewed or exponentially distributed data:
- First, it takes the log of values (compressing large differences)
- Then, it standardizes to zero mean and unit variance
Example: [1000, 10000, 100000, 1000000] → after log: [6.9, 9.2, 11.5, 13.8] → standardized This makes patterns in exponential data much easier to detect.
How It Works
Log-mean-variance scaling combines logarithmic transformation with z-score standardization. It first applies log transformation (with shift for negative values), then standardizes using mean and standard deviation. This is ideal for data spanning multiple orders of magnitude.
Constructors
| Constructor | Summary |
|---|---|
LogMeanVarianceScaler(int[] columnIndices) |
Creates a new instance of LogMeanVarianceScaler. |
Properties
| Property | Summary |
|---|---|
Vector<T> LogMean { get; } |
Gets the mean of log-transformed values for each feature. |
Vector<T> LogStdDev { get; } |
Gets the standard deviation of log-transformed values for each feature. |
Vector<T> Shift { get; } |
Gets the shift applied to each feature to ensure positive values. |
bool SupportsInverseTransform { get; } |
Gets whether this transformer supports inverse transformation. |
Methods
| Method | Summary |
|---|---|
string[] GetFeatureNamesOut(string[] inputFeatureNames) |
Gets the output feature names after transformation. |