M dwarfs have enormous potential for understanding structure and formation on both Galactic and exoplanetary scales through their properties and compositions . However , current atmosphere models have limited ability to reproduce spectral features in stars at the coolest temperatures ( T _ { eff } < 4200 K ) and to fully exploit the information content of current and upcoming large-scale spectroscopic surveys . Here we present a catalog of spectroscopic temperatures , metallicities , and spectral types for 5,875 M dwarfs in the APOGEE+ Gaia-DR2 surveys using The Cannon : a flexible , data-driven spectral-modeling and parameter-inference framework demonstrated to estimate stellar-parameter labels ( T _ { \mathrm { eff } } , \log g , [ { \mathrm { Fe } / \mathrm { H } } ] , and detailed abundances ) to high precision . Using a training sample of 87 M dwarfs with optically derived labels spanning 2860 < T _ { \mathrm { eff } } < 4130 K calibrated with bolometric temperatures , and -0.5 < [ { \mathrm { Fe } / \mathrm { H } } ] < 0.5 dex calibrated with FGK binary metallicities , we train a two-parameter model with predictive accuracy ( in cross-validation ) to 77 K and 0.09 dex respectively . We also train a one-dimensional spectral classification model using 51 M dwarfs with SDSS optical spectral types ranging from M0 to M6 , to predictive accuracy of 0.7 types . We find Cannon temperatures to be in agreement to within 60 K compared to a subsample of 1,702 sources with color-derived temperatures , and Cannon metallicites to be in agreement to within 0.08 dex metallicity compared to a subsample of 15 FGK+M or M+M binaries . Finally , our comparison between Cannon and APOGEE pipeline ( ASPCAP ) labels finds that ASPCAP is systematically biased towards reporting higher temperatures and lower metallicities for M dwarfs .