CN117131965A - Data prediction method and device, computer storage medium and electronic equipment - Google Patents

Data prediction method and device, computer storage medium and electronic equipment Download PDF

Info

Publication number
CN117131965A
CN117131965A CN202210540652.9A CN202210540652A CN117131965A CN 117131965 A CN117131965 A CN 117131965A CN 202210540652 A CN202210540652 A CN 202210540652A CN 117131965 A CN117131965 A CN 117131965A
Authority
CN
China
Prior art keywords
transaction data
data prediction
class
transaction
model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210540652.9A
Other languages
Chinese (zh)
Inventor
张轩琪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Zhenshi Information Technology Co Ltd
Original Assignee
Beijing Jingdong Zhenshi Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Zhenshi Information Technology Co Ltd filed Critical Beijing Jingdong Zhenshi Information Technology Co Ltd
Priority to CN202210540652.9A priority Critical patent/CN117131965A/en
Publication of CN117131965A publication Critical patent/CN117131965A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0631Resource planning, allocation, distributing or scheduling for enterprises or organisations
    • G06Q10/06311Scheduling, planning or task assignment for a person or group
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0635Risk analysis of enterprise or organisation activities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Human Resources & Organizations (AREA)
  • Strategic Management (AREA)
  • Economics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Physics & Mathematics (AREA)
  • Marketing (AREA)
  • General Business, Economics & Management (AREA)
  • Development Economics (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • Game Theory and Decision Science (AREA)
  • Accounting & Taxation (AREA)
  • Educational Administration (AREA)
  • Finance (AREA)
  • Software Systems (AREA)
  • Evolutionary Computation (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • Medical Informatics (AREA)
  • Technology Law (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The disclosure relates to the technical field of computers, and provides a data prediction method, a data prediction device, a computer storage medium and electronic equipment, wherein the data prediction method comprises the following steps: acquiring a plurality of transaction data sets corresponding to a plurality of article categories, each transaction data set comprising a plurality of transaction data of the article category in different transaction areas and different time periods; acquiring a dispersion index of a plurality of transaction data contained in each transaction data set, and acquiring an accumulated value of the plurality of transaction data contained in each transaction data set; determining the object class with the dispersion index larger than the preset dispersion and the accumulated value smaller than a preset threshold value as a target class; training based on the transaction data set corresponding to the target product class to obtain a data prediction model, and obtaining a transaction data prediction result of the product class to be predicted in a future period by using the data prediction model. The method and the device can accurately predict the transaction data of the article class in the new transaction area.

Description

Data prediction method and device, computer storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a data prediction method, a data prediction apparatus, a computer storage medium, and an electronic device.
Background
With the maturation and wide application of technologies such as big data and machine learning, the emerging technologies are beginning to be applied to the field of commodity index data prediction, and the commodity index data prediction is an important basis for an enterprise to formulate a next operation plan.
In the related art, the transaction data prediction value of each item in each area is only affected by the sample characteristics of the area, and the sample characteristics of other areas cannot be referenced, so that when a certain item is sold for the first time in a new area, the transaction data cannot be accurately predicted due to insufficient samples.
In view of the foregoing, there is a need in the art to develop a new data prediction method and apparatus.
It should be noted that the information disclosed in the foregoing background section is only for enhancing understanding of the background of the present disclosure.
Disclosure of Invention
The disclosure aims to provide a data prediction method, a data prediction device, a computer storage medium and an electronic device, so as to overcome the defect that transaction data cannot be predicted when a certain product is sold for the first time in a new area in the related art at least to a certain extent.
Other features and advantages of the present disclosure will be apparent from the following detailed description, or may be learned in part by the practice of the disclosure.
According to a first aspect of the present disclosure, there is provided a data prediction method, comprising: acquiring a plurality of transaction data sets corresponding to a plurality of article categories, each transaction data set comprising a plurality of transaction data of the article category in different transaction areas and different time periods; acquiring a dispersion index of a plurality of transaction data contained in each transaction data set, and acquiring an accumulated value of the plurality of transaction data contained in each transaction data set; determining the object class with the dispersion index larger than the preset dispersion and the accumulated value smaller than a preset threshold value as a target class; training based on a transaction data set corresponding to the target product class to obtain a data prediction model, and obtaining a transaction data prediction result of the product class to be predicted in a future period by using the data prediction model; the data prediction model is a multi-layer Bayesian model, and the transaction data prediction result comprises a plurality of transaction data prediction values and corresponding probabilities thereof.
In an exemplary embodiment of the present disclosure, the determining, as the target class, the class of the article having the dispersion index greater than the preset dispersion and the accumulated value less than the preset threshold value includes: according to the dispersion index, M article classes with the dispersion index smaller than a preset threshold value are selected from the plurality of article classes; wherein M is an integer greater than 1; and screening target product classes with accumulated values smaller than a preset threshold value from the M product classes according to the accumulated values.
In an exemplary embodiment of the present disclosure, training to obtain a data prediction model according to the transaction data set of the target class includes: carrying out correlation analysis on the transaction data of the target product class and the time period to obtain a correlation analysis result; determining the order of a machine learning model to be trained according to the correlation analysis result; and training the machine learning model to be trained based on the transaction data set of the target class to obtain the data prediction model.
In an exemplary embodiment of the disclosure, the determining the order of the machine learning model to be trained according to the correlation analysis result includes: if the trade data and the time period meet the linear relation, determining a preset order as the order of the machine learning model to be trained; and if the linear relation between the transaction data and the time period is not satisfied, determining the order of the machine learning model to be trained from a preset data range.
In an exemplary embodiment of the present disclosure, the determining the order of the machine learning model to be trained from a predetermined data range includes: constructing a plurality of reference models with different orders according to a plurality of numerical values contained in the preset data range; verifying the plurality of reference models by using a cross verification algorithm to obtain the precision of each reference model; and determining the order corresponding to the reference model with highest precision as the order of the machine learning model to be trained.
In an exemplary embodiment of the disclosure, the training of the transaction data set based on the target class to obtain the data prediction model includes: and inputting the transaction data set of the target class into the machine learning model to be trained for training until the loss function value of the machine learning model to be trained is converged, ending the training, and obtaining the data prediction model.
In an exemplary embodiment of the present disclosure, after obtaining the transaction data prediction result for the class to be predicted, the method further includes: acquiring current inventory information of the to-be-predicted product; and determining the stock information of the to-be-predicted class according to the transaction data prediction result and the inventory information.
According to a second aspect of the present disclosure, there is provided a data prediction apparatus comprising: the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring a plurality of transaction data sets corresponding to a plurality of article types, and each transaction data set comprises a plurality of transaction data of the article types in different transaction areas and different time periods; the class screening module is used for acquiring the dispersion index of the transaction data contained in each transaction data set and acquiring the accumulated value of the transaction data contained in each transaction data set; determining the object class with the dispersion index larger than the preset dispersion and the accumulated value smaller than a preset threshold value as a target class; the data prediction module is used for training based on the transaction data set corresponding to the target class to obtain a data prediction model, and obtaining a transaction data prediction result of the class to be predicted in a future period by utilizing the data prediction model; the data prediction model is a multi-layer Bayesian model, and the transaction data prediction result comprises a plurality of transaction data prediction values and corresponding probabilities thereof.
According to a third aspect of the present disclosure, there is provided a computer storage medium having stored thereon a computer program which, when executed by a processor, implements the data prediction method of the first aspect described above.
According to a fourth aspect of the present disclosure, there is provided an electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the data prediction method of the first aspect described above via execution of the executable instructions.
As can be seen from the above technical solutions, the data prediction method, the data prediction device, the computer storage medium and the electronic device in the exemplary embodiments of the present disclosure have at least the following advantages and positive effects:
in the technical solutions provided in some embodiments of the present disclosure, on one hand, a plurality of transaction data sets corresponding to a plurality of article categories are obtained, and an accumulated value of a plurality of transaction data included in each transaction data set is obtained; the object class with the dispersion index larger than the preset dispersion and the accumulated value smaller than the preset threshold value is determined as the object class, and the object class with uneven transaction data distribution and smaller transaction data quantity in different transaction areas can be screened out, so that when the object class to be predicted is sold for the first time in a new area, the transaction data of the object class can be predicted according to the transaction data of the object class, and the problem that in the related art, when a certain class is sold for the first time in the new area, the transaction data cannot be predicted is solved. On the other hand, a data prediction model is obtained based on the training of the transaction data set corresponding to the target item, and a plurality of transaction data prediction values and corresponding probabilities of the item to be predicted in a future period are obtained by utilizing the data prediction model, so that a prediction result with a more reference value can be output, more selection space is provided for relevant item-preparation personnel, the relevant item-preparation personnel can conveniently synthesize a plurality of factors to prepare the item to be predicted, and the item-preparation risk is reduced.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure. It will be apparent to those of ordinary skill in the art that the drawings in the following description are merely examples of the disclosure and that other drawings may be derived from them without undue effort.
FIG. 1 shows a flow diagram of a data prediction method in an embodiment of the present disclosure;
FIG. 2 is a flow chart of training a data prediction model based on a target class transaction data set in an embodiment of the disclosure;
FIG. 3 illustrates a flow diagram for determining an order of a machine learning model to be trained from a predetermined data range in an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of a fitted curve of a multi-layer Bayesian model for transaction data prediction results of a certain SKU in a certain region in an embodiment of the present disclosure;
fig. 5 illustrates a schematic structure of a data prediction apparatus according to an exemplary embodiment of the present disclosure;
Fig. 6 illustrates a schematic structure of an electronic device in an exemplary embodiment of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the present disclosure. One skilled in the relevant art will recognize, however, that the aspects of the disclosure may be practiced without one or more of the specific details, or with other methods, components, devices, steps, etc. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
The terms "a," "an," "the," and "said" are used in this specification to denote the presence of one or more elements/components/etc.; the terms "comprising" and "having" are intended to be inclusive and mean that there may be additional elements/components/etc. in addition to the listed elements/components/etc.; the terms "first" and "second" and the like are used merely as labels, and are not intended to limit the number of their objects.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus a repetitive description thereof will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities.
In the related art, the future transaction data of a certain area is generally predicted according to the historical transaction data of each SKU (Stock keeping Unit, i.e., units of stock in and out metering, which may be in units of pieces, boxes, trays, etc.) in the area, and thus, the following defects exist:
firstly, the transaction data prediction result of each SKU in a single area is only influenced by historical transaction data in the area, and whether the prediction result is abnormal cannot be reasonably judged;
secondly, aiming at a new SKU in a certain area, the data sample is insufficient, so that reasonable prediction cannot be performed on the data sample, and the reference between the areas cannot be used;
thirdly, the prediction result output in the related art is a determined value, which is unfavorable for formulating a replenishment strategy according to the output result.
In the embodiments of the present disclosure, a data prediction method is provided first, which overcomes, at least to some extent, the defect in the related art that when a certain item is sold for the first time in a new area, transaction data cannot be predicted.
Fig. 1 shows a flow diagram of a data prediction method in an embodiment of the present disclosure, and an execution subject of the data prediction method may be a server that predicts data.
Referring to fig. 1, a data prediction method according to one embodiment of the present disclosure includes the steps of:
step S110, a plurality of transaction data sets corresponding to a plurality of article types are obtained, and each transaction data set comprises a plurality of transaction data of the article type in different transaction areas and different time periods;
step S120, acquiring a dispersion index of a plurality of transaction data contained in each transaction data set, and acquiring accumulated values of a plurality of transaction data contained in each transaction data set;
step S130, determining the object class with the dispersion index larger than the preset dispersion and the accumulated value smaller than the preset threshold value as the target class;
and step S140, training to obtain a data prediction model based on the transaction data set corresponding to the target class, and obtaining a transaction data prediction result of the class to be predicted in a future period by using the data prediction model.
In the technical solution provided in the embodiment shown in fig. 1, on one hand, a plurality of transaction data sets corresponding to a plurality of article types are obtained, and accumulated values of a plurality of transaction data included in each transaction data set are obtained; the object class with the dispersion index larger than the preset dispersion and the accumulated value smaller than the preset threshold value is determined as the object class, and the object class with uneven transaction data distribution and smaller transaction data quantity in different transaction areas can be screened out, so that when the object class to be predicted is sold for the first time in a new area, the transaction data of the object class can be predicted according to the transaction data of the object class, and the problem that in the related art, when a certain class is sold for the first time in the new area, the transaction data cannot be predicted is solved. On the other hand, a data prediction model is obtained based on the training of the transaction data set corresponding to the target item, and a plurality of transaction data prediction values and corresponding probabilities of the item to be predicted in a future period are obtained by utilizing the data prediction model, so that a prediction result with a more reference value can be output, more selection space is provided for relevant item-preparation personnel, the relevant item-preparation personnel can conveniently synthesize a plurality of factors to prepare the item to be predicted, and the item-preparation risk is reduced.
The specific implementation of each step in fig. 1 is described in detail below:
in step S110, a plurality of transaction data sets corresponding to a plurality of item categories are acquired, each transaction data set including a plurality of transaction data for the item category at different transaction areas, different time periods.
In this step, the categories, i.e. the categories of items, each category representing a consumer's needs, different categories may be distinguished by different SKUs, and the same item corresponds to different SKUs due to different attributes (e.g. specification, material, color, style).
For example, "dishes" can be classified into "Tao Wandie", "porcelain dishes", "glass dishes", "stainless steel dishes", "wooden dishes", etc. according to their different materials, and the objects are classified into different kinds and displayed according to the categories, so that the selection of consumers can be facilitated, and the display efficiency of the objects is improved.
The transaction data set corresponding to each item class may include a plurality of transaction data for the item class at different transaction areas and different time periods.
Wherein the transaction area may be a city where a plurality of warehouses of the item class are located, such as: guangzhou, western, beijing, and the like.
The time period, that is, any time period in units of years, months and days, can be set according to actual conditions, and is not particularly limited in the present disclosure.
The transaction data may include any of the following: the selling frequency (i.e., the number of times the items are delivered), sales volume (i.e., the number of times the items are delivered), clicking volume (i.e., the number of times the items are clicked), collection volume (i.e., the number of times the items are added to the favorites), purchase volume (i.e., the number of times the items are added to the shopping cart), etc., can be set by themselves according to actual conditions, and the disclosure is not particularly limited thereto.
For example, taking transaction data as a selling frequency as an example, a transaction data set corresponding to a certain article class in the disclosure is shown. Referring to table 1, table 1 shows a schematic table of transaction data sets for a certain item class in the present disclosure:
TABLE 1
SKU Transaction area Time period of Frequency of sales
SKU_a Guangzhou style 2019 1374
SKU_a Xi ' an 2019 325
SKU_a Guangzhou style 2020 2644
SKU_a Beijing 2020 3400
SKU_a Beijing 2018 2
SKU_a Chengdu 2019 626
SKU_a Chengdu 2020 1731
SKU_a Shenyang 2019 309
SKU_a Guiyang (Guiyang) 2019 73
Taking the first row of data in Table 1 as an example, SKU_a encodes the SKU for the item class that was sold 1374 times in 2019 in Guangzhou area.
After the plurality of transaction data sets are acquired, step S120 may be performed to acquire a dispersion index of the plurality of transaction data included in each transaction data set, and to acquire an accumulated value of the plurality of transaction data included in each transaction data set.
In this step, still taking the article sku_a as an example, the dispersion index of the plurality of vending frequencies can be obtained, and the accumulated value of the plurality of vending frequencies can be obtained.
The dispersion index may be a range (a difference between a maximum value and a minimum value in a set of data), a variance (used to measure a degree of deviation between a random variable and a mathematical expectation thereof, the larger the variance is, the larger the degree of dispersion of the data is, whereas the smaller the degree of dispersion is), a standard deviation (the degree of dispersion reflecting a data set is, the arithmetic square root of the variance is, the smaller the standard deviation is, the more aggregated the data is, the larger the standard deviation is, the more discrete the data is), or the like, and may be set by itself according to the actual situation, which is not particularly limited in the present disclosure.
For example, taking the dispersion index as an example for describing the standard deviation, the average value corresponding to the selling frequencies of the article sku_a is: (1374+325+2644+3400+2+626+6426+1731+309+73)/10=1691, and further, the standard deviation corresponding to the selling frequencies of the article sku_a may be calculated based on the following formula 1:
wherein N represents the number of the selling frequencies, and x i For each selling frequency, μ represents the average value corresponding to the plurality of selling frequencies.
The above-mentioned accumulated value of the selling frequency may be determined by taking the article category in the above-mentioned table 1 as an example, and the selling frequencies of the article category in the above-mentioned table 1 in a plurality of transaction areas and a plurality of different periods may be added to obtain the above-mentioned accumulated value, that is, 1374+325+2644+3400+2+626+6426+1731+309+73=16910.
After determining the above-mentioned dispersion index and accumulation value, step S130 may be performed to determine, as the target item, an item having a dispersion index greater than a preset dispersion and an accumulation value less than a preset threshold.
In this step, M article classes with a dispersion index smaller than a preset threshold value may be selected from the plurality of article classes according to the dispersion index, where M is an integer greater than 1. Through screening out the great article class of dispersion index, this disclosure can select the non-uniform SKU of sample distribution from multiple article class.
After the M article types are screened, the target article types with the accumulated value smaller than a preset threshold value can be screened from the M article columns according to the accumulated value, so that the article types with relatively small sample size can be screened, and basis is provided for predicting transaction data of new articles (new articles in a certain area).
After the target class is screened, the method may proceed to step S140, training based on the transaction data set corresponding to the target class to obtain a data prediction model, and obtaining a transaction data prediction result of the class to be predicted in a future period by using the data prediction model.
In this step, the order of the machine learning model to be trained may be determined based on the transaction data set corresponding to the target class, and then the machine learning model to be trained may be trained based on the transaction data set of the target class to obtain the data prediction model. The data prediction model is a multi-layer Bayesian model, and the transaction data prediction result comprises a plurality of transaction data prediction values and corresponding probabilities thereof.
Specifically, referring to fig. 2, fig. 2 shows a flow chart of training a data prediction model based on a transaction data set of a target class in an embodiment of the disclosure, including steps S201 to S202:
in step S201, correlation analysis is performed on the transaction data of the target class and the time period, and a correlation analysis result is obtained.
In this step, correlation analysis may be performed on the transaction data and the time period of each transaction area of the target product based on the pair plot of the seaport, so as to determine whether the two satisfy a linear relationship, and thus a correlation analysis result is obtained.
In step S202, the order of the machine learning model to be trained is determined according to the correlation analysis result.
In this step, when the target class satisfies the linear relationship between the transaction data and the time period of each transaction area, it may be determined that the order of the machine learning model to be trained is 1 order.
When the target class satisfies the nonlinear relationship between the transaction data and the time period of each transaction area, the order of the data prediction model may be determined from the predetermined data range, and referring to fig. 3, for example, fig. 3 shows a schematic flow chart of determining the order of the machine learning model to be trained from the predetermined data range in the embodiment of the disclosure, which includes steps S301-S303:
in step S301, a plurality of reference models of different orders are constructed according to a plurality of values included in a predetermined data range.
In this step, the predetermined data range may be 1-5, and further, 1-5 order reference models may be respectively constructed.
In step S302, a plurality of reference models are verified by using a cross-verification algorithm to obtain the accuracy of each reference model.
In this step, the multiple reference models may be verified by using a cross verification algorithm, so as to obtain the precision of the reference model with each order, and the order corresponding to the reference model with the highest precision is determined to be the order of the machine learning model to be trained.
Among them, cross-validation, also called loop validation, is a statistical analysis method used to validate classifier performance, which is also used to analyze the Generalization ability (Generalization) of machine learning algorithms. The basic idea is to group the original data (Dataset) in a certain sense, wherein one part is used as a training Set (Train Set) and the other part is used as a verification Set (Validation Set or Test Set), firstly, the classifier is trained by the training Set, and the training obtained Model (Model) is tested by the verification Set, so that the Model is used as the performance index of the evaluation classifier.
In an alternative embodiment, the cross-validation algorithm may be K-fold cross-validation (K-fold cross-validation), where the initial sample is partitioned into K sub-samples, with one single sub-sample being retained as data for the validation model and the other K-1 samples being used for training. The cross-validation is repeated K times, each sub-sample is validated once, the K results are averaged or other combinations are used to finally obtain a single estimate. The advantage of this method is that training and verification are repeated using randomly generated subsamples at the same time, with each result verification being one time, 10 fold cross-validation being most common.
In an alternative embodiment, the cross-validation algorithm may leave a validation, which means that only one of the base samples is used as validation data, while the remainder is left as training samples. This step continues until each sample is treated as a verification sample. The LOO-CV has two distinct advantages, firstly, almost all samples in each round are used for training the model, thus closest to the distribution of the original samples, so that the evaluation results are reliable, and secondly, no random factors affect the experimental data during the experiment, ensuring that the experiment can be replicated.
In step S303, the order corresponding to the reference model with the highest accuracy is determined as the order of the machine learning model to be trained.
In this step, by taking the example of determining that the order corresponding to the reference model with the highest accuracy is 2 after the cross-validation as an example, the order of the machine learning model to be trained may be determined to be 2.
Further, the machine learning model to be trained may be a multi-layer bayesian model, and the order of determining the machine learning model to be trained is illustrated as 2, and then a multi-layer bayesian model of 2 nd order may be constructed, for example, the definition of the multi-layer bayesian model may refer to the following formula 2:
α c ∈N(μ αα ),β c ∈N(μ ββ ),γ c ∈N(μ γγ ),∈ c Equation 2
Wherein alpha is c 、β c 、t i,c 、γ c 、∈ c All are model parameters to be determined in the model training process, c represents each transaction area, alpha c The values meet a normal distribution, the mean value is equal to mu α Variance is sigma α ;β c The values meet a normal distribution, the mean value is equal to mu β Variance is sigma β ;γ c The values meet a normal distribution, the mean value is equal to mu γ Variance is sigma γ
After determining the order of the machine learning model to be trained, step S203 may be entered to train the machine learning model to be trained based on the transaction data set of the target class, to obtain a data prediction model.
In this step, the training sample (i.e., the transaction data set corresponding to the target class) may be input into a 2-order multi-layer bayesian model for training, where the training process of the 2-order multi-layer bayesian model may include the following steps: the method comprises the steps of a, a posterior distribution training, a parameter checking and a posterior distribution checking, wherein the training is ended until the loss function of the posterior distribution is converged, so as to obtain a data prediction model (namely, the data prediction model is also a multi-layer Bayesian model). The data prediction model may be used to predict transaction data (e.g., sales frequency, volume, etc.) for a category of items in a new area.
After the data prediction model is obtained by training, fig. 4 may be referred to, fig. 4 illustrates a schematic fit curve of the data prediction model for the transaction data prediction result of a certain SKU in a certain area in the embodiment of the present disclosure, referring to fig. 4, the horizontal axis illustrates time (i.e. what day), the vertical axis illustrates transaction amount, the black point illustrates the actual value of the transaction data of the SKU in a certain area, and the curve illustrates the transaction data prediction result output by the multi-layer bayesian model. As can be seen from fig. 4, the prediction result output by the data prediction model in the present disclosure has smaller deviation from the actual value, i.e. the prediction accuracy of the model is higher.
After the data prediction model is obtained, a transaction data set of the to-be-predicted class may be input into the data prediction model, and a transaction data prediction result of the to-be-predicted class in a future period may be obtained according to the output of the data prediction model, where the transaction data prediction result may be a plurality of transaction data prediction values and probabilities corresponding to each transaction data prediction value, for example: predicted a (80%), predicted B (85%), predicted C (70%). Therefore, compared with the scheme of directly outputting a determined predicted value in the prior art, the method and the device can output the predicted result with more reference value, provide more selection space for relevant stock personnel, facilitate the relevant stock personnel to stock the predicted goods by integrating a plurality of factors, reduce the risk of shortage of the goods, and ensure stock accuracy.
After the transaction data prediction result is obtained, current inventory information of the to-be-predicted product can be obtained, and stock information of the to-be-predicted product is generated according to the transaction data prediction result and the inventory information. For example, when the current stock of the to-be-predicted category is 70, and the probability that the predicted transaction amount is 100 is highest can be determined according to the transaction data prediction result, 30 additional products can be prepared for the to-be-predicted category at this time, so as to avoid the problems of lack of goods and the like.
In an alternative embodiment, after determining the target class, an Unpooled model may be further trained by using the transaction data set corresponding to the target class (Pooled refers to a shared concept, and uinocole refers to independent prediction, that is, single bin to single bin prediction), where the definition of the Unpooled model may refer to the following formula 3:
wherein alpha is c 、β c 、t i,c 、γ c 、∈ c All are model parameters which need to be determined in the model training process, i represents different time periods, and Sales i,c Representing the transaction amount of a certain target class in a certain transaction area in a certain period.
Furthermore, the trained unpooled model can be cross-validated to obtain the training error of the unpooled model, and the multi-layer Bayesian model is cross-validated to obtain the training error of the multi-layer Bayesian model, and the training errors of the two models are compared, so that in the subsequent prediction process, a model with better performance (namely, a model with smaller training error) can be selected between the two models to obtain the transaction data prediction result of the class to be predicted.
Based on the above technical solution, in one aspect, the present disclosure obtains an accumulated value of a plurality of transaction data contained in each transaction data set by obtaining a plurality of transaction data sets corresponding to a plurality of article categories; the object class with the dispersion index larger than the preset dispersion and the accumulated value smaller than the preset threshold value is determined as the object class, and the object class with uneven transaction data distribution and smaller transaction data quantity in different transaction areas can be screened out, so that when the object class to be predicted is sold for the first time in a new area, the transaction data of the object class can be predicted according to the transaction data of the object class, and the problem that in the related art, when a certain class is sold for the first time in the new area, the transaction data cannot be predicted is solved. On the other hand, a data prediction model is obtained based on the training of the transaction data set corresponding to the target item, and a plurality of transaction data prediction values and corresponding probabilities of the item to be predicted in a future period are obtained by utilizing the data prediction model, so that a prediction result with a more reference value can be output, more selection space is provided for relevant item-preparation personnel, the relevant item-preparation personnel can conveniently synthesize a plurality of factors to prepare the item to be predicted, and the item-preparation risk is reduced.
The present disclosure also provides a data prediction apparatus, and fig. 5 shows a schematic structural diagram of the data prediction apparatus according to an exemplary embodiment of the present disclosure; as shown in fig. 5, the data prediction apparatus 500 may include an acquisition module 510, a category screening module 520, and a data prediction module 530. Wherein:
an obtaining module 510, configured to obtain a plurality of transaction data sets corresponding to a plurality of article types, where each transaction data set includes a plurality of transaction data of the article types in different transaction areas and different time periods;
a class screening module 520, configured to obtain a dispersion index of a plurality of transaction data included in each transaction data set, and obtain an accumulated value of the plurality of transaction data included in each transaction data set; determining the object class with the dispersion index larger than the preset dispersion and the accumulated value smaller than a preset threshold value as a target class;
the data prediction module 530 is configured to train to obtain a data prediction model based on the transaction data set corresponding to the target class, and obtain a transaction data prediction result of the class to be predicted in a future period by using the data prediction model; the data prediction model is a multi-layer Bayesian model, and the transaction data prediction result comprises a plurality of transaction data prediction values and corresponding probabilities thereof.
In an exemplary embodiment of the present disclosure, category screening module 520 is configured to: according to the dispersion index, M article classes with the dispersion index smaller than a preset threshold value are selected from the plurality of article classes; wherein M is an integer greater than 1; and screening target product classes with accumulated values smaller than a preset threshold value from the M product classes according to the accumulated values.
In an exemplary embodiment of the present disclosure, the data prediction module 530 is configured to:
carrying out correlation analysis on the transaction data of the target product class and the time period to obtain a correlation analysis result; determining the order of a machine learning model to be trained according to the correlation analysis result; and training the machine learning model to be trained based on the transaction data set of the target class to obtain the data prediction model.
In an exemplary embodiment of the present disclosure, the data prediction module 530 is configured to:
if the trade data and the time period meet the linear relation, determining a preset order as the order of the machine learning model to be trained; and if the linear relation between the transaction data and the time period is not satisfied, determining the order of the machine learning model to be trained from a preset data range.
In an exemplary embodiment of the present disclosure, the data prediction module 530 is configured to:
constructing a plurality of reference models with different orders according to a plurality of numerical values contained in the preset data range; verifying the plurality of reference models by using a cross verification algorithm to obtain the precision of each reference model; and determining the order corresponding to the reference model with highest precision as the order of the machine learning model to be trained.
In an exemplary embodiment of the present disclosure, the data prediction module 530 is configured to:
and inputting the transaction data set of the target class into the machine learning model to be trained for training until the loss function value of the machine learning model to be trained is converged, ending the training, and obtaining the data prediction model.
In an exemplary embodiment of the present disclosure, the data prediction module 530 is configured to:
acquiring current inventory information of the to-be-predicted product; and determining the stock information of the to-be-predicted class according to the transaction data prediction result and the inventory information.
The specific details of each module in the above data prediction apparatus are described in detail in the corresponding data prediction method, so that the details are not repeated here.
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit in accordance with embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
Furthermore, although the steps of the methods in the present disclosure are depicted in a particular order in the drawings, this does not require or imply that the steps must be performed in that particular order or that all illustrated steps be performed in order to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform, etc.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, including several instructions to cause a computing device (may be a personal computer, a server, a mobile terminal, or a network device, etc.) to perform the method according to the embodiments of the present disclosure.
The present application also provides a computer-readable storage medium that may be included in the electronic device described in the above embodiments; or may exist alone without being incorporated into the electronic device.
The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable storage medium may transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The computer-readable storage medium carries one or more programs which, when executed by one such electronic device, cause the electronic device to implement the methods described in the embodiments above.
In addition, an electronic device capable of realizing the method is provided in the embodiment of the disclosure.
Those skilled in the art will appreciate that the various aspects of the present disclosure may be implemented as a system, method, or program product. Accordingly, various aspects of the disclosure may be embodied in the following forms, namely: an entirely hardware embodiment, an entirely software embodiment (including firmware, micro-code, etc.) or an embodiment combining hardware and software aspects may be referred to herein as a "circuit," module "or" system.
An electronic device 600 according to such an embodiment of the present disclosure is described below with reference to fig. 6. The electronic device 600 shown in fig. 6 is merely an example and should not be construed to limit the functionality and scope of use of embodiments of the present disclosure in any way.
As shown in fig. 6, the electronic device 600 is in the form of a general purpose computing device. Components of electronic device 600 may include, but are not limited to: the at least one processing unit 610, the at least one memory unit 620, a bus 630 connecting the different system components (including the memory unit 620 and the processing unit 610), and a display unit 640.
Wherein the storage unit stores program code that is executable by the processing unit 610 such that the processing unit 610 performs steps according to various exemplary embodiments of the present disclosure described in the above-described "exemplary methods" section of the present specification. For example, the processing unit 610 may perform the operations as shown in fig. 1: step S110, a plurality of transaction data sets corresponding to a plurality of article types are obtained, and each transaction data set comprises a plurality of transaction data of the article type in different transaction areas and different time periods; step S120, acquiring a dispersion index of a plurality of transaction data contained in each transaction data set, and acquiring accumulated values of the plurality of transaction data contained in each transaction data set; step S130, determining the object class with the dispersion index larger than the preset dispersion and the accumulated value smaller than the preset threshold value as the target class; step S140, training based on a transaction data set corresponding to the target class to obtain a data prediction model, and obtaining a transaction data prediction result of the class to be predicted in a future period by using the data prediction model; the data prediction model is a multi-layer Bayesian model, and the transaction data prediction result comprises a plurality of transaction data prediction values and corresponding probabilities thereof.
The storage unit 620 may include readable media in the form of volatile storage units, such as Random Access Memory (RAM) 6201 and/or cache memory unit 6202, and may further include Read Only Memory (ROM) 6203.
The storage unit 620 may also include a program/utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
Bus 630 may be a local bus representing one or more of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or using any of a variety of bus architectures.
The electronic device 600 may also communicate with one or more external devices 700 (e.g., keyboard, pointing device, bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 600, and/or any device (e.g., router, modem, etc.) that enables the electronic device 600 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 650. Also, electronic device 600 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet, through network adapter 660. As shown, network adapter 660 communicates with other modules of electronic device 600 over bus 630. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 600, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (10)

1. A method of data prediction, comprising:
acquiring a plurality of transaction data sets corresponding to a plurality of article categories, each transaction data set comprising a plurality of transaction data of the article category in different transaction areas and different time periods;
acquiring a dispersion index of a plurality of transaction data contained in each transaction data set, and acquiring an accumulated value of the plurality of transaction data contained in each transaction data set;
determining the object class with the dispersion index larger than the preset dispersion and the accumulated value smaller than a preset threshold value as a target class;
training based on a transaction data set corresponding to the target product class to obtain a data prediction model, and obtaining a transaction data prediction result of the product class to be predicted in a future period by using the data prediction model;
The data prediction model is a multi-layer Bayesian model, and the transaction data prediction result comprises a plurality of transaction data prediction values and corresponding probabilities thereof.
2. The method of claim 1, wherein the determining the item class having the dispersion indicator greater than the predetermined dispersion and the accumulated value less than the predetermined threshold as the target item class comprises:
according to the dispersion index, M article classes with the dispersion index smaller than a preset threshold value are selected from the plurality of article classes; wherein M is an integer greater than 1;
and screening target product classes with accumulated values smaller than a preset threshold value from the M product classes according to the accumulated values.
3. The method of claim 1, wherein training a data prediction model from the transaction dataset of the target class comprises:
carrying out correlation analysis on the transaction data of the target product class and the time period to obtain a correlation analysis result;
determining the order of a machine learning model to be trained according to the correlation analysis result;
and training the machine learning model to be trained based on the transaction data set of the target class to obtain the data prediction model.
4. A method according to claim 3, wherein said determining the order of the machine learning model to be trained based on the correlation analysis results comprises:
if the trade data and the time period meet the linear relation, determining a preset order as the order of the machine learning model to be trained;
and if the linear relation between the transaction data and the time period is not satisfied, determining the order of the machine learning model to be trained from a preset data range.
5. The method of claim 4, wherein determining the order of the machine learning model to be trained from a predetermined range of data comprises:
constructing a plurality of reference models with different orders according to a plurality of numerical values contained in the preset data range;
verifying the plurality of reference models by using a cross verification algorithm to obtain the precision of each reference model;
and determining the order corresponding to the reference model with highest precision as the order of the machine learning model to be trained.
6. A method according to claim 3, wherein the training of the data prediction model based on the transaction data set of the target class comprises:
And inputting the transaction data set of the target class into the machine learning model to be trained for training until the loss function value of the machine learning model to be trained is converged, ending the training, and obtaining the data prediction model.
7. The method according to any one of claims 1 to 6, wherein after obtaining a transaction data prediction result for a class to be predicted, the method further comprises:
acquiring current inventory information of the to-be-predicted product;
and determining the stock information of the to-be-predicted class according to the transaction data prediction result and the inventory information.
8. A data prediction apparatus, comprising:
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring a plurality of transaction data sets corresponding to a plurality of article types, and each transaction data set comprises a plurality of transaction data of the article types in different transaction areas and different time periods;
the class screening module is used for acquiring the dispersion index of the transaction data contained in each transaction data set and acquiring the accumulated value of the transaction data contained in each transaction data set; determining the object class with the dispersion index larger than the preset dispersion and the accumulated value smaller than a preset threshold value as a target class;
The data prediction module is used for training based on the transaction data set corresponding to the target class to obtain a data prediction model, and obtaining a transaction data prediction result of the class to be predicted in a future period by utilizing the data prediction model; the data prediction model is a multi-layer Bayesian model, and the transaction data prediction result comprises a plurality of transaction data prediction values and corresponding probabilities thereof.
9. A computer storage medium having stored thereon a computer program, which when executed by a processor implements the data prediction method of any of claims 1 to 7.
10. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the data prediction method of any one of claims 1 to 7 via execution of the executable instructions.
CN202210540652.9A 2022-05-17 2022-05-17 Data prediction method and device, computer storage medium and electronic equipment Pending CN117131965A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210540652.9A CN117131965A (en) 2022-05-17 2022-05-17 Data prediction method and device, computer storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210540652.9A CN117131965A (en) 2022-05-17 2022-05-17 Data prediction method and device, computer storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN117131965A true CN117131965A (en) 2023-11-28

Family

ID=88856885

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210540652.9A Pending CN117131965A (en) 2022-05-17 2022-05-17 Data prediction method and device, computer storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN117131965A (en)

Similar Documents

Publication Publication Date Title
US8346516B2 (en) Predictive modeling
US20210103858A1 (en) Method and system for model auto-selection using an ensemble of machine learning models
US20150186907A1 (en) Data mining
US20100082469A1 (en) Constrained Optimized Binning For Scorecards
CN113837596B (en) Fault determination method and device, electronic equipment and storage medium
CN105761000A (en) Transaction data processing and risk early warning system and method
CN112215546A (en) Object page generation method, device, equipment and storage medium
CN111861605A (en) Business object recommendation method
CN114170002A (en) Method and device for predicting access frequency
CN114663015A (en) Replenishment method and device
CN114202256A (en) Architecture upgrading early warning method and device, intelligent terminal and readable storage medium
CN109829763A (en) Consuming capacity appraisal procedure and device, electronic equipment, storage medium
CN117575804A (en) Cargo asset risk analysis method, system and medium
US20210304243A1 (en) Optimization of markdown schedules for clearance items at physical retail stores
CN113822693A (en) Method, device, equipment and storage medium for generating user purchasing power evaluation value
CN112651632A (en) Information analysis processing method and device based on marketing data
CN109800933B (en) Risk assessment method and device, storage medium and electronic equipment
CN116029794A (en) Commodity price determining method, commodity price determining device, electronic equipment and storage medium
CN117131965A (en) Data prediction method and device, computer storage medium and electronic equipment
KR101409273B1 (en) Method and apparatus for calculating to measure influential power of users
CN115062687A (en) Enterprise credit monitoring method, device, equipment and storage medium
CN115271866A (en) Product recommendation method and device, electronic equipment and readable storage medium
CN113837843A (en) Product recommendation method, device, medium and electronic equipment
CN110084541B (en) Method and apparatus for predicting supplier delivery duration
Even et al. Understanding Impartial Versus Utility-Driven Quality Assessment In Large Datasets.

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination