Inspiration
The inspiration behind this project was to explore how e-commerce product data can be collected, analyzed, and used to generate meaningful insights through data science and machine learning. We wanted to understand product information such as prices, ratings, stock availability, and categories, and discover how these features could help in understanding product performance.
What the Project Does
Our E-Commerce Product Analysis project collects book product data from the Books to Scrape website. It extracts information such as product titles, prices, star ratings, stock quantities, availability status, categories, descriptions, and other product details.
The collected data is then cleaned, processed, and analyzed to identify patterns, distributions, relationships, and unusual values.
We also developed a Machine Learning classification system to classify books into three rating categories: Low, Medium, and High.
How We Built It
We developed the project using Python and Jupyter Notebook.
The project was completed in the following stages:
- Data Collection: Used Requests and BeautifulSoup to scrape product information from all catalogue pages and individual book pages.
- Data Cleaning: Removed duplicate records, handled missing values, corrected data types, and created additional features such as description length.
- Data Preprocessing: Applied One-Hot Encoding, Min-Max Normalization, Z-score Standardization, and appropriate missing-value imputation techniques.
- Exploratory Data Analysis (EDA): Used statistical summaries, histograms, box plots, scatter plots, bar charts, and correlation heatmaps to understand the dataset.
- Outlier and Skewness Analysis: Applied IQR, Z-score, and Isolation Forest methods to identify unusual values and used log transformation and capping where appropriate.
- Machine Learning: Implemented Logistic Regression, Decision Tree, and Random Forest classifiers to predict rating categories.
- Model Evaluation: Used accuracy, precision, recall, macro F1-score, confusion matrices, ROC-AUC, and Stratified Cross-Validation to compare model performance.
- Hyperparameter Tuning: Applied GridSearchCV to find better model configurations and used Permutation Feature Importance to understand the contribution of different features.
Challenges We Faced
Some of the major challenges included handling missing and duplicate values, extracting consistent information from multiple product pages, dealing with skewed data and outliers, and selecting meaningful features for machine learning.
Another challenge was achieving good classification performance because some product features had limited predictive relationships with the rating categories.
What We Learned
Through this project, we gained practical experience in web scraping, data preprocessing, exploratory data analysis, statistical techniques, feature selection, machine learning model development, and model evaluation.
We also learned that data quality and feature relevance play an important role in machine learning performance.
Results and Future Improvements
We successfully collected and processed 1,000 unique book records and developed three classification models.
Among the tuned models, Random Forest achieved the highest macro F1-score of approximately 0.3484, while Decision Tree achieved the highest accuracy of 37%.
The results also highlighted an important limitation: the dataset has weak predictive relationships between several product features and rating categories.
In the future, we aim to explore larger and more diverse e-commerce datasets, introduce additional meaningful features, and improve model performance.
Our project demonstrates the complete journey from raw e-commerce data collection to data analysis and machine learning-based classification.
Built With
- beautifulsoup4
- data-visualization
- jupyter-notebook
- machine-learning
- matplotlib
- numpy
- pandas
- python
- requests
- scikit-learn
- scipy
- seaborn
- web