# Dynamic Pricing Method in the E-Commerce Industry Using Machine Learning
## 3 Materials and Methods
During the implementation of the method, the most effective algorithm for the given database was selected. This diversity of models enabled a comprehensive evaluation of the dynamic pricing framework across different machine learning paradigms, ensuring that the final choice was well suited to the specific requirements of the application. Future work could expand on these foundations by exploring ensemble methods, such as random forests or gradient boosting, or more advanced techniques like neural networks or deep learning. These methods could enhance predictive accuracy and adaptability, particularly for larger and more complex datasets or for dynamic pricing scenarios with unstructured data inputs. Step 3. Implementation of the learning process for the selected machine learning algorithms. At this stage, the models were trained on training datasets using specific learning algorithms appropriate for each machine learning method. The goal was to achieve the best possible fit to the training data while adhering to predetermined hyperparameter constraints. The models were exposed to the training data to learn patterns and relationships within the dataset. Then, the models' effectiveness was evaluated on test data. Trained models were validated on an independent dataset to assess how well they performed on new examples. The evaluation process helped determine the models' ability to generalize beyond the training set and provided valuable insights into their performance. The literature offers many metrics for evaluating classification accuracy [35]. One of the most popular was accuracy, which is described by Formula (1). \[\text{Accuracy}=\frac{\text{TP}+\text{TN}}{\text{TP}+\text{TN}+\text{FP}+ \text{FN}} \tag{1}\]  
where  
Accuracy--accuracy of the machine learning model,  
TP--True Positives (value correctly classified as True),  
FP--False Positives (value not correctly classified as True),TN--True Negatives (value correctly classified as False),  
FN--False Negatives (value not correctly classified as False). Various metrics, such as Precision, Recall, and F1 Score, are commonly used to evaluate machine learning models. However, accuracy was chosen for this study as it is one of the most widely recognized and utilized measures in machine learning, particularly when dealing with balanced datasets. Its simplicity and broad applicability make it a standard choice for initial performance evaluation. Nonetheless, the use of other metrics is not precluded. Depending on the specific objectives of future implementations, additional measures such as Precision, Recall, and F1 Score can be calculated to provide a more comprehensive assessment of the model's performance, particularly in cases of imbalanced datasets or where specific types of errors carry different weights. Step 4. Selection of the best machine learning model for dynamic pricing in the e-commerce industry and its potential optimization. In the fourth and final stage of the method, the effectiveness of different algorithms was evaluated, and the one that achieved the best results was selected. At this phase, it was recommended to use the most commonly applied metric, which was accuracy. After selecting the best model, if its performance did not meet expectations, for example, if it did not achieve an accuracy of 70%, optimization could be undertaken. Optimization of the algorithm involved modifying selected hyperparameters to maximize its effectiveness, which could be achieved using available libraries such as scikit-learn, a machine learning library for Python (3.10 version).