Predictive Airfare Analysis Based on Machine Learning Models
摘要
This study addresses the growing need to predict airfare prices in highly variable contexts such as Perú, where LATAM Airlines stands out as the leading national carrier. In response to the complexity of dynamic pricing strategies, a comprehensive predictive solution is proposed with four main objectives: predicting airfares, estimating the optimal advance purchase period, identifying the most favorable time range to search for flights, and jointly predicting these variables through a multioutput model. To achieve this, a complete pipeline was designed, including automated data collection through web scraping using Selenium on LATAM’s website, followed by preprocessing steps involving data cleaning, duplicate removal, outlier handling, and categorical variable encoding using both One-hot encoding and Embedding-based encoding. In the modeling stage, classical algorithms such as XGBoost, Random Forest, Decision Tree, and K-Nearest Neighbors (KNN) were implemented, alongside deep learning models such as LSTM, GRU, TCN, and Transformers. Hyperparameter optimization was carried out using the Optuna library, aiming to maximize performance in airfare prediction.