v2.0.0
Loading...
Searching...
No Matches
MLLIB::MlScaler Class Reference

Feature scaler (StandardScaler or MinMaxScaler). More...

#include <ml_scaler.h>

Public Types

enum  ScalerType { StandardScaler , MinMaxScaler }

Public Member Functions

 MlScaler (ScalerType type=StandardScaler)
void fit (const MlTensor &data)
MlTensor transform (const MlTensor &data) const
MlTensor fitTransform (const MlTensor &data)
MlTensor inverseTransform (const MlTensor &data) const

Detailed Description

Feature scaler (StandardScaler or MinMaxScaler).

Definition at line 61 of file ml_scaler.h.

Member Enumeration Documentation

◆ ScalerType

Enumerator
StandardScaler 
MinMaxScaler 

Definition at line 64 of file ml_scaler.h.

Constructor & Destructor Documentation

◆ MlScaler()

MlScaler::MlScaler ( ScalerType type = StandardScaler)

Construct a scaler.

Parameters
[in]typeScaler strategy.

Definition at line 59 of file ml_scaler.cpp.

Member Function Documentation

◆ fit()

void MlScaler::fit ( const MlTensor & data)

Compute statistics from the data.

Parameters
[in]dataTraining data (samples x features).

Definition at line 66 of file ml_scaler.cpp.

◆ fitTransform()

MlTensor MlScaler::fitTransform ( const MlTensor & data)

Convenience: fit then transform.

Parameters
[in]dataTraining data.
Returns
The scaled tensor.

Definition at line 105 of file ml_scaler.cpp.

◆ inverseTransform()

MlTensor MlScaler::inverseTransform ( const MlTensor & data) const

Undo the scaling.

Parameters
[in]dataScaled data.
Returns
The original-scale tensor.

Definition at line 113 of file ml_scaler.cpp.

◆ transform()

MlTensor MlScaler::transform ( const MlTensor & data) const

Apply the learned transform.

Parameters
[in]dataData to transform.
Returns
The scaled tensor.

Definition at line 86 of file ml_scaler.cpp.


The documentation for this class was generated from the following files: