Laptop Price Prediction Based on Specifications: A Comparison of Random Forest and Linear Regression

Bagas Pratama Putra, Ilham Miftahali Mahfuzh, Agus Fahrizal Kurniawan

Abstract


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.





DOI: http://dx.doi.org/10.22441/collabits.v3i1.37603

Refbacks

  • There are currently no refbacks.


Journal Collabits
Portal ISSNPrint ISSN: 3062-8601
Online ISSN: 3046-6709

Sekretariat
Fakultas Ilmu Komputer
Universitas Mercu Buana
Jl. Raya Meruya Selatan, Kembangan, Jakarta 11650
Tlp./Fax: +62215871335

http://publikasi.mercubuana.ac.id/index.php/collabits

e-mail: [email protected]

Creative Commons Licence
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.