Class PreprocessingRoutines
- Namespace
- NeuralNetworks.Core
- Assembly
- NeuralNetworks.dll
Provides preprocessing routines for numeric array data, including scaling and standardization operations for 2D and 4D float arrays.
public static class PreprocessingRoutines
- Inheritance
-
PreprocessingRoutines
- Inherited Members
Remarks
Includes methods that operate in place and methods that return transformed copies. Supports whole-array, row-wise, and column-wise standardization, optional range-based targeting, and safeguards for zero-variance data to avoid division by zero.
Methods
ApplyStandardizationInPlace(float[,,,], float, float)
Apply standardization to the 4D array in place by subtracting the given mean and dividing by the given standard deviation.
public static void ApplyStandardizationInPlace(this float[,,,] data, float mean, float stdDev)
Parameters
ApplyStandardizationInPlace(float[,], float, float)
Standardize the 2D array in place by subtracting the given mean and dividing by the given standard deviation.
public static void ApplyStandardizationInPlace(this float[,] data, float mean, float stdDev)
Parameters
ScaleTo(float[,], float, float)
public static float[,] ScaleTo(this float[,] data, float newMin, float newMax)
Parameters
Returns
- float[,]
ScaleToInPlace(float[,], float, float)
public static void ScaleToInPlace(this float[,] data, float newMin, float newMax)
Parameters
StandardizeByColumns(float[,], Range?)
Standardizes the source in-place so that each column (or a specified range of columns) has a mean of 0 and a
standard deviation of 1 by applying the (x - mean) / stdDev transformation.
public static void StandardizeByColumns(this float[,] source, Range? columnRange = null)
Parameters
sourcefloat[,]The source to standardize.
columnRangeRange?Optional. The range of columns to standardize. If null, all columns are standardized.
Remarks
Standard deviation is calculated using the formula: sqrt(sum((x - mean)^2) / N), where N is the number
of rows.
StandardizeByRows(float[,], Range?)
public static float[,] StandardizeByRows(this float[,] source, Range? rowRange = null)
Parameters
Returns
- float[,]
StandardizeByRowsInPlace(float[,], Range?)
public static void StandardizeByRowsInPlace(this float[,] source, Range? rowRange = null)
Parameters
StandardizeColumns(float, params List<float[,]>)
public static void StandardizeColumns(float minStdDev, params List<float[,]> sets)
Parameters
StandardizeInPlace(float[,,,])
Standardize the 4D array in place by subtracting the mean and dividing by the standard deviation, and return the mean and standard deviation used for standardization.
public static (float Mean, float StdDev) StandardizeInPlace(this float[,,,] data)
Parameters
datafloat[,,,]
Returns
StandardizeInPlace(float[,])
Standardize the 2D array in place by subtracting the mean and dividing by the standard deviation, and return the mean and standard deviation used for standardization.
public static (float Mean, float StdDev) StandardizeInPlace(this float[,] data)
Parameters
datafloat[,]
Returns
StandardizeSinglePass(float[,], Range?)
Standardizes the source in-place so that each column (or a specified range of columns) has mean 0 and standard deviation 1, computed in a single pass.
public static void StandardizeSinglePass(this float[,] source, Range? columnRange = null)