Milk yield and its composition vary according to individual cows as well as to a variety of different environment conditions, such as temperature. Previous studies suggest that heat exerts considerable negative effects on milk production and its composition, especially during summer months. We investigate the production and fat composition of milk from individual dairy cows and develop a modelling framework that investigates the effect of temperature by extending a traditional lactation curve model onto a more flexible statistical modelling framework, a generalised additive model (GAM). The GAM simultaneously copes with multiple different conditions (temperature, parity, days of lactation, etc.), and, importantly, their non-linear relationships. Our analysis of retrospective data suggests that individual cows respond differently to heat; cows producing relatively high quantities of milk tend to be particularly sensitive to heat. Our model also suggests that most dairy cows studied fall into three distinct cases that underpin the variation of the milk fat ratio by different mechanisms.Electronic supplementary materialThe online version of this article (doi:10.1186/2193-1801-3-129) contains supplementary material, which is available to authorized users.