CN116881857A - Product recommendation method, device, equipment and medium - Google Patents
Product recommendation method, device, equipment and medium Download PDFInfo
- Publication number
- CN116881857A CN116881857A CN202310890443.1A CN202310890443A CN116881857A CN 116881857 A CN116881857 A CN 116881857A CN 202310890443 A CN202310890443 A CN 202310890443A CN 116881857 A CN116881857 A CN 116881857A
- Authority
- CN
- China
- Prior art keywords
- product recommendation
- model
- sample
- sample set
- current
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 57
- 238000012937 correction Methods 0.000 claims abstract description 54
- 238000012549 training Methods 0.000 claims abstract description 14
- 238000004590 computer program Methods 0.000 claims description 16
- 238000012417 linear regression Methods 0.000 claims description 13
- 238000003860 storage Methods 0.000 claims description 13
- 238000012545 processing Methods 0.000 claims description 12
- 238000004458 analytical method Methods 0.000 abstract description 12
- 230000000694 effects Effects 0.000 description 12
- 238000005457 optimization Methods 0.000 description 9
- 238000004891 communication Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 4
- 238000012795 verification Methods 0.000 description 4
- 238000009826 distribution Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000004140 cleaning Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 239000011521 glass Substances 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 238000013508 migration Methods 0.000 description 1
- 230000005012 migration Effects 0.000 description 1
- 238000010606 normalization Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000013450 outlier detection Methods 0.000 description 1
- 238000000611 regression analysis Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 230000005477 standard model Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
- 230000003313 weakening effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/27—Regression, e.g. linear or logistic regression
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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/00—Administration; Management
- G06Q10/04—Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Economics (AREA)
- Evolutionary Computation (AREA)
- Bioinformatics & Computational Biology (AREA)
- General Engineering & Computer Science (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Artificial Intelligence (AREA)
- Life Sciences & Earth Sciences (AREA)
- Strategic Management (AREA)
- Evolutionary Biology (AREA)
- Human Resources & Organizations (AREA)
- Game Theory and Decision Science (AREA)
- Development Economics (AREA)
- Entrepreneurship & Innovation (AREA)
- Marketing (AREA)
- Operations Research (AREA)
- Quality & Reliability (AREA)
- Tourism & Hospitality (AREA)
- General Business, Economics & Management (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention discloses a product recommendation method, device, equipment and medium. A product recommendation method comprising: acquiring a regression error threshold; correcting the current product recommendation sample set by adopting a parity alternate regression prediction mode according to the regression error threshold, the current product recommendation sample set and the prediction result of the current product recommendation model to obtain a current product recommendation correction sample set; training a product recommendation model based on the current product recommendation correction sample set, and returning to execute the operation of correcting the current product recommendation sample set to obtain the current product recommendation correction sample set until the iteration ending condition is met, and outputting a model prediction result set; and determining a target product recommendation model according to the model prediction result set, and recommending the product according to the target product recommendation model. The technical scheme of the embodiment of the invention can improve the prediction precision of the product recommendation model and the analysis capability of the data rule and the association relation.
Description
Technical Field
The invention relates to the technical field of model optimization, in particular to a product recommendation method, device, equipment and medium.
Background
At present, when a product recommendation model is used for recommending and predicting a product, the real regression result is often represented poorly due to the fact that the data attribute cannot be well, so that the model prediction effect is poor, the model accuracy cannot be guaranteed, and the existing product recommendation model has poor analysis effect on the data rule and the association relation.
Disclosure of Invention
The invention provides a product recommendation method, device, equipment and medium, which are used for solving the problem that a product recommendation model is poor in prediction effect, data rule and association relation analysis effect.
According to an aspect of the present invention, there is provided a product recommendation method including:
acquiring a regression error threshold;
correcting the current product recommendation sample set by adopting a parity alternate regression prediction mode according to the regression error threshold, the current product recommendation sample set and the prediction result of the current product recommendation model to obtain a current product recommendation correction sample set;
training a product recommendation model based on the current product recommendation correction sample set, returning to execute the operation of correcting the current product recommendation sample set by adopting a parity alternate regression prediction mode according to a regression error threshold, the current product recommendation sample set and a prediction result of the current product recommendation model to obtain an operation of the current product recommendation correction sample set until an iteration ending condition is met, and outputting a model prediction result set;
And determining a target product recommendation model according to the model prediction result set, and recommending the product according to the target product recommendation model.
According to another aspect of the present invention, there is provided a product recommendation apparatus including:
the regression error threshold value acquisition module is used for acquiring a regression error threshold value;
the correction sample set acquisition module is used for correcting the current product recommendation sample set by adopting a parity alternate regression prediction mode according to the regression error threshold, the current product recommendation sample set and the prediction result of the current product recommendation model to obtain the current product recommendation correction sample set;
the model prediction result set output module is used for training the product recommendation model based on the current product recommendation correction sample set, returning and executing the prediction result according to the regression error threshold, the current product recommendation sample set and the current product recommendation model, correcting the current product recommendation sample set by adopting a parity alternate regression prediction mode to obtain the operation of the current product recommendation correction sample set until the iteration end condition is met, and outputting the model prediction result set;
and the product recommendation module is used for determining a target product recommendation model according to the model prediction result set and recommending products according to the target product recommendation model.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the product recommendation method according to any one of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to execute the product recommendation method according to any of the embodiments of the present invention.
According to the technical scheme, a regression error threshold value is obtained, a current product recommendation sample set is corrected according to the regression error threshold value, a current product recommendation sample set and a current product recommendation model prediction result by adopting a parity alternate regression prediction mode, a current product recommendation correction sample set is obtained, a product recommendation model is trained based on the current product recommendation correction sample set, the current product recommendation sample set is corrected according to the regression error threshold value, the current product recommendation sample set and the current product recommendation model prediction result by adopting the parity alternate regression prediction mode, the current product recommendation sample set is obtained until iteration end conditions are met, a model prediction result set is output, a target product recommendation model is determined according to the model prediction result set, and product recommendation is carried out according to the target product recommendation model. In the scheme, the sample set is corrected by referring to the regression error threshold value in a parity alternate regression prediction mode, so that the real regression result can be well represented by the data attribute, the model verification deviation is further reduced, the precision of a product recommendation model is improved, the discovery capability and generalization capability of a data rule can be further expanded by continuously correcting the sample, the problem that the product recommendation model is poor in prediction effect, data rule and association relation analysis effect is solved, the prediction precision of the product recommendation model can be improved, and the analysis capability of the data rule and association relation is improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a product recommendation method according to an embodiment of the present invention;
FIG. 2 is a flowchart of a product recommendation method according to a second embodiment of the present invention;
FIG. 3 is a schematic flow chart of iterative optimization of a product recommendation model according to a second embodiment of the present invention;
fig. 4 is a schematic structural diagram of a product recommendation device according to a third embodiment of the present invention;
fig. 5 shows a schematic diagram of the structure of an electronic device that may be used to implement an embodiment of the invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the term "object" and the like in the description of the present invention and the claims and the above drawings are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1 is a flowchart of a product recommendation method provided in an embodiment of the present invention, where the method may be applied to accurately predict a scenario of a product sales situation, and the method may be performed by a product recommendation device, where the product recommendation device may be implemented in a form of hardware and/or software, and the product recommendation device may be configured in an electronic device. As shown in fig. 1, the method includes:
step 110, obtaining a regression error threshold.
The regression error threshold may be a preset error threshold, and the specific value may be set by itself.
In the embodiment of the invention, the regression error threshold meeting the actual requirement of regression analysis can be obtained.
And 120, correcting the current product recommendation sample set by adopting a parity alternate regression prediction mode according to the regression error threshold, the current product recommendation sample set and the current product recommendation model prediction result to obtain a current product recommendation correction sample set.
The current product recommendation sample set may be a sample set currently input into a product recommendation model for model training optimization. The current product recommendation model prediction result may be a result of a product recommendation model performing prediction analysis on a current input product recommendation sample set. Alternatively, the current product recommendation model predictive results may include, but are not limited to, whether the user purchased, the number of purchases, and the like. The product recommendation model can be any model with a product recommendation function. The parity alternate regression prediction mode can be a mode of optimizing a product recommendation model by using different regression prediction algorithms for odd iterations and even iterations after the product recommendation model completes prediction for the first time. The current product recommendation modification sample set may be a sample set modified from the current product recommendation sample set.
In the embodiment of the invention, the current product recommendation sample set can be input into the product recommendation model to obtain the prediction result of the current product recommendation model, so that the prediction result of the current product recommendation model is compared with the label data in the current product recommendation sample set, and further, samples with comparison errors larger than the regression error threshold in the current product recommendation sample set are subjected to sample correction according to the parity alternate regression prediction mode to obtain the current product recommendation correction sample set.
And 130, training a product recommendation model based on the current product recommendation correction sample set, returning and executing the operation of correcting the current product recommendation sample set by adopting a parity alternate regression prediction mode according to the regression error threshold, the current product recommendation sample set and the prediction result of the current product recommendation model to obtain the current product recommendation correction sample set until the iteration ending condition is met, and outputting the model prediction result set.
The iteration end condition may be a preset condition for ending the product recommendation model iteration. The model prediction result set may be a set of prediction results output by each optimization iteration of the product recommendation model.
In the embodiment of the invention, the product recommendation model can be trained by utilizing the current product recommendation correction sample set to optimize the product recommendation model, the current product recommendation sample set is corrected by adopting a parity alternate regression prediction mode according to the regression error threshold, the current product recommendation sample set and the prediction result of the current product recommendation model, the operation of the current product recommendation correction sample set is obtained, and when the iterative operation of the product recommendation model is determined to meet the iteration ending condition, the model prediction result set is output.
And 140, determining a target product recommendation model according to the model prediction result set, and recommending the product according to the target product recommendation model.
The target product recommendation model may be a model determined according to a product recommendation model that matches the prediction results in the model prediction result set.
In the embodiment of the invention, each product recommendation model matched with the prediction result in the model prediction result set, namely, each product recommendation model subjected to iterative optimization can be determined, and then each determined product recommendation model is combined to obtain a target product recommendation model, so that the product recommendation is performed by utilizing the target product recommendation model and the product data to be analyzed.
Optionally, the accuracy of the prediction result in the model prediction result set may be used as the weight of the corresponding product recommendation model, and the target product recommendation model may be determined in a manner of balancing the weights.
According to the technical scheme, a regression error threshold value is obtained, a current product recommendation sample set is corrected according to the regression error threshold value, a current product recommendation sample set and a current product recommendation model prediction result by adopting a parity alternate regression prediction mode, a current product recommendation correction sample set is obtained, a product recommendation model is trained based on the current product recommendation correction sample set, the current product recommendation sample set is corrected according to the regression error threshold value, the current product recommendation sample set and the current product recommendation model prediction result by adopting the parity alternate regression prediction mode, the current product recommendation sample set is obtained until iteration end conditions are met, a model prediction result set is output, a target product recommendation model is determined according to the model prediction result set, and product recommendation is carried out according to the target product recommendation model. In the scheme, the sample set is corrected by referring to the regression error threshold value in a parity alternate regression prediction mode, so that the real regression result can be well represented by the data attribute, the model verification deviation is further reduced, the precision of a product recommendation model is improved, the discovery capability and generalization capability of a data rule can be further expanded by continuously correcting the sample, the problem that the product recommendation model is poor in prediction effect, data rule and association relation analysis effect is solved, the prediction precision of the product recommendation model can be improved, and the analysis capability of the data rule and association relation is improved.
Example two
Fig. 2 is a flowchart of a product recommendation method according to a second embodiment of the present invention, where the method is implemented based on the foregoing embodiment, and a specific alternative implementation manner of determining a recommendation model of a target product according to a model prediction result set is provided. As shown in fig. 2, the method includes:
step 210, obtaining a regression error threshold.
And 220, correcting the current product recommendation sample set by adopting a parity alternate regression prediction mode according to the regression error threshold, the current product recommendation sample set and the current product recommendation model prediction result to obtain a current product recommendation correction sample set.
In an optional embodiment of the present invention, after correcting the current product recommendation sample set by adopting the parity alternate regression prediction mode, obtaining the current product recommendation correction sample set may further include: setting a hyper-parameter range of a product recommendation model based on a greedy algorithm; and correcting the model super parameters of the product recommendation model based on the super parameter range, the Optuna and the current product recommendation sample set.
The hyper-parameter range may be a parameter selection range of the model hyper-parameter.
In the embodiment of the invention, a known greedy algorithm can be used for determining the hyper-parameter range of the product recommendation model, and further, based on the Optuna (hyper-parameter tuning framework), the model hyper-parameters of the corrected product recommendation model are determined from the hyper-parameter range according to the distribution condition of the current product recommendation sample set.
In an optional embodiment of the present invention, correcting the current product recommendation sample set by adopting a parity alternate regression prediction mode according to the regression error threshold, the current product recommendation sample set and the prediction result of the current product recommendation model to obtain a current product recommendation correction sample set may include: determining the error of each current product recommendation sample based on the current product recommendation sample set and the prediction result of the current product recommendation model, and determining a product recommendation sample to be corrected and a product recommendation sample to be removed according to the regression error threshold and the error of each current product recommendation sample; and removing the product recommended sample to be removed in the current product recommended sample set, and correcting the product recommended sample to be corrected by adopting a parity alternate regression prediction mode to obtain a current product recommended correction sample set.
The error of the current product recommendation sample can be used for representing the error magnitude of the prediction result of the current product recommendation model and the label data in the current product recommendation sample set. The product recommendation sample to be corrected can be the label data in the current product recommendation sample set, and the error between the label data and the prediction result of the current product recommendation model is greater than or equal to the regression error threshold value. The product recommendation sample to be removed can be label data in a current product recommendation sample set, and the error between the label data and a prediction result of a current product recommendation model is smaller than a regression error threshold value.
In the embodiment of the invention, the error magnitude of the label data of each sample in the current product recommendation sample set and the prediction result of the current product recommendation model can be used as the error of each current product recommendation sample, the regression error threshold value is further compared with the error of each current product recommendation sample, the sample corresponding to the current product recommendation sample error which is larger than or equal to the regression error threshold value is used as the product recommendation sample to be corrected, the sample corresponding to the current product recommendation sample error which is smaller than the regression error threshold value is used as the product recommendation sample to be removed, the product recommendation sample to be removed in the current product recommendation sample set is further removed, and the product recommendation sample to be corrected is corrected by adopting the odd-even alternate regression prediction mode, so that the current product recommendation correction sample set is obtained.
In an alternative embodiment of the present invention, the correcting the recommended samples of the product to be corrected by adopting a parity alternate regression prediction mode may include: when the odd-number round model iterates, a linear regression algorithm is adopted to correct a recommended sample of the product to be corrected; and when the even number round of models are iterated, correcting the recommended sample of the product to be corrected by adopting a nonlinear regression algorithm.
The odd-number round of model iteration can be an odd-number round of iteration operation performed on the product recommendation model after the product recommendation model outputs the model prediction result for the first time. The even-number round of model iteration can be an even-number round of iteration operation performed on the product recommendation model after the product recommendation model outputs the model prediction result for the first time.
In the embodiment of the invention, after a product recommendation model outputs a model prediction result for the first time, iterative optimization of the product recommendation model is started, and when an odd-number round model is iterated, a linear regression algorithm is adopted to correct a product recommendation sample to be corrected, so that a corrected sample set (namely, a current product recommendation correction sample set) is used as an input of the product recommendation model when an adjacent even-number round model iterates. And when the even number round of models are iterated, correcting the recommended sample of the product to be corrected by adopting a nonlinear regression algorithm, so that the corrected sample set is used as the input of the recommended model of the product when the odd number round of models are iterated next time.
In an alternative embodiment of the present invention, when the odd-number round model iterates, a linear regression algorithm is adopted to correct a recommended sample of a product to be corrected, which may include: determining each local sample characteristic group of a product recommended sample to be corrected based on a leave-one-out method; according to the linear regression algorithm and each local sample feature group of the recommended sample of the product to be corrected, calculating the prediction features of each current sample, and correcting the recommended sample of the product to be corrected based on the prediction features of each current sample.
The local sample feature set may be a sample feature data set obtained by removing features of a recommended sample of a product to be corrected based on a leave-one-out method. The current sample prediction features may be sample features predicted by a linear regression method according to each local sample feature group of the recommended sample of the product to be corrected.
In the embodiment of the invention, each local sample feature group of each sample in at least one product recommendation sample to be corrected can be determined by a leave-one-out method, and then regression prediction is sequentially performed on each corresponding local sample feature group of the at least one product recommendation sample to be corrected by using a linear regression algorithm to obtain each current sample prediction feature respectively matched with each local sample feature group, so that the corresponding product recommendation sample to be corrected is corrected according to each current sample prediction feature.
And 230, training the product recommendation model based on the current product recommendation correction sample set, returning and executing the operation of correcting the current product recommendation sample set by adopting a parity alternate regression prediction mode according to the regression error threshold, the current product recommendation sample set and the prediction result of the current product recommendation model to obtain the current product recommendation correction sample set until the iteration ending condition is met, and outputting the model prediction result.
In an alternative embodiment of the present invention, the iteration end condition may include: the current iteration times of the model are larger than the preset model iteration times, or the recommended sample errors of the current products are smaller than the regression error threshold.
The preset model iteration times can be the maximum model iteration times set before the product recommendation model is subjected to iteration optimization.
In the embodiment of the invention, before the product recommendation model is iterated, an iteration ending condition can be set, if the current iteration number of the model is greater than the preset model iteration number, the training of the product recommendation model is stopped, or when the error of each current product recommendation sample is less than the regression error threshold, the training of the product recommendation model is stopped.
And 240, carrying out weight balance processing on the product recommendation model of each iteration round according to the model precision data of each iteration round matched with the model prediction result set to obtain a target product recommendation model, and carrying out product recommendation according to the target product recommendation model.
The iteration round model precision data may be the precision of the product recommendation model describing the current iteration.
In the embodiment of the invention, the iterative round model precision data matched with the model prediction result in the model prediction result set can be determined, so that the iterative round model precision data is used as the model weight of the product recommendation model under the corresponding iterative round, the product of the product recommendation model and the matched model weight is further carried out, the weight balance processing of the product recommendation model of each iterative round is completed, the target product recommendation model is obtained, the product data to be analyzed is further input into the target product recommendation model, and the product recommendation is carried out according to the output result of the target product recommendation model.
Fig. 3 is a schematic flow chart of iterative optimization of a product recommendation model according to a second embodiment of the present invention, as shown in fig. 3, including the following steps:
and carrying out data cleaning on a product recommendation sample set which is input to a product recommendation model for the first time, wherein the data cleaning comprises outlier detection, data de-duplication and data interpolation operation, and dirty data and bias distribution data which does not accord with model training are avoided. In order to make the data attribute well represent the target prediction result, the feature engineering operation can be further performed. Specifically, the enumeration type features are quantized according to actual service demands, part of continuous type features are discretized according to the service demands, and normalization processing can be performed for eliminating dimension and reducing errors, so that the magnitude of numerical values is controlled, and the stability of a product recommendation model is improved.
And setting the product recommendation model as a lightweight and parallelized lightGBM tree model, and taking the model as a standard model for product recommendation model iteration. And constructing a super-parameter search space of the LightGBM tree model. And setting a hyper-parameter range corresponding to the LightGBM tree model by adopting a greedy algorithm, and continuously correcting a result value of the hyper-parameter of the model according to the distribution condition of the sample set by using an Optuna framework.
The method comprises the steps of presetting the iteration times of a model and a regression error threshold, storing a product recommendation model prediction result output by each iteration in product recommendation model training, and searching a product recommendation sample to be corrected with overlarge error according to the regression error threshold.
The recommended sample of the product to be corrected is corrected based on a parity alternate regression prediction mode, and the specific method comprises the following steps: after the model outputs the model prediction result for the first time, comparing the model prediction result with a product recommendation sample input to the model for the first time, putting a sample with an error greater than or equal to a regression error threshold value in the product recommendation sample into the product recommendation sample to be corrected, returning to execute the comparison operation of the model prediction result and the product recommendation sample input to the model for the first time after the first iteration, updating the product recommendation sample to be corrected, gradually reducing the number of samples put into the model after correction in each iteration process, gradually weakening the correction force, and avoiding data migration. Specifically, the product to be corrected is corrected by adopting a parity alternate regression prediction method. The odd number round model is processed by adopting a linear regression algorithm during iteration, and the specific method comprises the following steps: when m features exist, one feature is taken as a target variable, the other m-1 features are taken as input features, a local training set is formed, the m times of training are carried out by utilizing a linear regression mode, new m columns of sample prediction features are obtained, the new m columns of sample prediction features are used as new samples to be added into recommended samples of products to be corrected, a nonlinear regression algorithm is adopted when an even number round of models are iterated, the new m columns of sample prediction features are obtained, and the steps are sequentially circulated until the model iterated loop is exited.
And combining the obtained multiple model prediction results, and performing model comprehensive prediction evaluation in the final stage. The specific method comprises the following steps: and setting weight according to the error of the model prediction result of each iteration, and taking the weighted average result as the final prediction result.
According to the technical scheme, a regression error threshold value is obtained, a current product recommendation sample set is corrected according to the regression error threshold value, a current product recommendation sample set and a current product recommendation model prediction result by adopting a parity alternate regression prediction mode, a current product recommendation correction sample set is obtained, a product recommendation model is trained based on the current product recommendation correction sample set, the current product recommendation sample set is corrected according to the regression error threshold value, the current product recommendation sample set and the current product recommendation model prediction result by adopting the parity alternate regression prediction mode, the current product recommendation sample set is obtained until iteration end conditions are met, a model prediction result is output, weight equalization processing is carried out on the product recommendation models of each iteration round according to iteration round model accuracy data matched by the model prediction result set, a target product recommendation model is obtained, and product recommendation is carried out according to the target product recommendation model. In the scheme, the sample set is corrected by referring to the regression error threshold value in a parity alternate regression prediction mode, so that the real regression result can be well represented by the data attribute, the model verification deviation is further reduced, the precision of a product recommendation model is improved, the discovery capability and generalization capability of a data rule can be further expanded by continuously correcting the sample, the problem that the product recommendation model is poor in prediction effect, data rule and association relation analysis effect is solved, the prediction precision of the product recommendation model can be improved, and the analysis capability of the data rule and association relation is improved.
Example III
Fig. 4 is a schematic structural diagram of a product recommendation device according to a third embodiment of the present invention. As shown in fig. 4, the apparatus includes:
a regression error threshold value obtaining module 310, configured to obtain a regression error threshold value;
the corrected sample set obtaining module 320 is configured to correct the current product recommended sample set by adopting a parity alternative regression prediction mode according to the regression error threshold, the current product recommended sample set, and the prediction result of the current product recommended model, so as to obtain a current product recommended corrected sample set;
the model prediction result set output module 330 is configured to train the product recommendation model based on the current product recommendation correction sample set, and return to execute the operation of correcting the current product recommendation sample set by adopting a parity alternate regression prediction mode according to the regression error threshold, the current product recommendation sample set and the prediction result of the current product recommendation model, so as to obtain the current product recommendation correction sample set, until the iteration end condition is met, and output a model prediction result set;
the product recommendation module 340 is configured to determine a target product recommendation model according to the model prediction result set, and perform product recommendation according to the target product recommendation model.
According to the technical scheme, a regression error threshold value is obtained, a current product recommendation sample set is corrected according to the regression error threshold value, a current product recommendation sample set and a current product recommendation model prediction result by adopting a parity alternate regression prediction mode, a current product recommendation correction sample set is obtained, a product recommendation model is trained based on the current product recommendation correction sample set, the current product recommendation sample set is corrected according to the regression error threshold value, the current product recommendation sample set and the current product recommendation model prediction result by adopting the parity alternate regression prediction mode, the current product recommendation sample set is obtained until iteration end conditions are met, a model prediction result set is output, a target product recommendation model is determined according to the model prediction result set, and product recommendation is carried out according to the target product recommendation model. In the scheme, the sample set is corrected by referring to the regression error threshold value in a parity alternate regression prediction mode, so that the real regression result can be well represented by the data attribute, the model verification deviation is further reduced, the precision of a product recommendation model is improved, the discovery capability and generalization capability of a data rule can be further expanded by continuously correcting the sample, the problem that the product recommendation model is poor in prediction effect, data rule and association relation analysis effect is solved, the prediction precision of the product recommendation model can be improved, and the analysis capability of the data rule and association relation is improved.
Optionally, the modified sample set obtaining module 320 includes a to-be-processed sample determining unit and a modified sample set obtaining unit. The sample to be processed determining unit is used for determining the error of each current product recommended sample based on the current product recommended sample set and the prediction result of the current product recommended model, and determining the product recommended sample to be corrected and the product recommended sample to be removed according to the regression error threshold and the error of each current product recommended sample. The correction sample set acquisition unit is used for eliminating the product recommendation samples to be eliminated in the current product recommendation sample set, correcting the product recommendation samples to be corrected by adopting a parity alternate regression prediction mode, and obtaining a current product recommendation correction sample set.
Optionally, the correction sample set obtaining unit includes an odd-number round model correction sample obtaining subunit and an even-number round model correction sample obtaining subunit, where the odd-number round model correction sample obtaining subunit is configured to correct the recommended sample of the product to be corrected by using a linear regression algorithm when the odd-number round model iterates. And the even number round model correction sample acquisition subunit is used for correcting the recommended sample of the product to be corrected by adopting a nonlinear regression algorithm when the even number round model iterates.
Optionally, the odd-number round model correction sample obtaining subunit is specifically configured to determine each local sample feature set of the recommended sample of the product to be corrected based on a leave-one-out method; and calculating the prediction characteristics of each current sample according to the linear regression algorithm and each local sample characteristic group of the recommended sample of the product to be corrected, and correcting the recommended sample of the product to be corrected based on each current sample prediction characteristic.
Optionally, the product recommendation device comprises a model hyper-parameter optimization module, which is used for setting a hyper-parameter range of the product recommendation model based on a greedy algorithm; and correcting the model super parameters of the product recommendation model based on the super parameter range, the super parameter tuning framework Optuna and the current product recommendation sample set.
Optionally, the iteration end condition includes: the current iteration number of the model is larger than the preset model iteration number, or the recommended sample error of each current product is smaller than the regression error threshold.
Optionally, the product recommendation module 340 is specifically configured to perform weight balancing processing on the product recommendation model of each iteration round according to the model precision data of each iteration round matched by the model prediction result set, so as to obtain the target product recommendation model.
The product recommendation device provided by the embodiment of the invention can execute the product recommendation method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example IV
Fig. 5 shows a schematic diagram of the structure of an electronic device that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 5, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as the product recommendation method.
In some embodiments, the product recommendation method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the product recommendation method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the product recommendation method in any other suitable way (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on 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.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.
Claims (10)
1. A method of product recommendation, comprising:
acquiring a regression error threshold;
correcting the current product recommendation sample set by adopting a parity alternate regression prediction mode according to the regression error threshold, the current product recommendation sample set and the current product recommendation model prediction result to obtain a current product recommendation correction sample set;
training a product recommendation model based on the current product recommendation correction sample set, returning to execute the operation of correcting the current product recommendation sample set by adopting a parity alternate regression prediction mode according to the regression error threshold, the current product recommendation sample set and the prediction result of the current product recommendation model to obtain the operation of the current product recommendation correction sample set until the iteration end condition is met, and outputting a model prediction result set;
And determining a target product recommendation model according to the model prediction result set, and recommending products according to the target product recommendation model.
2. The method according to claim 1, wherein the correcting the current product recommendation sample set by using the parity alternate regression prediction method according to the regression error threshold, the current product recommendation sample set and the current product recommendation model prediction result to obtain a current product recommendation correction sample set includes:
determining the error of each current product recommendation sample based on the current product recommendation sample set and the prediction result of the current product recommendation model, and determining a product recommendation sample to be corrected and a product recommendation sample to be removed according to the regression error threshold and each current product recommendation sample error;
and eliminating the product recommended sample to be eliminated in the current product recommended sample set, and correcting the product recommended sample to be corrected by adopting a parity alternate regression prediction mode to obtain a current product recommended correction sample set.
3. The method according to claim 2, wherein the correcting the recommended samples of the product to be corrected by using a parity alternate regression prediction method includes:
When the odd-number round model iterates, correcting the recommended sample of the product to be corrected by adopting a linear regression algorithm;
and when the even number round of models are iterated, correcting the recommended sample of the product to be corrected by adopting a nonlinear regression algorithm.
4. A method according to claim 3, wherein said modifying said recommended sample of the product to be modified using a linear regression algorithm during an odd-numbered round of model iterations comprises:
determining each local sample feature group of the recommended sample of the product to be corrected based on a leave-one-out method;
and calculating the prediction characteristics of each current sample according to the linear regression algorithm and each local sample characteristic group of the recommended sample of the product to be corrected, and correcting the recommended sample of the product to be corrected based on each current sample prediction characteristic.
5. The method according to claim 1, further comprising, after said correcting said current product recommendation sample set by means of parity alternate regression prediction to obtain a current product recommendation correction sample set:
setting a hyper-parameter range of the product recommendation model based on a greedy algorithm;
and correcting the model super parameters of the product recommendation model based on the super parameter range, the super parameter tuning framework Optuna and the current product recommendation sample set.
6. The method of claim 2, wherein the iteration end condition comprises: the current iteration number of the model is larger than the preset model iteration number, or the recommended sample error of each current product is smaller than the regression error threshold.
7. The method of claim 1, wherein determining a target product recommendation model from the set of model predictions comprises:
and carrying out weight equalization processing on the product recommendation model of each iteration round according to the model precision data of each iteration round matched with the model prediction result set to obtain the target product recommendation model.
8. A product recommendation device, comprising:
the regression error threshold value acquisition module is used for acquiring a regression error threshold value;
the correction sample set acquisition module is used for correcting the current product recommendation sample set by adopting a parity alternate regression prediction mode according to the regression error threshold value, the current product recommendation sample set and the prediction result of the current product recommendation model to obtain a current product recommendation correction sample set;
the model prediction result set output module is used for training a product recommendation model based on the current product recommendation correction sample set, returning to execute the operation of correcting the current product recommendation sample set by adopting a parity alternate regression prediction mode according to the regression error threshold, the current product recommendation sample set and the current product recommendation model prediction result, and outputting a model prediction result set until the iteration end condition is met;
And the product recommendation module is used for determining a target product recommendation model according to the model prediction result set and recommending products according to the target product recommendation model.
9. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the product recommendation method of any one of claims 1-7.
10. A computer readable storage medium storing computer instructions for causing a processor to implement the product recommendation method of any one of claims 1-7 when executed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310890443.1A CN116881857A (en) | 2023-07-19 | 2023-07-19 | Product recommendation method, device, equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310890443.1A CN116881857A (en) | 2023-07-19 | 2023-07-19 | Product recommendation method, device, equipment and medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116881857A true CN116881857A (en) | 2023-10-13 |
Family
ID=88264153
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310890443.1A Pending CN116881857A (en) | 2023-07-19 | 2023-07-19 | Product recommendation method, device, equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116881857A (en) |
-
2023
- 2023-07-19 CN CN202310890443.1A patent/CN116881857A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP7304384B2 (en) | Methods, apparatus, electronics, storage media, and computer program products for generating models | |
CN116307215A (en) | Load prediction method, device, equipment and storage medium of power system | |
CN115391160B (en) | Abnormal change detection method, device, equipment and storage medium | |
CN113204614B (en) | Model training method, method for optimizing training data set and device thereof | |
CN112528159B (en) | Feature quality assessment method and device, electronic equipment and storage medium | |
CN112925913A (en) | Method, apparatus, device and computer-readable storage medium for matching data | |
CN114676927B (en) | Risk prediction method and apparatus, electronic device, and computer-readable storage medium | |
CN116228301A (en) | Method, device, equipment and medium for determining target user | |
CN115146997A (en) | Evaluation method and device based on power data, electronic equipment and storage medium | |
CN116881857A (en) | Product recommendation method, device, equipment and medium | |
CN115454261A (en) | Input method candidate word generation method and device, electronic equipment and readable storage medium | |
CN114037060A (en) | Pre-training model generation method and device, electronic equipment and storage medium | |
CN113313049A (en) | Method, device, equipment, storage medium and computer program product for determining hyper-parameters | |
CN114491416B (en) | Processing method and device of characteristic information, electronic equipment and storage medium | |
CN114037058B (en) | Pre-training model generation method and device, electronic equipment and storage medium | |
CN114037057B (en) | Pre-training model generation method and device, electronic equipment and storage medium | |
CN117909717B (en) | Engineering quantity auxiliary acceptance settlement method based on deep learning and data mining | |
CN116933896B (en) | Super-parameter determination and semantic conversion method, device, equipment and medium | |
CN117934137A (en) | Bad asset recovery prediction method, device and equipment based on model fusion | |
CN117635300A (en) | Enterprise financing result prediction method and device and electronic equipment | |
CN115878783A (en) | Text processing method, deep learning model training method and sample generation method | |
CN117575553A (en) | Post matching method, device, equipment and storage medium | |
CN117707899A (en) | Micro-service abnormality detection method, device, equipment and storage medium | |
CN116992150A (en) | Research and development component recommendation method, device, equipment and storage medium | |
CN115329940A (en) | Recommendation method, device and equipment for convolution algorithm and storage medium |
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 |