Originating from image recognition, methods of machine learning allow for effective feature extraction and dimensionality reduction in multidimensional datasets, thereby providing an extraordinary tool to deal with classical and quantum models in many-body physics. In this study, we employ a specific unsupervised machine learning technique -- self-organizing maps -- to create a low-dimensional representation of microscopic states, relevant for macroscopic phase identification and detecting phase transitions. We explore the properties of spin Hamiltonians of two archetype model system: a two-dimensional Heisenberg ferromagnet and a three-dimensional crystal, Fe in the body centered cubic structure. The method of self-organizing maps, that is known to conserve connectivity of the initial dataset, is compared to the cumulant method theory and is shown to be as accurate while being computationally more efficient in determining a phase transition temperature. We argue that the method proposed here can be applied to explore a broad class of second-order phase transition systems, not only magnetic systems but also, for example, order-disorder transitions in alloys.