One of the most common conditions treated in adult primary care medicine is Urinary Tract Infection (UTI), which accounts for a sizeable portion of antibiotic prescriptions. A high degree of diagnostic accuracy is necessary because this issue is so prevalent and important in everyday clinical practice. Particularly in light of the rising prevalence of antibiotic resistance, excessive antibiotic prescriptions should be avoided. To examine the machine learning approach and Internet of Things (IoT) for urinary tract infections, this research proposes an Ensemble Bagging Decision Tree Classifier (EBDTC). In our study, to learn more about UTI, we conducted a study in which we collected the physiological data of 399 patients and preprocessed them using the min-max scalar normalization. Feature extraction using Principle Component Analysis (PCA) and classification using Ensemble Bagging Decision Tree Classifier (EBDTC). The performance outcomes of accuracy (96.25%), precision(96.22%), recall (98.07%), and f-1 measure(97.17%) demonstrate the proposed strategy's significantly improved performance in comparison to other baseline existing techniques.