Abstract: Electroencephalography (EEG) is a technique for measuring electrical activity on the scalp. The EEG detects voltage fluctuations caused by ion currents in brain neurons. The brain-computer interface system (BCIs) is intended to enable humans to monitor machines and interact with computers through their brains. It intends to construct non-muscular production pathways to convert brain function into discriminatory control commands correlated with various EEG signals dependent on motorized image patterns. Research on EEG is currently growing, especially in the field of motor imaging. EEG signal processing would be a feasible option for developing such a BCI device. The four basic stages of classical BCI are multi-class EEG signal acquisition, signal preprocessing, feature extraction, and motor imagery classification based on EEG. This study aims to determine the effect of wavelet packet decomposition (WPD) and common spatial pattern (CSP) feature extraction to optimize feature selection using the ensemble learning method. The method used in this research is experimental, where the stages begin with preprocessing, feature extraction with WPD and CSP, classification using ensemble learning and implementing feature selection using the principal component analysis (PCA) and select from the model (SFM). The results are the comparison of the accuracy generated from each method, including random forest (RF) of 74.71%, random forest with principal component analysis (RFPCA) of 68.01%, random forest with select from the model (RFSFM) of 82.15%, extra trees (ET) of 77.97%, extra trees with principal component analysis (ETPCA) of 64.18% and extra trees with selected from the model (ETSFM) of 83.28%.