The Spanish National Healthcare System (NHS) is mostly publicly funded and provided. It is considered highly cost-efficient according to international studies based on World Health Organization (WHO) data. However, the contention of healthcare costs increases while maintaining adequate levels of quality of care, is still a largely unsolved problem. In recent years, Emergency Departments (EDs) of specialized care hospitals have been subjected to budget restrictions, increased visits and increased clinical complexity of these visits. These circumstances require new approaches to ED management, which could benefit from decision support tools.In this Ph.D. thesis, we propose machine learning solutions for two problems common to most EDs of specialized care hospitals: ED census forecasting and real-time prediction of probabilities of inpatient admission for all triaged patients in the ED. These solutions could be used as decision support systems. Data for the development of these solutions were The first topic of this Ph.D. thesis is the development of models for ED census forecasting (i.e. prediction of the number of patients present at the ED at a given time). One of the uses of ED census forecasting is nursing personnel allocation, based on national and international recommendations. We chose an 8-hour granularity for our forecasts since many resources (such as nursing personnel) in the ED are organized in 8-hour shifts. Our aim was to generate forecasts for two dependent variables: average ED census levels and maximum ED census levels. Maximum ED census forecasts within 8-hour shifts could be used for nursing personnel allocation, while average ED census forecasts within 8-hour shifts could be used for the other needs (such as allocation of administrative personnel).We used a generalized regression approach to time series forecasting with several machine learning algorithms: M5P, Alternating Model Trees (AMT) and Support Vector Regression (SVR). We compared these to a series of benchmarks: usual nursing staffing levels (and usual resource allocation policies), stratified average (averages stratified by the three 8-10 hour shifts of a day), linear regression and Seasonal Autoregressive Integrated Moving Average (SARIMA) models. Forecasts were generated for both dependent variables: average ED census levels and maximum ED census levels. Four forecast horizons were tested: 1 week, 2 weeks, 4 weeks and 8 weeks. Underestimation risks, overestimation risks and approximations to monetary costs of resource allocations policies were defined for both average and maximum ED census forecasts. Maximum ED census forecasts were transformed into nursing personnel levels, and underestimation and overestimation risks for maximum ED census forecasts were transformed into understaffing and overstaffing risks. A custom training and evaluation scheme was used, with increasingly larger train sets and fixed-length test sets. The same scheme but with fixed-length train sets of 1 year and fixed-length test sets was also used. The ...