May 2020
Intermediate to advanced
530 pages
17h 8m
English
There are no functions for data normalization in the Eigen library. However, we can implement them according to the provided formulas.
For the standardization, we first have to calculate the standard deviation, as follows:
Eigen::Array<double, 1, Eigen::Dynamic> std_dev = ((x.rowwise() - x.colwise().mean()) .array() .square() .colwise() .sum() / (x_data.rows() - 1)) .sqrt();
Notice that some reduction functions in the Eigen library work only with array representation; examples are the sum() and the sqrt() functions. We have also calculated the mean for each feature—we used the x.colwise().mean() function combination that returns a vector of mean. We can use the same approach for other feature statistics' calculations. ...
Read now
Unlock full access