# Meta-Learner for Amharic Sentiment Classification
## 3 Materials and Methods
### Proposed Stacking Algorithm
Random forest is robust because it combines multiple tree classifiers which rely on a subset of the training set's input features. Finally, it decides by voting for predicting new sample. Random forest classifier is built in two phases: create several decision trees and then get predictions with those trees for test sets and finally combine their predictions by majority voting (averaging). (iii) NB is a probabilistic method which is based on Bayes' rule, in which the input features are assumed to determine the output variable independently. Even though this method worked effectively in most times, this assumption of independence is rarely used in practice. The other strength of this algorithm is that it can learn incrementally and update its probability distribution [58; 59], and (iv) LR is a statistical approach for training binary categorical classes, rather than continuous variables. (4) Meta-Features: The meta-learner method is trained using the predicted values from the base learners. The base learners' predicted information is employed as meta-features, which are considered being essential for discriminating the target class categories. (5) Meta-Learner Algorithm: The meta-learner is acting as a combiner of the proposed approach. However, unlike other fusing strategies, it uses a machine learning model (i.e., logistic regression in our case) rather than voting/averaging. Voting and averaging, weighted averaging combine base learners relying on Equations (1)-(3), respectively. The procedure for the proposed ensemble learner with stack cross-validation algorithm is presented in Algorithm 1. ```
Input: Labeled Data Set Output: Average Accuracy of Trained Meta-learner Model M Create the 3 base learners (SVM, RF, and NB) and meta-learner (LR) With 5-fold cross-validation, partition the training set into 5 disjoint sets. foreach k fold in the partitioned trainingSetdo Split each parton into training and testing sets. Apply SMOTE on the respective trainingSet. Train proposed stack classifier using trainingSets. Collect prediction of the trained stacked classifier using testing sets and discard the model. return mean accuracy of the models on the complete 5-fold CV
```  
**Algorithm 1**Proposed Ensemble Learning. Description: Algorithm 1 takes a labeled dataset as input and average accuracy is returned as an output. Three base learners (i.e., SVM, NB, and RF) and one meta-learner (i.e., LR) are created (line 1). In line 2, with a 5-fold CV, the dataset is randomly partitioned into 5 disjoint sets and stored. For each k-fold cross-validation set (lines 3-7), each \(k\)th disjoint set is randomly split into training and testing set (with a ratio of 80:20, respectively) (line 4). In those experiments where we want to evaluate the impact of balancing the classes, apply SMOTE to the trainingSet of the respective run (line 5). Line 6 builds the stack classifier using the trainingSet. Line 7 stores the accuracy of each of the model using the testingSet. Finally, line 8 computes the mean accuracy of the 5 models. The proposed stack configuration is intended to improve the performance of Amharic sentiment classification by aggregating the prediction (meta-feature) of base learners.