The design of metamaterials involves engineering the electromagnetic properties on a subwavelength scale, making their behavior challenging to predict with models that are timeconsuming and computationally expensive. In recent years, there has been growing interest in developing various machine learning (ML) models for designing metamaterials. In this research, we demonstrate an ML-based framework for the optimal design of metamaterial absorbers in the terahertz range. Herein, the optical properties of a metamaterial structure with an open polygonshaped meta-atom are studied using numerical simulations. In addition, machine learning models are developed, specifically, a forward and an inverse model to predict absorption spectra from the structure and vice versa using different machine learning algorithms, including neural networks, decision trees, KNN, and linear regression. The mean square error was as low as 0.003 for the forward model and 0.02 for the inverse model. This work can be expanded for designing other complex fabricated electromagnetic structures for use in metamaterials and metasurfaces.