This paper presents a machine learning model to predict the effect of Al2O3 nanoparticle content on the coefficient of thermal expansion in Cu-Al2O3 nanocomposites prepared using an in situ chemical technique. The model developed is a modification of Long Short-Term Memory (LSTM) using dwarf mongoose optimization (DMO), which mimics the behavior of DMO to find its food for predicting the behavior of the composite. The swarm of DMO consists of three groups, namely the alpha group, scouts, and babysitters. Each group has its own behavior to capture the food. The preparation of the nanocomposite was performed using aluminum nitrate that was added to a solution containing scattered copper nitrate. After that, the powders of CuO and Al2O3 were obtained, and the leftover liquid was removed using thermal treatment at 850 °C for 1 h. The powders were consolidated using compaction and sintering processes. The impact of Al2O3 contents on the thermal properties of the Cu-Al2O3 nanocomposite was investigated. The results showed that the Thermal Expansion Coefficient (TEC) decreases with increasing Al2O3 content due to the increased precipitation of Al2O3 nanoparticles at the grain boundaries of the Cu matrix. Moreover, the good interfacial bonding between Al2O3 and the Cu may participate in this decrease in TEC. The proposed machine learning model was able to predict the TEC of all the produced composites with different Al2O3 content and was tested at different temperatures with very good accuracy, reaching 99%.