|
Cosan
1.0
Data Analytics Library
|
Go to the documentation of this file.
5 #ifndef COSAN_MINMAXSCALER_H
6 #define COSAN_MINMAXSCALER_H
11 template<Numeric NumericType>
19 this->
fit(RD,to_lb,to_ub);
24 fmt::print(
"*********************************\n");
25 fmt::print(
"Begin transformation X to [0,1]!\n");
27 X = (X.array().rowwise()-X.colwise().minCoeff().array()).rowwise()/(X.colwise().maxCoeff()-X.colwise().minCoeff()).array();
29 fmt::print(
"End of transformation X to [0,1]\n");
30 fmt::print(
"*********************************\n");
33 fmt::print(
"*********************************\n");
34 fmt::print(
"Begin transformation to X to [{:},{:}]!\n",to_lb,to_ub);
36 X = (X.array().rowwise()-X.colwise().minCoeff().array()).rowwise()/(X.colwise().maxCoeff()-X.colwise().minCoeff()).array();
37 X = X.array()*(to_ub-to_lb)+to_lb;
39 fmt::print(
"End of transformation to X to [{:},{:}]!\n",to_lb,to_ub);
40 fmt::print(
"*********************************\n");
46 #endif //COSAN_MINMAXSCALER_H
CosanMatrix< NumericType > GetInput()
Get a copy of CosanMatrix<NumericType> X.
void fit(CosanRawData< NumericType > &RD, NumericType to_lb, NumericType to_ub)
void UpdateData(const CosanMatrix< NumericType > &inputX)
Update X using CosanMatrix<NumericType> input X.
MinmaxScaler(CosanRawData< NumericType > &RD, NumericType to_lb, NumericType to_ub)
Eigen::Matrix< NumericType, Eigen::Dynamic, Eigen::Dynamic > CosanMatrix
void fit(CosanRawData< NumericType > &RD)
MinmaxScaler(CosanRawData< NumericType > &RD)