Mira variables are asymptotic giant-branch pulsating stars with long pulsation periods and large amplitudes in optical bands. By applying the random forest algorithm to the I-band light curves for the Miras in the Magellanic Clouds, we have classified these Miras into regular Miras and nonregular Miras. Nonregular Miras exhibit a long-term variation in addition to their primary pulsation periods. Our results confirm that the period-luminosity relation for maximum light has a small dispersion, but only occurs on the regular oxygen-rich Miras, which we recommend to be applied in future distance-scale work. We have also collected multiband photometry for these Miras to perform a spectral energy distribution fitting with stellar and dust components, showing that a significant fraction of dust is present around the nonregular Miras. According to our results, we believe that the periodic long-term variations seen in the nonregular Miras might be due to the presence of dust.