Dimensionality reduction is a technique used in machine learning to simplify a dataset by reducing the number of features while keeping the…