May 2020
Intermediate to advanced
530 pages
17h 8m
English
The shogun::CRescaleFeatures class in the Shogun library implements min-max normalization (or rescaling). We can reuse objects of this class for scaling different data with the same learned statistics. It can be useful in cases when we train a machine learning algorithm on one data format with applied rescaling, and then we use the algorithm for predictions on new data. To make this algorithm work as we want, we have to rescale new data in the same way as we did in the training process, as follows:
include <shogun/preprocessor/RescaleFeatures.h>...auto features = shogun::some<shogun::CDenseFeatures<DataType>>(inputs);...auto scaler = shogun::wrap(new shogun::CRescaleFeatures());scaler->fit(features); // learn statistics ...
Read now
Unlock full access