v2.0.0
Loading...
Searching...
No Matches
ml_scaler.h
Go to the documentation of this file.
1//=============================================================================================================
34
35#ifndef ML_SCALER_H
36#define ML_SCALER_H
37
38//=============================================================================================================
39// INCLUDES
40//=============================================================================================================
41
42#include "ml_global.h"
43#include "ml_tensor.h"
44
45//=============================================================================================================
46// EIGEN INCLUDES
47//=============================================================================================================
48
49#include <Eigen/Core>
50
51//=============================================================================================================
52// DEFINE NAMESPACE MLLIB
53//=============================================================================================================
54
55namespace MLLIB{
56
57//=============================================================================================================
62{
63public:
65
66 //=========================================================================================================
72 MlScaler(ScalerType type = StandardScaler);
73
74 //=========================================================================================================
80 void fit(const MlTensor& data);
81
82 //=========================================================================================================
89 MlTensor transform(const MlTensor& data) const;
90
91 //=========================================================================================================
98 MlTensor fitTransform(const MlTensor& data);
99
100 //=========================================================================================================
107 MlTensor inverseTransform(const MlTensor& data) const;
108
109private:
110 ScalerType m_type;
111 Eigen::VectorXf m_mean;
112 Eigen::VectorXf m_std;
113 Eigen::VectorXf m_min;
114 Eigen::VectorXf m_range;
115 bool m_fitted = false;
116};
117
118} // namespace MLLIB
119
120#endif // ML_SCALER_H
ml library export/import macros.
#define MLSHARED_EXPORT
Definition ml_global.h:55
MlTensor class declaration — N-dimensional, row-major, zero-copy.
Machine learning (models, pipelines, ONNX Runtime integration).
Feature scaler (StandardScaler or MinMaxScaler).
Definition ml_scaler.h:62
MlScaler(ScalerType type=StandardScaler)
Definition ml_scaler.cpp:59
N-dimensional tensor with contiguous row-major (C-order) float32 storage.
Definition ml_tensor.h:79