May 2020
Intermediate to advanced
530 pages
17h 8m
English
To show the implementation of more ensemble learning techniques, we can develop the stacking approach manually. This is not hard with the Shark-ML library, or indeed any other library.
First, we need to define weak (or elementary) algorithms that we are going to use for stacking. To unify access to the weak algorithms, we defined the base class, as follows:
struct WeakModel {virtual ~WeakModel() {} virtual void Train(const ClassificationDataset& data_set) = 0; virtual LinearClassifier<RealVector>& GetClassifier() = 0;};
We used it for creating three weak algorithms' models—the logistic regression, the linear discriminant analysis (LDA), and the linear SVM models, as illustrated in the following code ...
Read now
Unlock full access