The purpose of the study was to use decision trees to predict increased levels of somatic cells in cow's milk. The material for the study comprised data collected in 2012-2014 from five farms in Poland equipped with an automatic milking system. Data on 803 Polish Holstein-Friesian cows were collected. In order to predict somatic cell count data mining techniques were used to build a graphical model of a decision tree. This study found that the most important factors to anticipate an elevated somatic cell count in cow's milk are milk conductivity, lactation stage, and lactation (primiparous and multiparous cow groups), as well as milking speed and rumination time. An increase in these parameters was also associated with a higher percentage of samples with an elevated somatic cell count. It has been shown that in order to keep somatic cell count low in automatic milking system herds a farmer should pay particular attention to the milking speed.