Simple example using the methodology from the following article: Marcelo C. Medeiros, Gabriel F. R. Vasconcelos, Álvaro Veiga & Eduardo Zilberman (2021) Forecasting Inflation in a Data-Rich Environment: The Benefits of Machine Learning Methods, Journal of Business & Economic Statistics
Please see the well documented code for details on the methodology.