A hepta-band terahertz metamaterial absorber (MMA) with modified dual T-shaped resonators deposited on polyimide is presented for sensing applications. The proposed polarization sensitive MMA is ultra-thin (0.061 λ) and compact (0.21 λ) at its lowest operational frequency, with multiple absorption peaks at 1.89, 4.15, 5.32, 5.84, 7.04, 8.02, and 8.13 THz. The impedance matching theory and electric field distribution are investigated to understand the physical mechanism of hepta-band absorption. The sensing functionality is evaluated using a surrounding medium with a refractive index between 1 and 1.1, resulting in good Quality factor (Q) value of 117. The proposed sensor has the highest sensitivity of 4.72 THz/RIU for glucose detection. Extreme randomized tree (ERT) model is utilized to predict absorptivities for intermediate frequencies with unit cell dimensions, substrate thickness, angle variation, and refractive index values to reduce simulation time. The effectiveness of the ERT model in predicting absorption values is evaluated using the Adjusted R2 score, which is close to 1.0 for nmin = 2, demonstrating the prediction efficiency in various test cases. The experimental results show that 60% of simulation time and resources can be saved by simulating absorber design using the ERT model. The proposed MMA sensor with an ERT model has potential applications in biomedical fields such as bacterial infections, malaria, and other diseases.