Error correction coefficient determination method and apparatus, electronic device, and chip

By dividing the price decision interval and calculating the sub-intervals of the error correction coefficient, the problem of inconsistent error correction in the price elasticity model is solved, and more accurate error correction and price strategy evaluation are achieved.

CN122243540APending Publication Date: 2026-06-19ZHEJIANG XIAOJU GREEN ENERGY TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHEJIANG XIAOJU GREEN ENERGY TECHNOLOGY CO LTD
Filing Date
2024-12-11
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing price elasticity models suffer from inconsistent error correction coefficients and insufficient sample size when estimating demand, resulting in poor error correction and affecting the effectiveness of pricing strategies and the accuracy of forecasts.

Method used

By dividing the preset price decision range into multiple sub-ranges, and calculating the target error correction coefficient for each sub-range, the error correction coefficient is predicted and smoothed using a linear regression model and a weighted sliding window technique to ensure that different price ranges use the corresponding error correction coefficient.

🎯Benefits of technology

It improves the accuracy of error correction and the effectiveness of pricing strategies, achieving more accurate forecast error assessment and enhancing the precision of pricing strategies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122243540A_ABST
    Figure CN122243540A_ABST
Patent Text Reader

Abstract

This disclosure provides a method, apparatus, electronic device, chip, and storage medium for determining error correction coefficients. The method includes: acquiring a training dataset and a validation dataset; training a price elasticity model using the training dataset, the price elasticity model being used to predict changes in demand at different price levels; dividing a preset price decision interval into multiple sub-intervals, the multiple sub-intervals including at least one first interval corresponding to the price parameters in the validation dataset; and determining a target error correction coefficient corresponding to each of the multiple sub-intervals, the target error correction coefficient being used to correct the error of the trained price elasticity model. This method can accurately determine the target correction coefficient corresponding to each price interval, more accurately assess the prediction error level at different price levels, and improve the effectiveness and accuracy of pricing strategies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data processing, and in particular to a method, apparatus, electronic device, chip, and storage medium for determining the error correction coefficient of a price elasticity model. Background Technology

[0002] Price elasticity refers to the sensitivity of the quantity demanded of a product or service to changes in its price. With the development of technologies such as machine learning, in order to better construct the elasticity relationship between price and quantity demanded, the industry usually uses machine learning, deep learning and other technologies to build price elasticity models to predict changes in quantity demanded at different price levels. This method can provide a certain demand forecasting ability, but it inevitably produces forecasting errors. Summary of the Invention

[0003] This disclosure provides a method, apparatus, electronic device, chip, and storage medium for determining error correction coefficients to solve problems in related technologies.

[0004] A first aspect of this disclosure proposes a method for determining error correction coefficients. The method includes: acquiring a training dataset and a validation dataset; training a price elasticity model using the training dataset, the price elasticity model being used to predict changes in demand at different price levels; dividing a preset price decision interval to obtain multiple sub-intervals, the multiple sub-intervals including at least one first interval corresponding to the price parameters in the validation dataset; and determining a target error correction coefficient corresponding to each of the multiple sub-intervals, the target error correction coefficient being used to correct the error of the trained price elasticity model.

[0005] In some embodiments of this disclosure, determining the target error correction coefficients corresponding to each of the multiple sub-intervals includes: for at least one first interval, determining at least one candidate error correction coefficient corresponding to each of the at least one first interval; training a linear regression model based on the candidate error correction coefficients corresponding to each of the at least one first interval to obtain an error correction coefficient prediction model; using the error correction coefficient prediction model to predict the candidate error correction coefficients corresponding to at least one second interval among the multiple sub-intervals; and smoothing the candidate error correction coefficients corresponding to at least one first interval and at least one second interval to obtain the target error correction coefficients corresponding to each of the multiple sub-intervals.

[0006] In some embodiments of this disclosure, determining the candidate error correction coefficients corresponding to at least one first interval includes: for one of the first intervals, determining at least one sample from the verification dataset that corresponds to the price parameter of the first interval; determining the candidate error correction coefficients corresponding to each of the at least one sample based on the first error correction coefficients and the second error correction coefficients corresponding to the at least one sample; and taking the average value of the candidate error correction coefficients corresponding to each of the at least one sample as the candidate error correction coefficients corresponding to the first interval.

[0007] In some embodiments of this disclosure, the method further includes: for a first sample in at least one sample, using a price elasticity model to predict the demand corresponding to the first sample, and determining a first error correction coefficient corresponding to the first sample based on the demand corresponding to the first sample and the actual sales volume corresponding to the first sample; and determining a second error correction coefficient corresponding to the first sample using a weighted sliding window.

[0008] In some embodiments of this disclosure, determining the second error correction coefficient corresponding to the first sample using a weighted sliding window includes: determining the cluster center of the cluster to which the first sample belongs; determining the first error correction coefficient corresponding to at least one second sample in the weighted sliding window based on the distance from the first sample to the cluster center; and generating at least one second error correction coefficient corresponding to the first sample based on the first error correction coefficient corresponding to at least one second sample in the weighted sliding window.

[0009] In some embodiments of this disclosure, determining the candidate error correction coefficient corresponding to at least one sample based on the first error correction coefficient and the second error correction coefficient corresponding to at least one sample includes: determining the weight values ​​of the first error correction coefficient and the second error correction coefficient corresponding to at least one sample; weighting the first error correction coefficient and the second error correction coefficient using a weighting formula based on the weight values ​​of the first error correction coefficient and the second error correction coefficient to obtain the weighted error correction coefficient corresponding to at least one sample; and performing post-processing on the weighted error correction coefficient corresponding to at least one sample to obtain the candidate error correction coefficient corresponding to at least one sample.

[0010] In some embodiments of this disclosure, post-processing the weighted error correction coefficient corresponding to at least one first sample to obtain candidate error correction coefficients corresponding to at least one first sample includes: determining the weighted error correction coefficient as a candidate error correction coefficient corresponding to the first sample when the weighted error correction coefficient is greater than or equal to a first boundary value and less than or equal to a second boundary value; determining the first boundary value as a candidate error correction coefficient corresponding to the first sample when the weighted error correction coefficient is less than the first boundary value; and determining the second boundary value as a candidate error correction coefficient corresponding to the first sample when the weighted error correction coefficient is greater than the second boundary value.

[0011] A second aspect of this disclosure provides an error correction coefficient determination apparatus, comprising: a first processing unit for acquiring a training dataset and a validation dataset, and training a price elasticity model using the training dataset, the price elasticity model being used to predict changes in demand at different price levels; a second processing unit for dividing a preset price decision interval into multiple sub-intervals, the multiple sub-intervals including at least one first interval corresponding to the price parameters in the validation dataset; and a third processing unit for determining a target error correction coefficient corresponding to each of the multiple sub-intervals, the target error correction coefficient being used to correct the error of the trained price elasticity model.

[0012] A third aspect of this disclosure provides an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the methods described in the first aspect of this disclosure.

[0013] A fourth aspect of this disclosure provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to perform the methods described in the first aspect of this disclosure.

[0014] A fifth aspect of this disclosure provides a chip characterized by including at least one processor and a communication interface; the communication interface is used to receive signals input to the chip or signals output from the chip, and the processor communicates with the communication interface and implements the method described in the first aspect of this disclosure through logic circuits or executing code instructions.

[0015] A sixth aspect of this disclosure provides a computer program product including a computing program stored on a computer-readable storage medium. The computer program includes program instructions that, when executed by a computer, cause the computer to perform the method in any implementation of the first aspect described above.

[0016] In summary, the error correction coefficient determination method proposed in this disclosure can determine the target error correction coefficient corresponding to each sub-interval, which facilitates the use of different error correction coefficients in different price intervals, improves the accuracy of error correction, and can more accurately assess the forecast error level under different price levels, thereby improving the effectiveness of pricing strategies and the accuracy of forecasts.

[0017] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0018] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.

[0019] Figure 1 A flowchart illustrating a method for determining an error correction coefficient provided in an embodiment of this disclosure;

[0020] Figure 2 A flowchart illustrating a method for determining an error correction coefficient provided in an embodiment of this disclosure;

[0021] Figure 3 A flowchart illustrating a method for determining an error correction coefficient provided in an embodiment of this disclosure;

[0022] Figure 4 A flowchart illustrating a price elasticity model error correction method based on HDBSCAN provided in this embodiment of the disclosure;

[0023] Figure 5 This is a schematic diagram of the structure of an error correction coefficient determination device provided in an embodiment of the present disclosure;

[0024] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure;

[0025] Figure 7 This is a schematic diagram of the chip structure provided in an embodiment of this disclosure. Detailed Implementation

[0026] Embodiments of this disclosure are described in detail below. Examples of these embodiments are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this disclosure, and should not be construed as limiting this disclosure.

[0027] In business, price elasticity refers to the sensitivity of the quantity demanded of a product or service to changes in its price. It has a significant impact on a company's pricing strategy, promotional activity design, and market forecasting. Accurate price elasticity analysis can help companies better understand consumer behavior, optimize inventory management and sales strategies, thereby improving economic efficiency. With the development of technologies such as machine learning, in order to better construct the elasticity relationship between price and quantity demanded, the industry commonly uses machine learning and deep learning techniques to build price elasticity models to predict changes in demand at different price levels. This method can provide a certain degree of demand forecasting ability, but inevitably introduces forecasting errors. To reduce forecasting errors, a common industry practice is to reserve a small portion of data as a validation set to correct the model's prediction errors for future demand. For example, if the predicted demand at a certain price on a certain day in the validation set is 100, but the actual demand is 110, then the error correction factor is 110 / 100 = 1.1. When predicting tomorrow's demand, the demand predicted by the price elasticity model is multiplied by the error correction factor to obtain tomorrow's predicted demand, thus achieving the purpose of correcting the predicted demand. However, in actual production, there may be a discrepancy between the actual usage price and the price of the validation set samples used to calculate the error correction coefficient, which may cause the error correction coefficient to fail or even increase the error.

[0028] In other words, for elasticity models, the prediction errors under different price levels are inconsistent. For example, the prediction errors for prices of 80 and 90 should be different, and the corresponding error correction coefficients should also be different. However, when correcting, all prices use the same error correction coefficient. There are also issues with sample size and range. To ensure the reliability of elasticity models, a relatively large amount of data is usually used to train the model, but the number of samples used for validation and calculation of error correction coefficients is not large. A small sample size reduces the reliability of the error correction coefficients, making them susceptible to single-point anomalies. Furthermore, the price range on the validation set is limited. In actual operation, operators may choose prices outside the validation set's price range. For example, if the error correction coefficient on the validation set is calculated at 90, the actual price might be 80 or another price, leading to inconsistencies between the error correction coefficients in the validation set and the real production environment.

[0029] Therefore, in order to solve the above problems, this disclosure proposes a method for determining the error correction coefficient corresponding to the price elasticity model. This method can determine the target error correction coefficient corresponding to each sub-interval, which can facilitate the use of different error correction coefficients in different price intervals, improve the accuracy of error correction, and more accurately assess the prediction error level under different price levels, thereby improving the effectiveness of the price strategy and the accuracy of the prediction.

[0030] The specific details of this method are as follows.

[0031] Figure 1 This is a flowchart illustrating a method for determining an error correction coefficient according to an embodiment of this disclosure. Figure 1 As shown, the method may include the following steps.

[0032] Step 101: Obtain the training dataset and validation dataset, and use the training dataset to train the price elasticity model.

[0033] In some embodiments, the elastic price model can be used to estimate changes in quantity demanded at different price levels; that is, the elastic price model can predict the quantity demanded for a commodity at different prices.

[0034] In some embodiments, commodity-related data can be collected to construct a training dataset and a validation dataset. The training dataset can be used to train a price elasticity model to obtain a trained price elasticity model. The validation dataset can be used to validate the price elasticity model. The error correction coefficient corresponding to the price elasticity model can be determined based on the validation dataset. The error correction coefficient is used to correct the demand quantity estimated by the price elasticity model. That is, after the estimated demand quantity is obtained by predicting based on the price elasticity model, the estimated demand quantity can be corrected based on the error correction coefficient to obtain a more accurate estimated demand quantity.

[0035] In some embodiments, when collecting product-related data, data that affects the price and demand of the product can be collected, such as product information data, market data, or data corresponding to other factors that affect the price and demand of the product.

[0036] The product information data includes two parts: basic static product information and order dynamic information. Basic static product information refers to relatively fixed and unchanging characteristics over a certain period of time, such as brand, model, category, production date, shelf life, and whether it is a consumable. Order dynamic information is the daily order history of the product, including order creation time, order payment amount, and historical sales volume.

[0037] Market data represents external market factors that influence commodity prices, including competitors and market policies, such as regional GDP, regional per capita consumption levels, local market base pricing, number of stores in the region, competitor activities, etc. Other factors include those other than those mentioned above that affect prices and demand. These include weather, product ratings, supply chain changes, holidays, and special events, among other factors that influence demand and orders.

[0038] Optionally, the specific data dimensions collected for product-related data can be increased or decreased according to the actual application scenario. The dimensions and quantity of collected data will affect the accuracy of the elastic price model construction. This disclosure does not impose any restrictions on the dimensions and quantity of collected data.

[0039] In some embodiments, after data collection is completed, data cleaning can be performed, such as removing abnormal data and standardizing the data. Since various quality issues may arise during multiple stages such as data entry, uploading, collection, parsing, and re-collection, using abnormal data for subsequent modeling will affect the effectiveness of the elastic pricing model. Therefore, it is necessary to clean the abnormal data caused by data quality issues.

[0040] For example, when there are duplicates in the collected data, the duplicate data can be removed; when there are missing fields in the collected data, the data with missing fields can be removed directly. For example, if a missing field in a data set is of high importance, i.e., an important field is missing, the data can be removed directly. Optionally, correlation coefficient analysis can be used to determine the importance of the missing field in the data, or if a data set has many missing fields, such as when the proportion of missing fields in a data set exceeds 50%, the data can be removed directly; or, when there are missing fields in the collected data, the nearest neighbor filling method can be used to fill the data. Optionally, recent data of the product can be used for filling. For example, if the daily sales of a product are missing, the latest historical sales of that product can be used for filling. The specific filling method or data cleaning method can be adjusted according to the actual situation, and this disclosure does not impose any restrictions.

[0041] For example, when the collected data values ​​exceed the normal range, the data can be directly removed or replaced using the nearest neighbor filling method. Optionally, the normal range can be determined by combining 3-sigma and a fixed threshold. The normal range determined by 3-sigma is the range of values ​​between the feature mean and three standard deviations. The fixed threshold can be a range preset based on empirical values. Optionally, the smaller and larger values ​​of the boundary values ​​of the normal range determined by 3-sigma and the normal range determined by the fixed threshold can be used as the boundary values ​​of the normal range. For example, if the normal range determined by 3-sigma is [30, 50] and the normal range determined by the fixed threshold is [40, 60], then the corresponding normal range is [30, 60]. Alternatively, the intersection of the two ranges can be selected as the normal range, such as [40, 50], etc. The normal range can be determined according to the actual application scenario, and this disclosure does not limit it.

[0042] In the above embodiments, after determining the normal range, data that exceeds the normal range can be directly removed or replaced using the nearest neighbor fill method. The nearest neighbor fill method can be used to set the data to empty, then use the nearest neighbor fill method to determine the replacement value, and use the replacement value to fill the empty data to achieve data replacement.

[0043] For example, when there are logically mutually exclusive fields in the collected data, the data can be removed or replaced using the nearest neighbor filling method. Optionally, a rule engine can be used to determine whether there are logical contradictions or mutually exclusive information between the fields of the data.

[0044] Alternatively, other data cleaning methods may be used to process anomalous data, and this disclosure does not limit such methods.

[0045] In some embodiments, after data cleaning, the data can be aggregated. For detailed data, aggregation feature extraction can be performed to stitch together data from multiple sources. For example, for dynamic data such as historical sales data of a product, data from various sources can be aggregated and integrated. That is, multiple detailed data are first aggregated into a single data record, and then multiple detailed data are summarized into a representative data record to obtain one data record for a product within a time interval, thus achieving the stitching of data from multiple sources.

[0046] Optionally, common aggregation methods typically involve extracting statistical values, such as sum, mean, variance, median, maximum, minimum, 25th and 95th quantiles, skewness and kurtosis, mode, etc. For example, daily order data for a product can be statistically analyzed. Optionally, sales on special dates (e.g., holidays) and in special locations (scenic spots, etc.) can be aggregated separately, for example, by calculating sales volume, month-on-month comparison, and year-on-year comparison. Optionally, feature cross-validation methods can be used to cross-combine aggregated static and dynamic information, such as the year-on-year growth rate of a product in a certain city during a certain holiday. Static information can be numerically converted or directly One-Hot encoded to facilitate data aggregation.

[0047] The above data aggregation method is only one example of this solution. In practical applications, the specific data aggregation method can be determined according to the actual scenario, and this disclosure does not limit it.

[0048] In some embodiments, after data aggregation is completed, data standardization can be performed on the aggregated data to eliminate dimensional differences between data features. Optionally, standardization can be performed on each field of the data. Specifically, the standardization operation is to subtract the mean from the original value and then divide by the standard deviation, as shown in Formula 1 below:

[0049]

[0050] Where z represents the standardized data feature, x represents the feature value of the data, u represents the mean of the feature value, and σ represents the standard deviation of the data feature.

[0051] In some embodiments, the standardized data can be divided into a training dataset and a validation dataset. Optionally, the training dataset may contain more data than the validation dataset. The training dataset can be used to train a price elasticity model. Optionally, machine learning regression models, such as XGBoost, linear regression, decision trees, etc., can be used to construct the price elasticity model. The constructed price elasticity model can be trained using the training dataset. For example, other feature values ​​can be fixed, and the price value feature can be changed to obtain the demand at different prices. Optionally, the fixed feature can be adjusted according to the actual situation. For example, when the fixed feature is the date, the date can be fixed as Monday first, and the Monday data in the training dataset can be used to train the model. Then, the fixed feature date can be changed, such as from Monday to Tuesday, and then the feature can be fixed again, and the price value can be changed to obtain the demand at different prices. Optionally, during the training process, cross-validation can be used to evaluate the model performance to ensure the model's generalization ability.

[0052] Alternatively, other training methods may be used to train the price elasticity model, and this disclosure does not limit this.

[0053] Step 102: Divide the preset price decision range into multiple sub-ranges.

[0054] In some embodiments, a price decision range can be preset. The price decision range can be a price range for which an error correction coefficient needs to be determined. For example, when it is necessary to determine the error correction coefficient corresponding to the price range in the range [80, 100), the range [80, 100) can be determined as the preset price decision range. The preset price decision range can be determined according to the actual application needs. It can be set in combination with the commodity price range and the price adjustment range adjusted by the operators. This disclosure does not limit this.

[0055] In some embodiments, the preset price decision range can be divided into multiple sub-ranges. Optionally, the price decision range can be divided according to a preset step size. For example, when the step size is 1, [80, 100] can be divided into 20 sub-ranges. The preset step size can be determined according to the actual application needs. It can be set in combination with the commodity price range and the price adjustment step size that the operators can adjust. This disclosure does not limit this.

[0056] In some embodiments, the multiple sub-intervals include at least one first interval corresponding to the price parameters in the validation dataset. That is, the validation dataset may contain data samples corresponding to some prices in the price decision interval, or it may contain data samples corresponding to all prices in the price decision interval. For example, the validation dataset may contain data corresponding to the prices in the sub-interval [81,82), such as the demand quantity corresponding to the price of 81.2.

[0057] Step 103: Determine the target error correction coefficients corresponding to each of the multiple sub-intervals.

[0058] In some embodiments, a target error correction coefficient can be determined for each sub-interval. All prices of goods included in the sub-interval can use the target error correction coefficient to correct the demand predicted by the price elasticity model. In other words, the target error correction coefficient is used to correct the error of the trained price elasticity model.

[0059] In some embodiments, the error correction coefficient of at least one first interval can be corrected based on the data samples in the verification dataset. Then, the error correction coefficient of at least one second interval can be determined based on the corrected error correction coefficient of at least one first interval, and smoothed to obtain the target error correction coefficients corresponding to the first interval and the second interval, thereby realizing the determination of the target error correction coefficients corresponding to multiple sub-intervals.

[0060] In other words, determining the target error correction coefficients corresponding to each of the multiple sub-intervals includes: for at least one first interval, determining the candidate error correction coefficients corresponding to each of the at least one first interval; training the linear regression model based on the candidate error correction coefficients corresponding to each of the at least one first interval to obtain an error correction coefficient prediction model; using the error correction coefficient prediction model to predict the candidate error correction coefficients corresponding to at least one second interval among the multiple sub-intervals; and smoothing the candidate error correction coefficients corresponding to at least one first interval and at least one second interval to obtain the target error correction coefficients corresponding to each of the multiple sub-intervals.

[0061] The price decision interval includes at least one first interval and at least one second interval. The validation dataset contains at least one price parameter belonging to the first interval, and no price parameter belongs to the second interval. In other words, if the validation dataset contains data samples with prices within the first interval (e.g., a sub-interval of [81, 82) where there is a product with a price of 81.2), this sub-interval is the first sub-interval. Conversely, if the validation dataset contains no product with a price within the range [81, 82), this interval is the second interval. That is, because the data samples in the validation set are limited, they may not cover all sub-intervals of the price decision interval. In this case, the sub-intervals covered by the validation dataset are the first interval, and the intervals with missing data samples are the second interval.

[0062] In summary, the above embodiments of this application can divide the price decision interval into multiple sub-intervals and determine the target error correction coefficient corresponding to each sub-interval. This can determine a more accurate error correction coefficient for each sub-interval, improve the accuracy of error correction, more accurately assess the prediction error level under different price levels, and improve the effectiveness and accuracy of the price strategy.

[0063] Figure 2 This is a flowchart illustrating a method for determining an error correction coefficient according to an embodiment of this disclosure. Figure 2 As shown, based on Figure 1 The illustrated embodiment shows that the method includes the following steps.

[0064] Step 201: For at least one first interval, determine the candidate error correction coefficients corresponding to each of the at least one first interval.

[0065] In some embodiments, determining the candidate error correction coefficients corresponding to each of the at least one first interval includes: for one of the at least one first intervals, determining at least one sample from the validation dataset that corresponds to the price parameter and the first interval; determining the candidate error correction coefficients corresponding to each of the at least one sample based on the first error correction coefficients and the second error correction coefficients corresponding to the at least one sample; and taking the average of the candidate error correction coefficients corresponding to each of the at least one sample as the candidate error correction coefficients corresponding to the first interval.

[0066] In some embodiments, data samples in the verification dataset that correspond to the price parameter and the first interval can be determined. For example, in the verification dataset, there are samples 1 with a price parameter of 80, samples 2 with a price parameter of 80.3, and samples 3 with a price parameter of 83. When the first interval is [80, 81), samples 1 and 2 are samples corresponding to the first interval, where the price parameter values ​​of samples 1 and 2 belong to the first interval. When the first interval is [83, 84), then sample 3 is a sample corresponding to the first interval.

[0067] In other words, the samples in the validation dataset can be divided into different first intervals. Within a first interval, the selection error correction coefficient corresponding to that interval can be determined based on at least one sample in that interval.

[0068] In some embodiments, the method further includes: for a first sample in at least one sample, using a price elasticity model to predict the demand corresponding to the first sample, and determining a first error correction coefficient corresponding to the first sample based on the demand corresponding to the first sample and the actual sales volume corresponding to the first sample; and determining a second error correction coefficient corresponding to the first sample using a weighted sliding window.

[0069] In some embodiments, optionally, at least one sample from the first interval can be used to validate the price elasticity model. For example, based on the price parameters of the first sample, the price elasticity model can be used to predict the demand corresponding to that price, and based on the demand corresponding to the first sample and the actual sales volume corresponding to the first sample, a first error correction coefficient corresponding to the first sample can be determined. That is, the first error correction coefficient is determined based on the predicted demand and actual sales volume of the sample, i.e., the first error coefficient is the error correction coefficient determined by actually using the first sample for validation. The first error correction coefficient can be the actual sales volume corresponding to the first sample divided by the demand corresponding to the first sample. For example, if the estimated demand is 100, but the actual sales volume is 110, then the first error correction coefficient is 1.1.

[0070] In some embodiments, the second error correction coefficient is determined using a weighted sliding window, wherein determining the second error correction coefficient corresponding to the first sample using a weighted sliding window includes: determining the cluster center of the cluster to which the first sample belongs; determining the first error correction coefficient corresponding to at least one second sample in the weighted sliding window based on the distance from the first sample to the cluster center; and generating the second error correction coefficient corresponding to at least one first sample based on the first error correction coefficient corresponding to at least one second sample in the weighted sliding window.

[0071] In other words, at least one first sample within the first interval can be clustered. Optionally, starting with HDBSCAN to cluster the samples, at least one first sample can be clustered using the sample vector of at least one first sample in the first interval to obtain at least one cluster corresponding to the first interval. Each cluster can determine a cluster center. The HDBSCAN clustering method has the advantages of small parameters and can adapt to clustering with different sample densities. Samples within a cluster are similar, that is, samples in a cluster have similar price elasticities. Clustering can determine a group of goods with similar price elasticities.

[0072] In some embodiments, the number of clusters in the first interval can be determined based on the minimum cluster size parameter of HDBSCAN, wherein the minimum cluster size can indicate the number of samples in the smallest cluster. The value of the minimum cluster size parameter can be adjusted according to the actual situation, for example, it can be adjusted in combination with the sample size and sample distribution, which is not limited in this disclosure.

[0073] In some embodiments, after clustering the samples in the first interval to obtain at least one cluster, a first error correction coefficient corresponding to at least one second sample in the weighted sliding window can be determined based on the distance from the first sample to the cluster center. Here, the second sample is a sample that is in the same sliding window as a first sample in the first interval. Optionally, the weighted sliding window may contain one first sample and at least one second sample, wherein the sample for which the second error coefficient needs to be determined is the first sample, i.e., the sample being processed is the first sample, and the remaining samples in the weighted sliding window are the second samples.

[0074] In some embodiments, the total number of samples in the weighted sliding window can be set as needed, for example, the number of samples in the weighted sliding window can be set to 3. Optionally, at least one first sample can be sorted according to the distance of the sample to the cluster center. The weighted sliding window can slide in the sorting order to determine the second error coefficient of each first sample. For example, when the number of samples in the weighted sliding window is 3, there are 4 samples in a cluster. The order obtained by sorting the samples according to the distance to the cluster center is a, b, c, d. At this time, the sliding window starts processing from sample a. That is, when processing sample a, the weighted sliding window contains three samples a, b, and c. At this time, sample a is the first sample, and samples b and c are the second samples. After determining the second error coefficient of sample a, it can slide backward to determine the second error coefficient of sample b. At this time, the weighted sliding window contains three samples b, c, and d. Sample b is the first sample, and samples c and d are the second samples.

[0075] In some embodiments, when determining the second error coefficient corresponding to the first sample using a weighted sliding window, at least one second error correction coefficient corresponding to the first sample can be generated based on the first error correction coefficient corresponding to at least one second sample in the weighted sliding window. For example, the error correction coefficient of the first sample can be used as a missing value, and the error correction coefficient of the first sample can be filled using a weighted method. The filled value is the second error correction coefficient of the first sample. The weighting can be performed by weighting the first error coefficients of at least one second sample in the weighted sliding window, and the resulting weighted value is used as the filled value. The weight corresponding to the second sample can be determined using a Gaussian kernel. Optionally, the sample closer to the cluster center has a higher weight value; or the average value of the first error coefficients of at least one second sample can be used as the filled value, etc. This disclosure does not limit this.

[0076] In some embodiments, after determining the first error correction coefficient and the second error correction coefficient corresponding to the first sample, the first error correction coefficient of the first sample can be corrected according to the second error correction coefficient to obtain the weighted error correction coefficient corresponding to the first sample, and the first sample can be post-processed to obtain the candidate error correction coefficient corresponding to the first sample.

[0077] In some embodiments, determining the candidate error correction coefficient corresponding to at least one sample based on the first error correction coefficient and the second error correction coefficient corresponding to at least one sample includes: determining the weight values ​​of the first error correction coefficient and the second error correction coefficient corresponding to at least one sample; weighting the first error correction coefficient and the second error correction coefficient using a weighting formula based on the weight values ​​of the first error correction coefficient and the second error correction coefficient to obtain the weighted error correction coefficient corresponding to at least one sample; and performing post-processing on the weighted error correction coefficient corresponding to at least one sample to obtain the candidate error correction coefficient corresponding to at least one sample.

[0078] In the above embodiments, a weighted formula can be used to determine the weighted error correction coefficient corresponding to the sample, wherein the weighted error correction coefficient is obtained by correcting the first error correction coefficient, and the weighting formula can be expressed as the following formula 2:

[0079] α′ i =w i *α i +w j *α j Formula 2

[0080] Where, α′ i w represents the error correction coefficient after correction of sample i; i and w jThese represent the weights of the first and second error correction coefficients for sample i, respectively. The default value is 0.5, which can be adjusted according to the actual situation; α i and α j Let represent the first error correction factor and the second error correction factor for sample i.

[0081] In some embodiments, post-processing may involve setting the error correction coefficient for the range exceeding a preset error correction coefficient to a boundary value to avoid exaggerated correction.

[0082] In some embodiments, after determining the candidate error correction coefficient corresponding to a sample, the candidate error coefficient of the first interval can be determined based on the candidate error coefficients of at least one sample. Optionally, the average value of the candidate error coefficients of at least one sample can be used as the candidate error coefficient of the first interval. Optionally, the above operation can be repeated for each first interval to determine the candidate error coefficient corresponding to each first interval.

[0083] Step 202: Train the linear regression model based on the candidate error correction coefficients corresponding to at least one first interval to obtain the error correction coefficient prediction model, and use the error correction coefficient prediction model to predict the candidate error correction coefficients corresponding to at least one second interval among multiple sub-intervals.

[0084] In some embodiments, since the validation dataset does not contain samples for the second interval, the above method cannot be used to determine the candidate error correction coefficients for the second interval. Therefore, candidate error correction coefficients for at least one second interval can be determined based on the candidate error correction coefficients for at least one first interval. Optionally, a linear regression model can be trained based on the candidate error correction coefficients corresponding to each of the at least one first interval to obtain an error correction coefficient prediction model, wherein the error correction coefficient prediction model is used to predict the candidate error correction coefficients for at least one second interval.

[0085] Optionally, the range values ​​of the first interval and the candidate error correction coefficients corresponding to the first interval can be used as training data to train the linear regression model, thereby determining the correspondence between the interval and the candidate error correction coefficients, and predicting the candidate error correction coefficients corresponding to the second interval based on the correspondence, thus determining at least one candidate error correction coefficient corresponding to the second interval.

[0086] Step 203: Smooth the candidate error correction coefficients corresponding to at least one first interval and at least one second interval to obtain the target error correction coefficients corresponding to each of the multiple sub-intervals.

[0087] In some embodiments, since the error correction coefficients of the same price range should influence each other and the error correction coefficients of price ranges that are close to each other should be similar, after determining the candidate error correction coefficients corresponding to at least one first range and at least one second range, it is necessary to smooth the error correction coefficients. The smoothing method can be a weighted sliding window smoothing method. Optionally, the ranges that are closer should have a greater influence weight.

[0088] In some embodiments, after smoothing is completed, the target error correction coefficients corresponding to at least one first interval and at least one second interval can be obtained, that is, the target error correction coefficients corresponding to each of the multiple sub-intervals contained in the decision interval can be obtained.

[0089] In summary, the embodiments of this disclosure can determine at least one candidate error correction coefficient for a first interval based on data samples in the verification dataset, and fill the error correction coefficient of at least one second interval with the candidate error correction coefficient of the first interval. This allows for the determination of corresponding error correction coefficients for all sub-intervals contained within the decision price interval, facilitating the use of different error correction coefficients to correct errors for products in different price intervals, thus making error correction more accurate. By smoothing the error correction coefficients, the influence between price intervals can be considered, resulting in more accurate error correction coefficients.

[0090] Figure 3 This is a flowchart illustrating a method for determining an error correction coefficient according to an embodiment of this disclosure. Figure 3 As shown, based on Figure 1 The illustrated embodiment shows that the method includes the following steps.

[0091] Step 301: When the weighted error correction coefficient is greater than or equal to the first boundary value and less than or equal to the second boundary value, the weighted error correction coefficient is determined as the candidate error correction coefficient corresponding to the first sample.

[0092] In some embodiments, post-processing of the weighted error correction coefficients corresponding to at least one sample may involve setting the error correction coefficients that exceed the preset error correction coefficient range to boundary values ​​to avoid exaggerated corrections.

[0093] The first boundary value is the lower boundary value, and the second boundary value is the upper boundary value. The boundary values ​​can be determined according to the range of the error correction coefficient. For example, when the range of the error correction coefficient is between 0.5 and 1.5, the first boundary value is the first error of 0.5, and the second boundary value is 1.5.

[0094] Alternatively, the weighted error correction coefficient can be post-processed based on the adjustment range of the error correction coefficient. For example, the difference between the weighted error correction coefficient and the first error correction coefficient can be determined. When the difference is greater than the adjustment range, the candidate error correction coefficient of the sample is determined according to the maximum value of the adjustment range. For example, when the maximum adjustment range is 1.5, when the difference is greater than 1.5, the candidate error correction coefficient is the first error coefficient plus 1.5.

[0095] In some embodiments, when the weighted error correction coefficient is greater than or equal to the first boundary value and less than or equal to the second boundary value, the weighted error correction coefficient can be directly determined as the candidate error correction coefficient corresponding to the first sample.

[0096] Step 302: When the weighted error correction coefficient is less than the first boundary value, the first boundary value is determined to be the candidate error correction coefficient corresponding to the first sample.

[0097] In some embodiments, when the weighted error correction coefficient is less than the first boundary value, the lower boundary value can be used as the candidate error correction coefficient corresponding to the first sample, that is, the candidate error correction coefficient is the first boundary value.

[0098] Step 303: When the weighted error correction coefficient is greater than the second boundary value, the second boundary value is determined to be the candidate error correction coefficient corresponding to the first sample.

[0099] In some embodiments, when the weighted error correction coefficient is greater than the second boundary value, the upper boundary value can be used as the candidate error correction coefficient corresponding to the first sample, that is, the candidate error correction coefficient is the second boundary value.

[0100] In summary, the above embodiments of this disclosure can post-process the weighted error correction coefficients to obtain the candidate error correction coefficients corresponding to the samples, thus avoiding exaggerated corrections.

[0101] The technical solutions of this disclosure will be further described in detail below with reference to specific application embodiments.

[0102] The following is an embodiment of the present disclosure providing an error correction method for price elasticity models based on Hierarchical Density-Based Spatial Clustering of Applications with Noise (HDBSCAN). HDBSCAN is an optimized sample density-based clustering algorithm that can automatically identify and process datasets with complex density distributions without requiring a pre-specified number of clusters. By applying this algorithm to price elasticity analysis, the prediction error level at different price levels can be more accurately assessed, thereby enabling dynamic adjustment of the error correction coefficient and improving the effectiveness of pricing strategies and the accuracy of predictions.

[0103] To further improve the accuracy of demand forecasting in the price elasticity model, this disclosure adopts an error correction method for the price elasticity model based on HDBSCAN. First, the trained price elasticity model is used to forecast samples on the validation set. Then, the forecast error for each sample is obtained as a temporary error correction coefficient. Next, continuous price values ​​are converted into discrete price ranges and divided into multiple sample sets based on these price ranges. For example, a continuous price between 80 and 81 is divided into one price range, and 80.1 is divided into a price range of 80 to 81. Different commodities have significant price differences, and the adjustable price ranges also vary considerably. The specific value range and step size design needs to be combined with the commodity price range and the price adjustment range that operators can adjust. Setting price ranges is to improve the sample reliability of the range and avoid the problem of low reliability of the error correction coefficient for a single sample in a continuous space. Here, it is assumed that the commodity price adjustment range is between 80 and 100. Then, HDBSCAN is used to perform clustering in each price range to obtain different clusters. The error correction coefficient of the current sample is adjusted according to the distance of the sample from other samples in the cluster, and finally the error correction coefficient of each sample is obtained. In order to prevent extreme cases, the error correction coefficient needs to be post-processed to limit the correction range. For example, the adjustment range of the error correction coefficient is between 0.5 and 1.5. The correction coefficients that exceed the correction range are treated as boundary values ​​to prevent large corrections caused by extreme samples. The specific range setting can be adjusted according to the price of the product and the experience of operation. Here, it is to reduce the possibility of risks in business operations. The above method is repeated in different price ranges to obtain the correction error coefficient of each product in different price ranges. Due to the small amount of validation data, some products may still have missing price ranges. Therefore, an interpolation method is introduced to interpolate the error correction coefficient of the missing price range. In order to take into account the values ​​of adjacent price ranges in the error correction coefficient of each price range, a smoothing function is introduced to smooth the error correction coefficient, and finally the error correction coefficient of each product in different price ranges is obtained.

[0104] like Figure 4 As shown, the complete content of this method is as follows:

[0105] Step 1: Product Data Collection. To build a price elasticity model, it's necessary to collect data on factors influencing price and demand from multiple sources. These factors can be categorized as follows:

[0106] 1. Product Information. Product information includes two parts: basic static information and order dynamic information. Basic product information refers to relatively fixed and unchanging characteristics within a certain period of time, such as brand, model, category, production date, shelf life, and whether it is a consumable. Order dynamic information is the product's daily historical order information, including order creation time, order payment amount, and historical sales volume.

[0107] 2. Market Data. Market data represents external market factors that influence commodity prices, including competitors and market policies, such as regional GDP, regional per capita consumption level, local market base pricing of the commodity, number of stores in the region, competitor activities, etc.

[0108] 3. Other factors. Other factors include those that affect price and demand other than those mentioned above. These include weather, product ratings, supply chain changes, holidays, and special events, among other factors that influence demand and orders.

[0109] It should be noted that rich data dimensions are the foundation for the accuracy of subsequent price elasticity models. Of course, even if some data dimensions are missing or more data dimensions are collected, elasticity models can still be built. That is, data dimensions can be adjusted according to the data collection situation of the actual application scenario. However, when the data set dimensions are very small or too many, the method of building the elasticity model needs to be adjusted according to the actual situation. This disclosure does not impose any restrictions on the data set dimensions.

[0110] Step 2: Abnormal Data Cleaning. Various quality issues may arise during multiple stages of data entry, uploading, collection, parsing, and re-collection. Using abnormal data for subsequent modeling will affect the model's performance. Therefore, it is necessary to clean the abnormal data caused by data quality issues. There are three main types of quality problems and their corresponding handling methods:

[0111] 1. Data Missing and Duplicates. The data contains missing values ​​for certain fields and duplicate data. Duplicate data is removed directly. Missing data is handled in two ways: One is direct removal: samples with missing fields accounting for more than 50% of a data set, or samples with missing features indicating a correlation coefficient exceeding 50% importance, are directly removed, such as a missing unit price field for a product. The other is nearest neighbor imputation, i.e., imputing with recent historical data for the product. For example, if the daily sales data for a product is missing, the latest historical sales data for the current product is used to imput it. The specific imputation method or data cleaning method is adjusted according to the actual situation, and this disclosure does not impose any restrictions.

[0112] 2. Values ​​outside the normal range. Values ​​significantly deviate from the normal range. For data exhibiting abnormal behavior, such as extremely high demand for a product at a certain price, replace the data with statistical values ​​or set it to null. Use a combination of 3-sigma and a fixed threshold to determine if values ​​deviate from the normal range. 3-sigma considers values ​​exceeding the feature mean plus or minus three standard deviations as outliers. Combine this with a fixed threshold, selecting the smaller of the fixed threshold and 3-sigma as the threshold (boundary value). Values ​​exceeding the boundary are set to null and then filled in, as shown in section 1.

[0113] 3. Logical mutual exclusion between data fields. There are logical contradictions or mutually exclusive information between data fields. Such anomalies require the development of a rule engine for handling. Data that does not conform to the rule engine should be set to null or the entire data should be deleted, and then processed according to the logic for null values. See 1 for the filling method.

[0114] It should be noted that using anomalous data for modeling can affect the model's performance. In practical applications, there are many other ways to perform data cleaning, and this disclosure does not impose any restrictions here.

[0115] Step 3: Data Aggregation and Multi-Source Data Integration. For detailed data, feature extraction is performed, and then data from multiple sources is concatenated. For dynamic data, such as historical sales data of products, and data from various sources, data aggregation and integration are required. This involves first aggregating multiple detailed data entries into a single data entry, then summarizing multiple detailed data entries into a single representative data record (one data entry for one product within a specific time period), and finally concatenating data from multiple sources. In the data aggregation phase, the focus is mainly on dynamic data. Common aggregation methods typically involve extracting statistical values. For time-series data, such as daily order data for goods, the main statistical methods include the sum, mean, variance, median, maximum, minimum, 25th and 95th quantiles, skewness and kurtosis, mode, etc., of the behavior over the past N days. For sales on special dates (such as May Day and National Day) and locations (such as scenic spots), sales volume, month-on-month comparison, and year-on-year comparison need to be calculated separately. Then, the feature cross-combination method is used to cross-combine the aggregated information of static and dynamic information, such as the year-on-year growth rate of a product in a certain city during a certain holiday. Finally, the static information from step 1 is concatenated, and the static information is either numerically converted or directly One-Hot encoded.

[0116] It should be noted that this step is to prepare features for building the elasticity model. There are many ways and techniques for feature construction, and more methods and techniques can be used in practice. This disclosure only shows the basic method for building a price elasticity model. This disclosure does not limit the method of building a price elasticity model in specific application scenarios.

[0117] Step 4: Data Standardization. To eliminate differences in units of measurement between features, the features integrated in Step 3 need to be standardized. Standardization is performed on each field separately. Specifically, the original value is subtracted from the mean, and then divided by the standard deviation. The specific formula is as follows:

[0118]

[0119] Where z represents the standardized data feature; x represents the feature value; u represents the mean of the feature value; and σ represents the standard deviation of the feature.

[0120] It should be noted that most elasticity models require standardization of numerical data, but standardization is not very meaningful for tree models, but it does not affect the model performance, so standardization is performed uniformly.

[0121] Step 5: Construct a price elasticity model for the commodity. The price elasticity model reflects the change in quantity demanded of a commodity at different prices. Constructing a price elasticity model quantifies the impact of different prices on quantity demanded. Using machine learning regression models, such as XGBoost, linear regression, and decision trees, model the relationship between price and demand from Step 2. Then, fix other feature values ​​and change the price value feature to obtain the quantity demanded at different prices. The fixed feature can be adjusted according to actual conditions, such as changing from Monday to Tuesday based on the date, and then fixing it again and changing the price value again. Simultaneously, during training, pay attention to using cross-validation to evaluate model performance to ensure the model's generalization ability.

[0122] This disclosure does not limit the methods for constructing price elasticity models. More complex methods or deep models can be used. The focus of this disclosure is on how to correct the errors of the model in actual production. However, a good elasticity model is the basis for error correction. If the modeling effect is poor, it will be more difficult to adjust the correction coefficient.

[0123] Step 6: Obtain the error correction coefficient for the product validation set samples. Obtain the error correction coefficient for each product sample on the validation set. In Step 5, the price elasticity model was obtained. The price elasticity model is obtained on the training dataset, with a portion of the data reserved as the validation set. The data in the validation set is usually relatively recent, such as the last N days. N should not be too large to avoid the cumulative error over time increasing. It is usually 1 to 3 time intervals. If it is a daily dimension, 1 to 3 days of data are reserved. That is, the most recent samples of each product within 1 to 3 days are reserved as the validation set. Then, the validation set is input into the trained elasticity model to obtain the ratio of the actual sample value to the predicted value, which is the error correction coefficient for that product on the validation set. For example, if the estimated demand of the validation set samples is 100 and the actual order quantity is 80, then the error correction coefficient is 0.8 = 80 / 100.

[0124] Step 7: Grouping Products by Price Range. Divide the validation set samples into different groups based on fixed price ranges. To evaluate the error correction coefficient under different price decision ranges, continuous price values ​​are converted into discrete values, such as converting values ​​between 80 and 81 to 80. This restricts the infinite range to a finite decision range, increasing the data reliability within that price range and minimizing other errors caused by single samples. Then, the validation set samples are divided into multiple groups according to price ranges. In real-world scenarios, the price differences between different products are significant, and the adjustable price ranges also vary considerably. The specific value range range and step size design needs to consider the product price range and the price adjustment range that operators can adjust. Setting price ranges improves sample reliability and avoids the problem of low reliability of error correction coefficients for single samples in a continuous space. Assuming the decision price is set to 80-100, and the price decision range is set with a step size of 1, there are 20 price decision ranges [80, 81, 82, ..., 100).

[0125] Step 8: Cluster the products using HDBSCAN. For samples within each price range, cluster them using HDBSCAN. Each price range has a sample vector, and the elasticity model is trained using these sample vectors. Use vectors consistent with the elasticity model to perform HDBSCAN clustering. The HDBSCAN clustering method has small parameters and can adapt to different sample densities. Use HDBSCAN to obtain multiple clusters. Samples between clusters are considered similar, meaning they have similar price elasticities. The purpose of clustering is to find groups of products with similar price elasticities.

[0126] It should be noted that although HDBSCAN has a relatively small number of parameters and can adapt to clustering samples of different densities, there is still a minimum cluster size parameter that needs to be adjusted according to the actual situation. This adjustment needs to be made in conjunction with the sample size and sample distribution. Using the default value without adjustment usually yields good results. This disclosure does not impose any restrictions on the parameter tuning methods for HDBSCAN.

[0127] Step 9: Correcting the error correction coefficient based on clustering results and post-processing. The error correction coefficient is corrected using samples of goods within the cluster, and then post-processed. Samples within clusters exhibit similar price elasticity, effectively compensating for the poor confidence level of single or small samples in the validation set, and enriching the sample size across price ranges. Each sample now has two attributes: the error correction coefficient and its distance from the cluster center. First, the error correction coefficient of the current sample is treated as a missing value. Then, the samples are sorted based on their distance from the cluster center. Next, a weighted sliding window method is used to fill in the missing values. The default weight values ​​are either Gaussian kernels or the mean. Using weighting means that closer samples should have a greater influence on the current sample, but this can be adjusted in practice. Alternatively, the mean within the window can be used directly. This disclosure uses a Gaussian kernel-weighted sliding window. After assuming missing values ​​and then filling with a sliding window, two error correction coefficients are obtained for the current sample: one from the validation set and the other from the weighted sliding window filling. These two error correction coefficients are then weighted, with the weights set according to the specific situation. The default values ​​are 0.5 and 0.5, meaning the error correction coefficients from the validation set and the weighted sliding window filling within the cluster are considered to have the same weight. The weighted method yields the order correction coefficient for this product. The specific formula is as follows:

[0128] α′ i =w i *α i +w j *α j

[0129] Where, α′ i w represents the error correction coefficient after correction for product i; i and w j These represent the weights of the original error correction coefficient for product i in the validation set and the error correction coefficient calculated using a weighted sliding window within the cluster, respectively. The default value is 0.5, which can be adjusted according to the actual situation; α i and α j This represents the original error correction coefficient of the validation set sample for product i and the error correction coefficient calculated by the sliding window within the cluster.

[0130] Post-processing sets the error correction coefficients for ranges exceeding the preset error correction coefficients to boundary values ​​to avoid exaggerated corrections.

[0131] It should be noted that the sliding window method and the weight values ​​of the two error correction coefficients for each sample are not specifically limited and can be adjusted according to the actual situation.

[0132] Step 10: Fill in the error correction coefficients for missing price ranges. The validation set of products may not cover all price ranges, requiring filling. First, define the range of all decision price ranges, such as between 80 and 100, with a step size of 1, resulting in 20 price ranges. Using the corrected error correction coefficients obtained in Step 9 for different price ranges, build a linear regression model to predict the error correction coefficients for the missing price ranges. That is, construct a linear regression model using the existing price ranges and error correction coefficients as the training set, and then predict the missing error correction coefficients. The specific filling method is not limited in this disclosure and can be adjusted according to the actual situation.

[0133] Step 11: Smooth the error correction coefficients for different price ranges of the product. The error correction coefficients for different price ranges should influence each other, and error correction coefficients for price ranges close to each other should be similar. Therefore, smoothing is required for the error correction coefficients. A weighted sliding window smoothing method can be used, with closer price ranges having a greater influence weight. After smoothing, the error correction coefficient curves for different price ranges are obtained. This disclosure does not limit the data smoothing method and it can be adjusted according to the actual situation.

[0134] Step 12: Obtain the error correction coefficient based on the actual price of the product. After the product goes live, the operations staff selects a price value, first uses the elasticity model to generate an estimated value, and then queries the price range and error correction coefficient from Step 11 according to the price range of the selected price value. The error correction coefficient of the price range in which the selected price value is located is used to correct the estimated value of the elasticity model, thus obtaining the corrected demand estimate.

[0135] In summary, the above examples of this disclosure propose an error correction method for the price elasticity model based on HDBSCAN. This method provides different error correction coefficients for different price ranges, avoiding the situation where a single error correction coefficient applies to all price ranges and fully considering the inconsistency of error characteristics across different price ranges. Furthermore, it addresses the issue of correction coefficient failure that may arise from inconsistencies between the price range correction coefficients derived on the validation set and those in actual production.

[0136] The above-described example of this disclosure introduces the HDBSCAN clustering algorithm into the error correction of the elastic model. HDBSCAN can not only handle datasets with complex density distributions, but also has few parameters and high availability. The introduction of clustering methods enhances the reliability of the error correction coefficients of single-point samples. This method provides a scientific basis for the dynamic adjustment of error correction coefficients and enhances the adaptability and flexibility of the model.

[0137] The above example of this disclosure divides continuous prices into multiple price intervals in the error correction coefficient of the price elasticity model, eliminating the problem of low confidence of single samples and making the error correction coefficient of prices more robust.

[0138] The above example of this disclosure introduces interpolation and smoothing methods to further correct the error correction coefficients. To address the possibility of missing price ranges in the validation set, this disclosure uses interpolation to fill in the gaps. Then, to account for the impact of correction coefficients on different price ranges, this disclosure introduces a smoothing method to correct the error correction coefficients. By filling in the gaps using interpolation and then employing smoothing techniques to ensure a natural transition in error correction coefficients between different price ranges, the stability and predictive performance of the model are further improved.

[0139] Figure 5 This is a schematic diagram of an error correction coefficient determination device 500 provided in an embodiment of this disclosure. Figure 5 As shown, the device includes: a first processing unit 510, used to acquire a training dataset and a validation dataset, and to train a price elasticity model using the training dataset, the price elasticity model being used to predict changes in demand at different price levels; a second processing unit 520, used to divide a preset price decision interval into multiple sub-intervals, the multiple sub-intervals including at least one first interval corresponding to the price parameters in the validation dataset; and a third processing unit 530, used to determine the target error correction coefficients corresponding to each of the multiple sub-intervals, the target error correction coefficients being used to correct the error of the trained price elasticity model.

[0140] In some embodiments, the third processing unit is further configured to: determine candidate error correction coefficients corresponding to at least one first interval; train a linear regression model based on the candidate error correction coefficients corresponding to at least one first interval to obtain an error correction coefficient prediction model; use the error correction coefficient prediction model to predict candidate error correction coefficients corresponding to at least one second interval among multiple sub-intervals; and smooth the candidate error correction coefficients corresponding to at least one first interval and at least one second interval to obtain target error correction coefficients corresponding to each of the multiple sub-intervals.

[0141] In some embodiments, the third processing unit is further configured to, for one of the first intervals, determine at least one sample from the verification dataset that corresponds to the price parameter of the first interval; determine the candidate error correction coefficient corresponding to each of the at least one sample based on the first error correction coefficient and the second error correction coefficient corresponding to the at least one sample; and take the average value of the candidate error correction coefficients corresponding to each of the at least one sample as the candidate error correction coefficient corresponding to the first interval.

[0142] In some embodiments, the error correction coefficient determination device further includes a fourth processing unit, configured to, for a first sample in at least one sample, use a price elasticity model to predict the demand corresponding to the first sample, and determine a first error correction coefficient corresponding to the first sample based on the demand corresponding to the first sample and the actual sales volume corresponding to the first sample; and determine a second error correction coefficient corresponding to the first sample using a weighted sliding window.

[0143] In some embodiments, the fourth processing unit is further configured to determine the cluster center of the cluster to which the first sample belongs; determine a first error correction coefficient corresponding to at least one second sample in the weighted sliding window based on the distance from the first sample to the cluster center; and generate a second error correction coefficient corresponding to at least one first sample based on the first error correction coefficient corresponding to at least one second sample in the weighted sliding window.

[0144] In some embodiments, the third processing unit is further configured to determine the weight values ​​of the first error correction coefficient and the second error correction coefficient corresponding to at least one sample; to perform weighted processing on the first error correction coefficient and the second error correction coefficient using a weighting formula based on the weight values ​​of the first error correction coefficient and the second error correction coefficient, thereby obtaining the weighted error correction coefficient corresponding to at least one sample; and to perform post-processing on the weighted error correction coefficient corresponding to at least one sample, thereby obtaining the candidate error correction coefficient corresponding to at least one sample.

[0145] In some embodiments, the third processing unit is further configured to: determine the weighted error correction coefficient as the candidate error correction coefficient corresponding to the first sample when the weighted error correction coefficient is greater than or equal to the first boundary value and less than or equal to the second boundary value; determine the first boundary value as the candidate error correction coefficient corresponding to the first sample when the weighted error correction coefficient is less than the first boundary value; and determine the second boundary value as the candidate error correction coefficient corresponding to the first sample when the weighted error correction coefficient is greater than the second boundary value.

[0146] In summary, the error correction coefficient determination device 500 can determine the target error correction coefficient corresponding to each sub-interval, which facilitates the use of different error correction coefficients in different price intervals, improves the accuracy of error correction, and can more accurately assess the forecast error level under different price levels, thereby improving the effectiveness of the pricing strategy and the accuracy of forecasts.

[0147] The methods and apparatus provided in the embodiments of this application have been described above. To implement the functions of the methods provided in the embodiments of this application, the electronic device may include a hardware structure and software modules, and may implement the above functions in the form of a hardware structure, software modules, or a hardware structure plus software modules. One of the above functions may be executed in the form of a hardware structure, software modules, or a hardware structure plus software modules.

[0148] Figure 6 This is a block diagram illustrating an electronic device 600 for implementing the above-described method according to an exemplary embodiment. For example, the electronic device 600 may be a mobile phone, computer, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.

[0149] Reference Figure 6 The electronic device 600 may include one or more of the following components: a processing component 602, a memory 604, a power supply component 606, a multimedia component 608, an audio component 610, an input / output (I / O) interface 612, a sensor component 614, and a communication component 616.

[0150] Processing component 602 typically controls the overall operation of electronic device 600, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 602 may include one or more processors 620 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 602 may include one or more modules to facilitate interaction between processing component 602 and other components. For example, processing component 602 may include a multimedia module to facilitate interaction between multimedia component 608 and processing component 602.

[0151] Memory 604 is configured to store various types of data to support the operation of electronic device 600. Examples of this data include instructions for any application or method operating on electronic device 600, contact data, phonebook data, messages, pictures, videos, etc. Memory 604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0152] Power supply component 606 provides power to various components of electronic device 600. Power supply component 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 600.

[0153] Multimedia component 608 includes a screen that provides an output interface between electronic device 600 and user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 608 includes a front-facing camera and / or a rear-facing camera. When electronic device 600 is in an operating mode, such as a shooting mode or video mode, the front-facing camera and / or rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0154] Audio component 610 is configured to output and / or input audio signals. For example, audio component 610 includes a microphone (MIC) configured to receive external audio signals when electronic device 600 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 604 or transmitted via communication component 616. In some embodiments, audio component 610 also includes a speaker for outputting audio signals.

[0155] I / O interface 612 provides an interface between processing component 602 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.

[0156] Sensor assembly 614 includes one or more sensors for providing state assessments of various aspects of electronic device 600. For example, sensor assembly 614 may detect the on / off state of electronic device 600, the relative positioning of components such as the display and keypad of electronic device 600, changes in position of electronic device 600 or a component of electronic device 600, the presence or absence of user contact with electronic device 600, orientation or acceleration / deceleration of electronic device 600, and temperature changes of electronic device 600. Sensor assembly 614 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 614 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 614 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.

[0157] Communication component 616 is configured to facilitate wired or wireless communication between electronic device 600 and other devices. Electronic device 600 can access wireless networks based on communication standards, such as WiFi, 2G or 3G, 4G LTE, 5G NR (NewRadio), or combinations thereof. In one exemplary embodiment, communication component 616 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 616 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0158] In an exemplary embodiment, the electronic device 600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.

[0159] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 604 including instructions, which can be executed by a processor 620 of an electronic device 600 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0160] Embodiments of this disclosure also provide a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to perform the methods described in the above embodiments of this disclosure.

[0161] Embodiments of this disclosure also provide a computer program product, including a computer program that is executed by a processor using the methods described in the above embodiments of this disclosure.

[0162] Figure 7 This is a schematic diagram illustrating the structure of a chip 700 for implementing the above method according to an exemplary embodiment. (Refer to...) Figure 7 The chip 700 includes a communication interface 701 and at least one processor 702. The communication interface 701 is used to receive signals input to the chip 700 or signals output from the chip 700. The processor 702 communicates with the communication interface 701 and implements the methods described in the above embodiments of this disclosure through logic circuits or executing code instructions.

[0163] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0164] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with an embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in at least one embodiment or example.

[0165] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of the invention includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of the invention pertain.

[0166] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processing module, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having at least one wiring (control method), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which programs can be printed, because programs can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.

[0167] It should be understood that various parts of the embodiments of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0168] Those skilled in the art will understand that all or part of the steps of the methods described in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.

[0169] Furthermore, the functional units in the various embodiments of the present invention can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc.

[0170] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. A method of determining an error correction coefficient, characterized by, The method includes: Obtain a training dataset and a validation dataset, and use the training dataset to train a price elasticity model, which is used to predict changes in demand at different price levels; The preset price decision interval is divided into multiple sub-intervals, and the multiple sub-intervals include at least one first interval corresponding to the price parameter in the verification dataset; Determine the target error correction coefficients corresponding to each of the multiple sub-intervals. The target error correction coefficients are used to correct the errors of the trained price elasticity model.

2. The method of claim 1, wherein, Determining the target error correction coefficients corresponding to each of the plurality of sub-intervals includes: For each of the at least one first interval, a candidate error correction coefficient is determined. Based on the candidate error correction coefficients corresponding to each of the at least one first interval, a linear regression model is trained to obtain an error correction coefficient prediction model, and the error correction coefficient prediction model is used to predict the candidate error correction coefficients corresponding to at least one second interval among the plurality of sub-intervals. The candidate error correction coefficients corresponding to the at least one first interval and the at least one second interval are smoothed to obtain the target error correction coefficients corresponding to each of the plurality of sub-intervals.

3. The method of claim 2, wherein, Determining the candidate error correction coefficients corresponding to each of the at least one first interval includes: For one of the at least one first intervals, determine at least one sample from the verification dataset that corresponds to the price parameter in the first interval; Based on the first error correction coefficient and the second error correction coefficient corresponding to the at least one sample, determine the candidate error correction coefficient corresponding to each of the at least one sample; The average value of the candidate error correction coefficients corresponding to each of the at least one sample is used as the candidate error correction coefficient corresponding to the first interval.

4. The method of claim 3, wherein, The method further includes: For the first sample in the at least one sample, the price elasticity model is used to predict the demand corresponding to the first sample, and the first error correction coefficient corresponding to the first sample is determined based on the demand corresponding to the first sample and the actual sales volume corresponding to the first sample. The second error correction coefficient corresponding to the first sample is determined by using a weighted sliding window.

5. The method of claim 4, wherein, The step of determining the second error correction coefficient corresponding to the first sample using a weighted sliding window includes: Determine the cluster center of the cluster to which the first sample belongs; Based on the distance from the first sample to the cluster center of the cluster, determine the first error correction coefficient corresponding to at least one second sample in the weighted sliding window; The second error correction coefficient corresponding to the at least one first sample is generated based on the first error correction coefficient corresponding to at least one second sample in the weighted sliding window.

6. The method according to claim 3, characterized in that, The step of determining the candidate error correction coefficient corresponding to the at least one sample based on the first error correction coefficient and the second error correction coefficient corresponding to the at least one sample includes: Determine the weight values ​​of the first error correction coefficient and the second error correction coefficient corresponding to the at least one sample; Based on the weight values ​​of the first error correction coefficient and the second error correction coefficient, a weighting formula is used to weight the first error correction coefficient and the second error correction coefficient to obtain the weighted error correction coefficient corresponding to the at least one sample. Post-processing is performed on the weighted error correction coefficients corresponding to the at least one sample to obtain the candidate error correction coefficients corresponding to the at least one sample.

7. The method according to claim 6, characterized in that, The post-processing of the weighted error correction coefficients corresponding to the at least one first sample to obtain the candidate error correction coefficients corresponding to the at least one first sample includes: When the weighted error correction coefficient is greater than or equal to the first boundary value and less than or equal to the second boundary value, the weighted error correction coefficient is determined to be the candidate error correction coefficient corresponding to the first sample. When the weighted error correction coefficient is less than the first boundary value, the first boundary value is determined to be the candidate error correction coefficient corresponding to the first sample; When the weighted error correction coefficient is greater than the second boundary value, the second boundary value is determined to be the candidate error correction coefficient corresponding to the first sample.

8. An error correction coefficient determination device, characterized in that, The device includes: The first processing unit is used to acquire a training dataset and a validation dataset, and to train a price elasticity model using the training dataset. The price elasticity model is used to predict changes in demand at different price levels. The second processing unit is used to divide the preset price decision interval into multiple sub-intervals, wherein the multiple sub-intervals include at least one first interval corresponding to the price parameters in the verification dataset. The third processing unit is used to determine the target error correction coefficients corresponding to each of the plurality of sub-intervals, and the target error correction coefficients are used to correct the errors of the trained price elasticity model.

9. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.

10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-7.

11. A chip, characterized in that, It includes at least one processor and a communication interface; the communication interface is used to receive signals input to the chip or signals output from the chip, and the processor communicates with the communication interface and implements the method as described in any one of claims 1 to 7 through logic circuits or executing code instructions.

12. A computer program product comprising a computer program, wherein, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 7.