Elderly over 80 is the fastest growing segment of the Swedish population. With this increase in age the proportion of people with more than one chronic disease, multiple prescribed drugs, and disabilities is getting larger. At the same time, hospitalization accounts for a large amount of the total cost of healthcare. We hypothesize that the number and duration of these hospitalizations could be reduced if the primary care was given suitable tools to predict the risk and/or duration of hospitalization, which then could be used as a basis for providing suitable interventions. In this paper, we investigate the possibility to learn how to predict the risk of hospitalization of the elderly by mining patient data, in terms of age, sex, as well as diseases and prescribed drugs for a large number of patients. We have obtained diagnosis and drug use data from 2006, and associate these data with the number of days of hospitalization from 2007 for 406,272 subjects from the Östergötland county healthcare database. We suggest a data mining approach for automatically generating prediction models and empirically compare two learning algorithms on the problem of predicting the risk for hospitalization.