This project involves predicting laptop prices using various machine learning models. The dataset contains specifications of laptops and their prices.
- Dataset
- Data Preprocessing
- Exploratory Data Analysis (EDA)
- Model Building
- Model Evaluation
The dataset includes laptop specifications like RAM, storage, and processor type, along with the corresponding prices.
- Load the dataset using pandas.
- Drop irrelevant columns ('Number of Ratings' and 'Number of Reviews').
- Handle missing values.
- Convert categorical variables to numerical using one-hot encoding.
- Visualize the distribution of laptop prices.
- Analyze the distribution of RAM sizes.
- Explore the relationship between RAM size and laptop price.
- Split the data into training and testing sets.
- Train a Gradient Boosting Regressor.
- Train a Random Forest Regressor for comparison.
- Calculate Mean Squared Error (MSE), Mean Absolute Error (MAE), and R² Score for both models on training and testing data.
- Perform cross-validation to validate the models.