A class that implements Min-Max scaling, inheriting from MLFunction.
More...
#include <functions.h>
|
| | MinMaxScaler (float *scalerMinValues, float *scalerMaxValues, int numCols) |
| | Constructor that initializes the scaler with raw arrays of min and max values.
|
| |
| | MinMaxScaler (std::string minMaxScalerDataPath) |
| | Constructor that initializes the scaler with a file containing min and max values.
|
| |
| void | apply (const SelectivityVector &rows, std::vector< VectorPtr > &args, const TypePtr &type, exec::EvalCtx &context, VectorPtr &output) const override |
| | Applies Min-Max scaling to the input array.
|
| |
| float * | getTensor () const override |
| | Returns the tensor associated with this function.
|
| |
| std::string | getFuncName () |
| | Returns the name of the function.
|
| |
| CostEstimate | getCost (std::vector< int > inputDims) |
| | Estimates the computational cost of applying Min-Max scaling.
|
| |
|
virtual | ~MLFunction ()=default |
| | Virtual destructor.
|
| |
| virtual std::vector< int > | getDims () |
| | Returns the dimensions of the function.
|
| |
| virtual int | getNumDims () |
| | Returns the number of dimensions of the function.
|
| |
|
| static std::vector< std::shared_ptr< exec::FunctionSignature > > | signatures () |
| | Returns the function signatures supported by this class.
|
| |
| static std::string | getName () |
| | Static method to return the name of the function.
|
| |
|
| double | getWeightedCost (std::string name, float cost) |
| | Calculates the weighted cost of the function.
|
| |
| std::vector< double > | getCoefficientVector (std::string name) |
| | Retrieves the cost coefficients for the function.
|
| |
|
std::vector< int > | dims |
| | Dimensions of the function.
|
| |
A class that implements Min-Max scaling, inheriting from MLFunction.
Min-Max scaling normalizes input data to a specified range (typically [0, 1]) using the formula: [ X_{\text{scaled}} = \frac{X - X_{\text{min}}}{X_{\text{max}} - X_{\text{min}}} ] This class supports initialization with either raw arrays of min/max values or a file containing these values.
◆ MinMaxScaler() [1/2]
| MinMaxScaler::MinMaxScaler |
( |
float * | scalerMinValues, |
|
|
float * | scalerMaxValues, |
|
|
int | numCols ) |
|
inline |
Constructor that initializes the scaler with raw arrays of min and max values.
- Parameters
-
| scalerMinValues | A pointer to a float array containing the minimum values for each feature. |
| scalerMaxValues | A pointer to a float array containing the maximum values for each feature. |
| numCols | The number of features (columns) in the input data. |
◆ MinMaxScaler() [2/2]
| MinMaxScaler::MinMaxScaler |
( |
std::string | minMaxScalerDataPath | ) |
|
|
inline |
Constructor that initializes the scaler with a file containing min and max values.
- Parameters
-
| minMaxScalerDataPath | The path to the file containing min and max values. |
◆ apply()
| void MinMaxScaler::apply |
( |
const SelectivityVector & | rows, |
|
|
std::vector< VectorPtr > & | args, |
|
|
const TypePtr & | type, |
|
|
exec::EvalCtx & | context, |
|
|
VectorPtr & | output ) const |
|
inlineoverride |
Applies Min-Max scaling to the input array.
This method processes the input array, applies Min-Max scaling, and stores the result in the output vector.
- Parameters
-
| rows | A SelectivityVector specifying the rows to process. |
| args | A vector of input arguments (e.g., the input array). |
| type | The type of the output vector. |
| context | The execution context. |
| output | The output vector where the result will be stored. |
◆ getCost()
| CostEstimate MinMaxScaler::getCost |
( |
std::vector< int > | inputDims | ) |
|
|
inlinevirtual |
Estimates the computational cost of applying Min-Max scaling.
- Parameters
-
| inputDims | A vector containing the dimensions of the input. |
- Returns
- A CostEstimate object representing the estimated cost.
Reimplemented from MLFunction.
◆ getFuncName()
| std::string MinMaxScaler::getFuncName |
( |
| ) |
|
|
inlinevirtual |
Returns the name of the function.
- Returns
- The name of the function as a string.
Reimplemented from MLFunction.
◆ getName()
| static std::string MinMaxScaler::getName |
( |
| ) |
|
|
inlinestatic |
Static method to return the name of the function.
- Returns
- The name of the function as a string ("min_max_scaler").
◆ getTensor()
| float * MinMaxScaler::getTensor |
( |
| ) |
const |
|
inlineoverridevirtual |
Returns the tensor associated with this function.
- Returns
- A pointer to an empty float array (no weights for MinMaxScaler).
Implements MLFunction.
◆ signatures()
| static std::vector< std::shared_ptr< exec::FunctionSignature > > MinMaxScaler::signatures |
( |
| ) |
|
|
inlinestatic |
Returns the function signatures supported by this class.
- Returns
- A vector of shared pointers to FunctionSignature objects.
The documentation for this class was generated from the following file: