Periprosthetic joint infection (PJI) is a rare but serious complication following total hip replacement surgery. Personalized risk prediction and risk factor management can allow effective presurgical interventions and improved surgical outcomes. In this study, we implemented a data driven approach to develop PJI risk prediction models using large scale data from the electronic health records (EHR) at a large tertiary care hospital. Dataset comprised a total of 22,350 hip replacement surgeries with 283 (1.3%) PJI events within the 1-year window following surgery. We implemented four different models (classic lasso, relaxed lasso, gradient boosting model (GBM) and neural networks) and used 10-fold cross-validation to calculate measures of model performance. The relaxed lasso model using the Cox model structure outperformed the other models with a concordance of 0.793. Our analysis indicates large scale EHR data and machine learning models provide increased accuracy in prediction of joint infections in hip replacement patients.