Laptop Price Prediction Based on Specifications: A Comparison of Random Forest and Linear Regression - Putra, Bagas Pratama; Mahfuzh, Ilham Miftahali; Kurniawan, Agus Fahrizal; Budiman, Ramdani (Journal Collabits, 2026)
This study investigates the prediction of laptop prices based on hardware specifications by comparing the performance of Linear Regression and Random Forest algorithms. The dataset consists of both numerical and categorical features, including brand, processor type, RAM capacity, storage configuration, screen size, and other relevant attributes that influence pricing. Data preprocessing was conducted through data cleaning, handling missing values, and transforming categorical variables using one-hot encoding. The dataset was then divided into training and testing sets with a 70:30 ratio to evaluate model generalization. Exploratory data analysis was performed using visualizations such as average price per brand, correlation heatmaps of numerical features, and scatter plots comparing actual and predicted prices. Model performance was evaluated using Mean Absolute Error (MAE), Root Mean Squared Error (RMSE), and the coefficient of determination (R²) on both training and testing data. The results indicate that the Random Forest model achieves higher predictive accuracy compared to Linear Regression, as it is more effective in capturing non-linear relationships and complex feature interactions. In contrast, Linear Regression tends to underperform due to its linear assumptions when applied to heterogeneous laptop specification data. These findings suggest that ensemble-based models are more suitable for laptop price prediction tasks involving diverse and non-linear feature patterns.