2#include "../../Matrix.h"
3#include "../../statistics/Probability.h"
33#include "../../Matrix.h"
34#include "../../numerics/utils.h"
35#include "../Predictor.h"
79 auto diff = in -
means;
92 MinMaxScaler(
double range_min_val = 0.,
double range_max_val = 1.0)
100 auto localDiff =
max(in, 0) -
min(in, 0);
101 auto shiftedIn = in -
min(in, 0);
102 auto scaledDiff = shiftedIn / localDiff;
Matrix< double > sd(const Matrix< double > &x, int axis=0)
size_t columns() const
Definition: Matrix.h:198
double min_val
Definition: Scaler.h:87
MinMaxScaler(double range_min_val=0., double range_max_val=1.0)
Definition: Scaler.h:92
double max_val
Definition: Scaler.h:88
void fit(const Matrix< double > &X, const Matrix< double > &y) override
Definition: Scaler.h:97
Matrix< double > transform(const Matrix< double > &in) override
Definition: Scaler.h:99
Matrix< double > std_deviations
Definition: Scaler.h:51
Matrix< double > means
Definition: Scaler.h:50
bool with_std
Definition: Scaler.h:46
bool with_means
Definition: Scaler.h:47
StandardScaler(bool withMeans=true, bool withStd=true)
Definition: Scaler.h:54
void fit(const Matrix< double > &X, const Matrix< double > &y) override
Definition: Scaler.h:65
Matrix< double > transform(const Matrix< double > &in) override
Definition: Scaler.h:78
Matrix< T > mean(const Matrix< T > &mat, int axis=-1)
Definition: matrix_utils.h:401
T min(const Matrix< T > &mat)
Definition: matrix_utils.h:324
T max(const Matrix< T > &mat)
Definition: matrix_utils.h:292
Matrix< double > ones(size_t rows, size_t columns=1, size_t elements=1)
Matrix< double > zeros(size_t rows, size_t columns, size_t elements=1)