Urinary Tract Infections (UTIs) present a significant healthcare challenge due to their prevalence and diagnostic complexity. Timely and accurate diagnosis is critical for effective treatment, yet traditional methods like microbial cultures and urinalysis are often slow and inconsistent. This study introduces machine learning (ML) as a transformative solution for UTI diagnostics, particularly focusing on logistic regression and random forest models renowned for their interpretability and robustness. We conducted a meticulous hyperparameter tuning process using a rich dataset from a clinic in Northern Mindanao, Philippines, incorporating demographic, clinical, and urinalysis data. Our research outlines a detailed methodology for applying and refining these ML models to predict UTI outcomes accurately. Through comprehensive hyperparameter optimization, we enhanced the predictive performance, demonstrating a significant improvement over standard diagnostic practice. The findings reveal a clear superiority of the random forest model, achieving a top testing accuracy of 0.9814, compared to the best-performing logistic regression model's accuracy of 0.7626. This comparative analysis not only validates the efficacy of ML in medical diagnostics but also emphasizes the potential clinical impact of these models in real-world settings. The study contributes to the burgeoning literature on ML applications in healthcare by providing a blueprint for optimizing ML models for clinical use, particularly in diagnosing UTIs. It underscores the promise of ML in augmenting diagnostic precision, thereby potentially reducing the global healthcare burden associated with UTIs.