  The third Gaia data release provides low-resolution spectra for around 200
million sources. It is expected that a sizeable fraction of them contain a
white dwarf (WD), either isolated, or in a binary system with a main-sequence
(MS) companion, i.e. a white dwarf-main sequence (WDMS) binary. Taking
advantage of a consolidated Random Forest algorithm used in the classification
of WDs, we extend it to study the feasibility of classifying Gaia WDMS binary
spectra. The Random Forest algorithm is first trained with a set of synthetic
spectra generated by combining individual WD and MS spectra for the full range
of effective temperatures and surface gravities. Moreover, with the aid of a
detailed population synthesis code, we simulate the Gaia spectra for the above
mentioned populations. For evaluating the performance of the models, a set of
metrics are applied to our classifications. Our results show that for resolving
powers above ~300 the accuracy of the classification depends exclusively on the
SNR of the spectra, while below that value the SNR should be increased as the
resolving power is reduced to maintain a certain accuracy. The algorithm is
then applied to the already classified SDSS WDMS catalogue, revealing that the
automated classification exhibits an accuracy comparable (or even higher) to
previous classification methods. Finally, we simulate the {\it Gaia} spectra,
showing that our algorithm is able to correctly classify nearly 80% the
synthetic WDMS spectra. Our algorithm represents a useful tool in the analysis
and classification of real Gaia WDMS spectra. Even for those spectra dominated
by the flux of the MS stars, the algorithm reaches a high degree of accuracy
(60%).
