The properties of the galaxies are tightly connected to their host halo mass and halo assembly history. Accurate measurement of the halo assembly history in observation is challenging but crucial to the understanding of galaxy formation and evolution. The stellar-to-halo mass ratio (M */M h) for the centrals has often been used to indicate the halo assembly time t h,50 of the group, where t h,50 is the lookback time at which a halo has assembled half of its present-day virial mass. Using mock data from the semi-analytic models, we find that M */M h shows a significant scatter with t h,50, with a strong systematic difference between the group with a star-forming central (blue group) and passive central (red group). To improve the accuracy, we develop machine learning models to estimate t h,50 for galaxy groups using only observable quantities in the mocks. Since star formation quenching will decouple the co-growth of the dark matter and baryon, we train our models separately for blue and red groups. Our models have successfully recovered t h,50, within an accuracy of ∼1.09 Gyr. With careful calibrations of individual observable quantities in the mocks with Sloan Digital Sky Survey (SDSS) observations, we apply the trained models to the SDSS Yang et al. groups and derive the t h,50 for each group for the first time. The derived SDSS t h,50 distributions are in good agreement with that in the mocks, in particular for blue groups. The derived halo assembly history, together with the halo mass, make an important step forward in studying the halo–galaxy connections in observation.