Machine learning is a subset of artificial intelligence (AI) that focuses on building algorithms that…