An analytical method to automatically characterize rock samples for geological or petrological purposes is here proposed, by applying machine learning approach (ML) as a protocol for saving experimental times and costs.Proper machine learning algorithms, applied to automatically acquired microanalytical data (i.e., Electron Probe Micro Analysis, EPMA), carried out with a SEM-EDS microprobe on randomly selected areas from a petrographic polished thin section, are trained, used, tested, and reported.Learning and Validation phases are developed with literature mineral databases of electron microprobe analyses on 15 main rock-forming mineral groups. The Prediction phase is tested using an eclogite rock from the Western Alps, considered as an unknown sample: randomly selected areas are acquired as backscattered images whose intervals of gray levels, appropriately set in the gray level histogram, allow the automated particle mineral separation: automated separating Oxford Instruments Aztec Feature ® packages and a mineral plotting software are applied for mineral particle separation, crystal chemical formula calculation and plotting.Finally, a microanalytical analysis is performed on each separated mineral particle. The crystal chemical formula is calculated, and the final classification plots are automatically produced for any determined mineral. The final results show good accuracy and analytical ease and assess the proper nature of the unknown eclogite rock sample. Therefore, the proposed analytical protocol is especially recommended in those scenarios where a large flow of microanalytical data is automatically acquired and needs to be processed.