Genomic mutations drive the pathogenesis of myelodysplastic syndromes and acute myeloid leukemia. While morphological and clinical features have dominated the classical criteria for diagnosis and classification, incorporation of molecular data can illuminate functional pathobiology. Here we show that unsupervised machine learning can identify functional objective molecular clusters, irrespective of anamnestic clinico-morphological features, despite the complexity of the molecular alterations in myeloid neoplasia. Our approach reflects disease evolution, informed classification, prognostication, and molecular interactions. We apply machine learning methods on 3588 patients with myelodysplastic syndromes and secondary acute myeloid leukemia to identify 14 molecularly distinct clusters. Remarkably, our model shows clinical implications in terms of overall survival and response to treatment even after adjusting to the molecular international prognostic scoring system (IPSS-M). In addition, the model is validated on an external cohort of 412 patients. Our subclassification model is available via a web-based open-access resource (https://drmz.shinyapps.io/mds_latent).