1. INTRODUCTION
patterns in the data. Sales prediction in e-commerce is a challenging problem because of the large volume and complexity of the data and the need for accurate and timely predictions to support business decisions.
Sales prediction in e-commerce refers to the task of forecasting future sales of products or services in an online retail environment. Accurate sales prediction is crucial for effective inventory management, pricing strategy, and resource allocation in e-commerce. Traditional forecasting methods, such as time-series analysis and regression analysis, have been widely used for sales prediction in e-commerce. However, these methods may not be able to capture the complex relationships between variables or adapt to changing patterns in the data. In recent years, there has been a growing interest in the use of ML techniques for sales prediction in e-commerce. ML methods can handle large volumes of data, capture complex relationships between variables, and adapt to changing
Traditional forecasting methods, such as time-series analysis and regression analysis, have been widely used for sales prediction in e-commerce. Time-series analysis involves analyzing historical sales data to identify patterns and trends and making predictions based on those patterns. Regression analysis involves identifying the relationship between sales and other variables, such as price, marketing spend, and seasonality. However, these methods may not be able to capture complex relationships between variables or adapt to changing patterns in the data. In recent years, there has been growing interest in ML techniques for sales prediction in e-commerce. ML methods, such as artificial neural networks (NNs), support vector machines, and random forests (RFs), can handle large volumes of data, capture complex relationships between variables, and adapt to changing patterns in the data. ML techniques have shown promising results in sales prediction and are becoming increasingly popular among practitioners.
The motivation for this paper stems from the increasing importance of accurate sales prediction in the e-commerce industry. With the growing volume and complexity of data in the ecommerce domain, traditional forecasting methods may not be sufficient to provide accurate and timely predictions. ML techniques have shown promise in handling large volumes of data, capturing complex relationships between variables, and adapting to changing patterns in the data. However, the effectiveness of these methods compared with traditional methods in e-commerce remains an open question. Therefore, this paper aims to provide a comprehensive comparison of the performance of traditional forecasting methods and ML techniques for sales prediction in e-commerce, to help inform decision-makers in the industry.
2. RELATED STUDIES
The literature on sales prediction in e-commerce has explored both traditional forecasting methods and ML techniques. In recent years, there has been growing interest in ML techniques for sales prediction. These methods can handle large volumes of data, capture complex relationships between variables, and adapt to changing patterns. Kraus et al. [1] provided an overview of deep-learning models and their applications in business analytics and operations research, including forecasting, inventory management, fraud detection, customer segmentation, and supply-chain management. They also discussed managerial implications, including the importance of data quality and the need for skilled data scientists.
Barboza et al. [2] explored ML models for bankruptcy prediction. They compared traditional statistical models with ML algorithms, including decision trees (DTs), neural networks (NNs), and support vector machines. Using financial ratios and other financial indicators to train and test the models, they showed that ML models generally outperform traditional statistical models in accuracy and predictive power. Bohanec et al. [4] investigated how to explain ML models in sales predictions. They proposed an approach for generating explanations based on local fidelity and concluded that explanations can improve interpretability and facilitate adoption in real-world applications. Syam and Sharma [5] discussed the potential impact of ML on sales research and practice in the fourth industrial revolution. They reviewed key trends and challenges facing sales organizations and described applications of ML and AI in sales, including lead scoring, customer segmentation, and personalized product recommendations.
Fabbri and Moro [6] explored recurrent networks for stockmarket trading by predicting daily closing prices of the Dow Jones Industrial Average (DJIA). They trained and tested the model on historical DJIA prices and news articles to learn temporal dependencies between news and market behavior. Vijh et al. [7] investigated ML techniques for predicting stock closing prices, including regression and tree models. They used historical stock prices and financial indicators and evaluated the models using measures such as mean absolute error and root mean square error. Park and Bae [8] used housing features, such as square footage, number of bedrooms, and location, to train and test ML models and compare their performance with traditional regression models.
Mai et al. [9] explored deep-learning models for predicting bankruptcy using textual disclosures. Their approach incorporated the content of financial reports in addition to traditional financial ratios. They used annual reports from bankrupt and non-bankrupt firms to train and test deep-learning models, including convolutional and recurrent networks (RNNs). Chou and Nguyen [10] presented a forward-forecasting approach for stock prices using a sliding-window metaheuristicoptimized machine-learning regression (SWMOMLR) model. They used historical stock prices and financial indicators to generate input-output pairs with a sliding window and applied genetic algorithms and particle-swarm optimization to tune the regression model’s hyperparameters.
3. CASE STUDY AND EXPLORATORY ANALYSIS
The BigMart case study is a well-known example of using data analytics to predict sales in the retail industry. It focuses on a fictional retail company called BigMart that operates across various locations in different cities. The goal is to predict sales of various products at different stores based on historical data. The dataset contains information on product and store characteristics, including Item_Identifier, Item_Weight, Item_Fat_Content, Item_Visibility, Item_Type, Item_MRP, Outlet_Identifier, Outlet_Establishment_Year, Outlet_Size, Outlet_Location_Type, Outlet_Type, and Item_Outlet_Sales. It also contains sales information for each product at each store over a period of time.
Outlet_Identifier is important because it identifies individual retail outlets and helps analyze sales trends, inventory management, and store performance. Each outlet has a unique identifier; its distribution is shown in Figure 1. Analyzing Item_Type provides insight into the product mix and sales trends. Retailers can identify top-selling products and categories and allocate resources accordingly (Figure 2). Item_Fat_Content is important because it provides insight into customers’ health consciousness and preferences for different types of food products. Its distribution can help retailers identify the popularity of low-fat or non-fat products and incorporate them into inventory to meet demand (Figure 3). Histograms and box plots are used to visualize the distribution of continuous variables in Figure 4.
4. MACHINE LEARNING FOR SALES PREDICTION
This section reviews ML regression algorithms commonly used for sales prediction and their main characteristics. These algorithms are widely used in retail, and their effectiveness depends on the amount and quality of data, algorithm choice, and hyperparameter tuning.
4.1 Linear Regression
Linear regression models the relationship between a dependent variable (usually sales) and one or more independent variables using a linear equation. Its objective is to estimate coefficients that minimize the sum of squared residuals. Once estimated, the model predicts sales for new observations from their independent-variable values. Linear regression is simple, effective for linear relationships, and easy to interpret and visualize. However, it assumes a linear relationship and may not capture complex interactions or nonlinear relationships found in real-world scenarios.
4.2 Logistic Regression
Logistic regression models the probability of a binary outcome (such as whether a customer buys a product) from one or more predictor variables. It uses a logistic function to map inputs to a probability between zero and one and estimates coefficients by maximizing the likelihood of the observed outcomes. The fitted model predicts sales probabilities for new observations. Logistic regression can capture nonlinear relationships between the dependent and independent variables and is well suited to binary outcomes. However, it assumes a linear relationship between the outcome’s log-odds and the independent variables, may not suit multiclass problems, requires large samples, and can be sensitive to outliers and multicollinearity.
4.3 Polynomial Regression
Polynomial regression models the relationship between a dependent variable (sales) and independent variables using a polynomial function. It is a form of linear regression in which the relationship is represented by an nth-degree polynomial. The model estimates polynomial coefficients to find a curve that best fits the data. The polynomial degree can vary with data complexity and the degree of nonlinearity in the relationship.
4.4 Ridge Regression
Ridge regression models the relationship between sales and independent variables while addressing multicollinearity, which occurs when independent variables are highly correlated and can make coefficient estimates unstable. Ridge regression adds a penalty proportional to the squared coefficient magnitudes to the sum of squared residuals, shrinking coefficients toward zero. A regularization parameter controls the shrinkage and is typically selected through cross-validation. Ridge regression can improve coefficient stability and accuracy, especially in the presence of multicollinearity. However, it assumes that all independent variables are equally important, which may not hold in every application.
4.5 Lasso Regression
Lasso regression models the relationship between sales and independent variables while addressing multicollinearity. Like ridge regression, it adds a penalty to the sum of squared residuals, but uses the L1 norm of the coefficients. Because this norm is the sum of the absolute coefficient values, Lasso can shrink some coefficients exactly to zero, making it useful for feature selection. The regularization parameter controls shrinkage and feature selection and is typically chosen through cross-validation.
4.6 Decision Tree Regression
Decision tree (DT) regression is a non-parametric algorithm that models the relationship between sales and independent variables. It recursively splits data into subsets based on the independent variables, aiming to minimize the variance of the dependent variable within each subset. Each split uses a decision rule that maximizes information gain or reduces variance. The resulting tree consists of decision nodes, which represent rules, and leaf nodes, which represent predicted values. DT regression handles numerical and categorical variables without distributional assumptions, and trees are easy to interpret and visualize. However, complex trees can overfit and generalize poorly. Ensemble methods such as RFs and gradient boosting can combine multiple trees to improve performance and reduce overfitting.
4.7 Random Forest Regression
RF is an ensemble-learning algorithm that combines multiple DTs to improve prediction accuracy and robustness. For sales prediction, it models the relationship between sales and variables such as product attributes, store location, and demographic data. It creates many trees, each trained on a random subset of data and independent variables, and aggregates their
predictions, typically by averaging. Randomness in sampling helps reduce variance and overfitting. RF can handle numerical and categorical data and identify important features. However, it can be computationally expensive, may require hyperparameter tuning, and can be harder to interpret than a single DT.
4.8 Support Vector Regression
Support vector machines (SVMs) are used for classification and regression. In sales prediction, an SVM can predict product sales from product attributes, store location, and demographic data. The algorithm finds a hyperplane that separates data into two classes; in the sales context these are high and low sales. It chooses a hyperplane that maximizes the margin to the closest data points. A kernel function maps nonlinear data to a higher-dimensional space, allowing the SVM to fit complex relationships between independent variables and sales. SVMs can be less sensitive to outliers than linear regression and can handle numerical and categorical data. However, they can be computationally expensive for large datasets and require hyperparameter tuning.
4.9 Neural Network Regression
NN regression is based on the structure and function of the human brain. A network can be trained to predict product sales from product attributes, store location, and demographic data. It consists of interconnected nodes, or neurons, arranged in layers that process and transform inputs to produce an output. Each neuron applies a mathematical function to its input and passes the result to the next layer; the final output predicts sales for a given set of inputs. NNs can handle complex, nonlinear relationships and numerical and categorical data. They can adapt to new patterns, which is useful for dynamic prediction. However, they can be computationally expensive to train, require substantial data and computing resources, and depend strongly on network architecture and parameter tuning.
5. RESULTS AND DISCUSSIONS
This section compares ML algorithms for BigMart sales prediction. Several ML regression models and traditional regressors are evaluated for predicting product sales; prediction plots for the models are shown in Figures 5–13. The experimental results show that RF and NN regression perform better than the other algorithms in accuracy and in handling complex relationships between inputs and sales. RF handles nonlinear relationships by creating and aggregating multiple decision trees, while NN regression can model complex nonlinear relationships. Both require more computational resources than some tested algorithms, such as linear and polynomial regression. DT regression performs well for some product categories but is less accurate for others. The detailed comparison is presented in Table 1.
6. CONCLUSION
This study presents a comparative analysis of traditional forecasting methods and ML techniques for sales prediction in e-commerce and provides insights into their relative performance. The results demonstrate that ML techniques, particularly NNs and DTs, outperform traditional methods in accuracy and robustness. The findings also highlight the importance of carefully selecting and tuning ML models to ensure optimal performance. This paper provides a roadmap for decision-makers in e-commerce to choose an appropriate sales-prediction method based on the context and data characteristics. As the industry evolves, these methods should be continually evaluated and refined to ensure accurate and timely predictions and ultimately support business success.