Poorly controlled glucose levels are associated with serious morbidity and mortality in hospitalized patients. Hospital diabetes management aims to maintain the glucose level within a desired range, primarily via insulin administration. Current inpatient glucose control relies significantly on expert knowledge, but this results in large variability and often suboptimal blood sugars in practice. We applied supervised machine learning methods to electronic health record (EHR) data to build predictive models that can inform inpatient insulin management. We found that individual blood glucose levels and insulin dosing are highly erratic and cannot be predicted precisely (MAE 28mg/dL, R2 0.2). However, prescribing decisions can still be driven by the more reliable predictions of average daily glucose levels (MAE 21mg/dL, R2 0.4) and whether any glucose levels of patients will be higher than the clinically desired range in the next day (sens 0.73, spec 0.79).