Stock limit configuration method and device based on random forest, equipment and medium
Through the inventory quota configuration method based on random forests, the inventory quota of loading and maintenance workers is dynamically adjusted, which solves the problem of inability to adapt to the differences in installation and maintenance workers and business changes in the existing technology, and achieves efficient utilization of inventory resources and user experience improvement.
Patent Information
- Application Number
- CN202410936742.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2024-12-13
AI Technical Summary
The existing inventory quota configuration plan cannot adapt to the differences in work needs and conditions between installation and maintenance workers, which makes the configuration process time-consuming and personalized management impossible, making it difficult to quickly adapt to changes in business demands, resulting in wasted resources or insufficient supply.
The inventory quota configuration method based on random forest is adopted, and data preprocessing and feature selection is performed by obtaining the installation and maintenance attribute information, an inventory quota prediction model is constructed, and the inventory quota is dynamically adjusted to meet the installation and maintenance business needs, and personalized configuration is realized.
It improves the utilization rate and user experience of inventory resources, can quickly respond to changes in installation and maintenance business needs, and reduce resource waste and insufficient supply.
Smart Images

Figure CN119130315A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to, but is not limited to, the field of computer technology, and in particular to a method, device, equipment, and medium for inventory quota configuration based on random forest. Background Art
[0002] The inventory quota configuration system is used to allocate quotas for various materials and tools required during equipment installation and maintenance according to the work types and maintenance business requirements of different installers. In the existing inventory quota configuration scheme, the system administrator is usually required to manually configure the inventory quota for each installer. This unified configuration method fails to take into account the differences in work requirements and conditions between installers, resulting in the inability of the unified inventory quota configuration to adapt to the specific needs and working conditions of different installers, which makes the configuration process time-consuming and unable to achieve personalized management; furthermore, as the maintenance business requirements change, the existing technical solutions are difficult to quickly adapt to changes in business requirements and new inventory quota configuration requirements, and cannot adjust the inventory quota in time according to the actual usage of the installers or market changes, or cannot dynamically adjust the inventory quota according to historical usage, resulting in resource waste or insufficient supply. Summary of the invention
[0003] The embodiments of the present application provide a method, apparatus, device, and medium for inventory quota configuration based on random forest, which takes into account the personalized needs of inventory quota allocation objects and installation and maintenance business needs, realizes dynamic adjustment of inventory quotas, thereby optimizing the utilization of inventory resources and improving the user experience of the inventory quota configuration system.
[0004] In a first aspect, an embodiment of the present application provides a method for configuring inventory quotas based on random forests, which is applied to an inventory quota configuration system. The method includes:
[0005] Acquire multiple pieces of first installation and maintenance worker attribute information, perform data preprocessing on each piece of the first installation and maintenance worker attribute information, and obtain multiple pieces of first information, wherein the first installation and maintenance worker attribute information includes work address, historical violation records, and historical inventory quota information;
[0006] Extracting target feature information from each of the first information based on a preset feature selection rule, and generating each of the second information based on the target feature information, wherein the correlation between the target feature information and the inventory amount and the inventory demand is greater than a preset correlation threshold;
[0007] Dividing all the second information by a cross-validation method to obtain a training set and a test set;
[0008] The preset random forest model is trained and optimized according to the training set and the test set to obtain a first target inventory quota prediction model;
[0009] Inputting the second installer attribute information to be detected into the first target inventory quota prediction model to obtain a first inventory quota value, determining an installer ID corresponding to the second installer attribute information, and configuring the first inventory quota value for the installer ID;
[0010] acquiring new second installer attribute information corresponding to the installer identifier based on the first time period, and inputting the new second installer attribute information into the first target inventory quota prediction model to obtain a second inventory quota value;
[0011] A quota adjustment value is calculated based on the second inventory quota value and the first inventory quota value, a third inventory quota value is determined based on the quota adjustment value and the second inventory quota value, and the third inventory quota value is configured to the installer ID, wherein the third inventory quota value is the inventory quota allocation value for the installer ID in the next period.
[0012] In some embodiments, the data preprocessing is performed on each of the first installation and maintenance worker attribute information to obtain a plurality of first information, including:
[0013] Determine missing values from each of the first installation and maintenance worker attribute information, delete or interpolate the missing values, and obtain each intermediate information;
[0014] Outlier deletion and data normalization are performed on each of the intermediate information in turn to obtain each of the first information.
[0015] In some embodiments, the random forest model includes a plurality of decision trees, and the preset random forest model is trained and optimized according to the training set and the test set, respectively, to obtain a first target inventory quota prediction model, including:
[0016] Collecting multiple data subsets from the training set by a preset self-service sampling method;
[0017] Constructing each of the decision trees based on each of the data subsets, and calculating the Gini impurity based on each of the data subsets;
[0018] Determine a target split point from the decision tree based on the Gini impurity, and split the corresponding decision tree at each target split point;
[0019] All the segmented decision trees are combined into a first intermediate model;
[0020] Calculating a model performance evaluation result corresponding to the first intermediate model using the test set and a preset model performance evaluation algorithm;
[0021] Calculate the contribution of each of the data features to the first intermediate model in predicting the inventory amount by using a preset feature importance evaluation algorithm and the data features corresponding to each of the decision trees;
[0022] Based on the model performance evaluation result and the contribution, the model parameters of the first intermediate model are adjusted to obtain the first target inventory amount prediction model, wherein the model parameters include the number of decision trees, the depth of each decision tree, and the number of data features.
[0023] In some embodiments, the quota adjustment value is calculated based on the second inventory quota value and the first inventory quota value, and is obtained according to the following formula:
[0024]
[0025] Wherein, α is an adjustable coefficient, the value range of α is (0,1), ΔQ is the amount adjustment value, is the first inventory limit value, Q used The second inventory limit value.
[0026] In some embodiments, the first target inventory quota prediction model includes a plurality of decision trees, and the step of inputting the second installation and maintenance worker attribute information to be detected into the first target inventory quota prediction model to obtain the first inventory quota value includes:
[0027] Each of the decision trees performs regression analysis on the second installation and maintenance worker attribute information to obtain each intermediate inventory quota value;
[0028] Calculate the average of all the intermediate inventory limit values to obtain the first inventory limit value.
[0029] In some embodiments, the method further comprises:
[0030] Acquire the historical violation record and the historical inventory quota information corresponding to the installer identification based on a second time period;
[0031] Calculating a risk score value based on the historical violation records and the historical inventory quota information;
[0032] The current inventory limit value of the installer identification is adjusted based on the risk score value and a preset risk score threshold.
[0033] In some embodiments, there are multiple installer identifications, and the method further includes:
[0034] Inputting the historical inventory quota information corresponding to each of the installer and maintenance worker identifiers acquired based on the second time period into the first target inventory quota prediction model;
[0035] The first target inventory quota prediction model is trained based on all of the historical inventory quota information to obtain a second target inventory quota prediction model.
[0036] In a second aspect, an embodiment of the present application provides a control device, comprising at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions that can be executed by the at least one control processor, and the instructions are executed by the at least one control processor so that the at least one control processor can execute the random forest-based inventory limit configuration method as described in the first aspect.
[0037] In a third aspect, an embodiment of the present application further provides an electronic device, comprising the control device of the second aspect.
[0038] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the random forest-based inventory quota configuration method as described in the first aspect.
[0039] The embodiment of the present application provides a method, apparatus, device, and medium for configuring inventory quotas based on random forests, the method comprising: obtaining multiple first installation and maintenance worker attribute information, performing data preprocessing on each of the first installation and maintenance worker attribute information to obtain multiple first information, wherein the first installation and maintenance worker attribute information includes work address, historical violation record, and historical inventory quota information; extracting target feature information from each of the first information based on a preset feature selection rule, and generating each second information based on the target feature information, wherein the correlation between the target feature information and the inventory quota and the inventory demand is greater than a preset correlation threshold; dividing all the second information using a cross-validation method to obtain a training set and a test set; training and model optimization of a preset random forest model according to the training set and the test set, respectively, to obtain a first target inventory quota. Inventory quota prediction model; input the second installer attribute information to be detected into the first target inventory quota prediction model to obtain the first inventory quota value, determine the installer ID corresponding to the second installer attribute information, and configure the first inventory quota value for the installer ID; obtain the new second installer attribute information corresponding to the installer ID based on the first time period, input the new second installer attribute information into the first target inventory quota prediction model to obtain the second inventory quota value; calculate the quota adjustment value based on the second inventory quota value and the first inventory quota value, determine the third inventory quota value based on the quota adjustment value and the second inventory quota value, and configure the third inventory quota value to the installer ID, wherein the third inventory quota value is the inventory quota allocation value for the installer ID in the next period. According to the solution provided in the embodiment of the present application, inventory quotas are automatically allocated to each installer ID through the random forest model and the installer attribute information, and the inventory quotas are dynamically adjusted based on the installation and maintenance business needs, so as to optimize the utilization of inventory resources and improve the user experience of the inventory quota configuration system. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 It is a flowchart of the steps of a random forest-based inventory quota configuration method provided by an embodiment of the present application;
[0041] Figure 2 It is a structural diagram of a control device provided in another embodiment of the present application. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0043] It is understood that although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims or the above drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0044] The inventory quota configuration system is used to allocate quotas for various materials and tools required during equipment installation and maintenance according to the work types and maintenance business requirements of different installers. In the existing inventory quota configuration scheme, the system administrator is usually required to manually configure the inventory quota for each installer. This unified configuration method fails to take into account the differences in work requirements and conditions between installers, resulting in the inability of the unified inventory quota configuration to adapt to the specific needs and working conditions of different installers, which makes the configuration process time-consuming and unable to achieve personalized management; furthermore, as the maintenance business requirements change, the existing technical solutions are difficult to quickly adapt to changes in business requirements and new inventory quota configuration requirements, and cannot adjust the inventory quota in time according to the actual usage of the installers or market changes, or cannot dynamically adjust the inventory quota according to historical usage, resulting in resource waste or insufficient supply.
[0045] To solve the above-mentioned problems, the embodiments of the present application provide a method, device, equipment, and medium for inventory quota configuration based on random forests, and the method includes: obtaining multiple first installer attribute information, performing data preprocessing on each of the first installer attribute information, and obtaining multiple first information, wherein the first installer attribute information includes work address, historical violation record, and historical inventory quota information; extracting target feature information from each of the first information based on preset feature selection rules, and generating each second information based on the target feature information, wherein the correlation between the target feature information and the inventory quota and inventory demand is greater than a preset correlation threshold; dividing all the second information by a cross-validation method to obtain a training set and a test set; training and model optimization are performed on a preset random forest model according to the training set and the test set, respectively, to obtain The first target inventory quota prediction model; input the second installer attribute information to be detected into the first target inventory quota prediction model to obtain the first inventory quota value, determine the installer ID corresponding to the second installer attribute information, and configure the first inventory quota value for the installer ID; based on the first time period, obtain the new second installer attribute information corresponding to the installer ID, input the new second installer attribute information into the first target inventory quota prediction model to obtain the second inventory quota value; calculate the quota adjustment value based on the second inventory quota value and the first inventory quota value, determine the third inventory quota value based on the quota adjustment value and the second inventory quota value, and configure the third inventory quota value to the installer ID, wherein the third inventory quota value is the inventory quota allocation value for the installer ID in the next period. According to the solution provided in the embodiment of the present application, inventory quotas are automatically allocated to each installer ID through a random forest model and installer attribute information, and the inventory quota is dynamically adjusted based on the installation and maintenance business needs, so as to optimize the utilization of inventory resources and improve the user experience of the inventory quota configuration system.
[0046] The embodiments of the present application are further described below in conjunction with the accompanying drawings.
[0047] refer to Figure 1 , Figure 1 The following is a flowchart of a method for configuring inventory quotas based on random forests provided by an embodiment of the present application. The embodiment of the present application provides a method for configuring inventory quotas based on random forests, which includes but is not limited to the following steps:
[0048] Step S10, obtaining multiple first installation and maintenance worker attribute information, performing data preprocessing on each first installation and maintenance worker attribute information to obtain multiple first information, wherein the first installation and maintenance worker attribute information includes work address, historical violation records and historical inventory quota information;
[0049] Step S20, extracting target feature information from each first information based on a preset feature selection rule, and generating each second information based on the target feature information, wherein the correlation between the target feature information and the inventory amount and the inventory demand is greater than a preset correlation threshold;
[0050] Step S30, using a cross-validation method to divide all the second information to obtain a training set and a test set;
[0051] Step S40, training and optimizing the preset random forest model according to the training set and the test set, respectively, to obtain a first target inventory quota prediction model;
[0052] Step S50, inputting the second installer attribute information to be detected into the first target inventory quota prediction model to obtain the first inventory quota value, determining the installer ID corresponding to the second installer attribute information, and configuring the first inventory quota value for the installer ID;
[0053] Step S60, obtaining new second installer attribute information corresponding to the installer identifier based on the first time period, inputting the new second installer attribute information into the first target inventory quota prediction model, and obtaining a second inventory quota value;
[0054] Step S70, calculate the quota adjustment value based on the second inventory quota value and the first inventory quota value, determine the third inventory quota value based on the quota adjustment value and the second inventory quota value, and configure the third inventory quota value to the installer and maintenance worker ID, wherein the third inventory quota value is the inventory quota allocation value for the installer and maintenance worker ID in the next period.
[0055] It can be understood that since the inventory quota configuration system of this embodiment is used to allocate quotas for various materials and tools required in the equipment installation and maintenance process according to the work types and installation and maintenance business needs of different installers, it is possible to obtain data such as work address characteristics related to the installers and maintenance task processes, different installers' needs for inventory quotas associated with maintenance tasks, quota usage, and historical violation records of installers' access to inventory quotas (i.e., first installer attribute information), so as to comprehensively determine the key factors affecting the inventory allocation quota from multiple dimensions, thereby providing effective data support for automatically allocating appropriate inventory quotas to different installer identifiers.
[0056] It should be noted that the embodiment of the present application does not limit the specific method of data preprocessing for the first installer attribute information. It can be to determine the missing values from each first installer attribute information, delete or interpolate the missing values to obtain each intermediate information, and then delete the outliers and normalize the data for each intermediate information in turn to obtain each first information. The outliers in this embodiment are outliers caused by information input errors or system failures. The normalization process specifically scales all numerical features corresponding to the information after the outlier deletion process to the [0,1] interval or performs Z-score standardization to eliminate the influence of different dimensions, so that when it is subsequently input into the random forest model training, it can ensure that the random forest model can treat each numerical feature fairly. It can be understood that the data preprocessing of the acquired first installer attribute information is mainly to remove irrelevant information in the first installer attribute information, restore useful real information, enhance the detectability of relevant information and simplify data to the maximum extent, thereby improving the reliability of the subsequent random forest model training effect.
[0057] It should be noted that the preset feature selection rules of this embodiment can be a univariate statistical test method, a chi-square verification method, a model correlation analysis method or a recursive feature elimination method, etc., and no further restrictions are made here. This embodiment uses a chi-square test to evaluate the correlation between each information feature in the first installer attribute information and the inventory quota and inventory demand, and selects information features that are strongly correlated with the inventory quota and inventory demand based on a preset correlation threshold, that is, information features that have a significant impact on the inventory quota allocation generate the second information, which can effectively improve the accuracy of the quota value prediction of the subsequent model.
[0058] It should be noted that the specific value of the correlation threshold of this embodiment is determined by those skilled in the art according to actual conditions and is not limited here.
[0059] It can be understood that this embodiment uses a cross-validation method to divide all the second information to obtain a training set and a test set. Specifically, all the second information is divided into multiple data sets, and different data sets are randomly extracted each time as test sets, and the remaining data sets are used as training sets to ensure the stability and generalization ability of the first target inventory amount prediction model obtained through training.
[0060] It can be understood that this embodiment obtains multiple first installer attribute information, performs data preprocessing on each of the first installer attribute information, and obtains multiple first information, wherein the first installer attribute information includes work address, historical violation records and historical inventory quota information; extracts target feature information from each of the first information based on preset feature selection rules, and generates each second information based on the target feature information, wherein the correlation between the target feature information and the inventory quota and inventory demand is greater than a preset correlation threshold, and the correlation threshold of this embodiment is a boundary value for judging whether the candidate feature in the first information is strongly correlated with the inventory quota and inventory demand, and the candidate feature information greater than the preset correlation threshold is determined as the target feature information, and the target feature information is strongly correlated with the inventory quota and inventory demand; divides all the second information by a cross-validation method to obtain a training set and a test set; according to the training set The preset random forest model is trained and optimized respectively with the test set to obtain a first target inventory quota prediction model; the second installer attribute information to be detected is input into the first target inventory quota prediction model to obtain a first inventory quota value, the installer ID corresponding to the second installer attribute information is determined, and the first inventory quota value is configured for the installer ID; based on a first time period, new second installer attribute information corresponding to the installer ID is acquired, and the new second installer attribute information is input into the first target inventory quota prediction model to obtain a second inventory quota value; a quota adjustment value is calculated based on the second inventory quota value and the first inventory quota value, a third inventory quota value is determined based on the quota adjustment value and the second inventory quota value, and the third inventory quota value is configured to the installer ID, wherein the third inventory quota value is the inventory quota allocation value for the installer ID in the next period. According to the actual usage of the installers and maintenance workers and the model prediction value, the system can automatically calculate the quota adjustment value and apply it to the quota allocation of the next cycle. This dynamic adjustment mechanism enables the system to adapt to the changing needs of installers and maintenance workers and optimize resource allocation. It should be noted that the step of calculating the quota adjustment value based on the second inventory quota value and the first inventory quota value in this embodiment is obtained according to the following formula:
[0061]
[0062] Wherein, α is an adjustable coefficient, the value range of α is (0,1), ΔQ is the amount adjustment value, is the first inventory limit value, Q used The second inventory limit value.
[0063] In this way, the random forest model and the installer's attribute information can be used to automatically allocate inventory quotas to each installer ID, and new installation and maintenance business needs can be periodically determined. The inventory quotas of the previous period and the installer's attribute information corresponding to the corresponding installer ID can be combined to dynamically adjust the inventory quotas, so as to allocate accurate and appropriate inventory quota values to the target objects corresponding to each installer ID, optimize the utilization of inventory resources, and improve the user experience of the inventory quota configuration system.
[0064] In some embodiments, the random forest model includes a plurality of decision trees, Figure 1 Step S40 includes but is not limited to the following steps:
[0065] Step S41, collecting multiple data subsets from the training set by a preset self-service sampling method;
[0066] Step S42, constructing each decision tree based on each data subset, and calculating the Gini impurity based on each data subset;
[0067] Step S43, determining a target split point from the decision tree based on the Gini impurity, and splitting the corresponding decision tree at each target split point;
[0068] Step S44, forming a first intermediate model from all the segmented decision trees;
[0069] Step S45, using the test set and a preset model performance evaluation algorithm to calculate a model performance evaluation result corresponding to the first intermediate model;
[0070] Step S46, using a preset feature importance evaluation algorithm and data features corresponding to each decision tree, calculating the contribution of each data feature to the first intermediate model in predicting the inventory amount;
[0071] Step S47, based on the model performance evaluation result and contribution, adjust the model parameters of the first intermediate model to obtain the first target inventory limit prediction model, wherein the model parameters include the number of decision trees, the depth of each decision tree, and the number of data features.
[0072] It is understandable that the training process of the random forest model involves building multiple decision trees, each of which is trained on samples randomly selected from the entire training set. In the process of building each decision tree, the optimal split point is found by randomly selecting a feature subset, thereby reducing the risk of overfitting and improving the diversity of the model. In this embodiment, the preset random forest model is trained and optimized according to the training set and the test set, and the specific steps for obtaining the first target inventory quota prediction model are as follows: multiple data subsets are collected from the training set by a preset self-service sampling method, and each decision tree is constructed based on each data subset. The Gini impurity is calculated based on each data subset, and the calculation of the Gini impurity is implemented according to the following formula:
[0073]
[0074] Among them, Gini(I) is the Gini impurity, p j is the proportion of the jth category in the training set l, and m is the number of categories. Based on the Gini impurity, the target split point is determined from the decision tree, and the corresponding decision tree is split at each target split point; all the split decision trees form the first intermediate model; the model performance evaluation result corresponding to the first intermediate model is calculated using the test set and the preset model performance evaluation algorithm; the contribution of each data feature to the first intermediate model in predicting the inventory amount is calculated using the preset feature importance evaluation algorithm and the data features corresponding to each decision tree. The contribution is obtained according to the following formula:
[0075]
[0076] Among them, I f is the contribution, I f,t is the average impurity reduction of feature f in decision tree t, The average impurity of all data features in the decision tree is reduced. Based on the model performance evaluation results and contribution, the model parameters of the first intermediate model are adjusted to obtain the optimized first target inventory quota prediction model, where the model parameters include the number of decision trees, the depth of each decision tree, and the number of data features. It should be noted that this embodiment can systematically explore the parameter space through grid search and cross-validation techniques to find the best parameter combination, and no restrictions are made here.
[0077] In addition, in some embodiments, the first target inventory quota prediction model includes multiple decision trees. Figure 1 In step S50, the second installation and maintenance worker attribute information to be detected is input into the first target inventory quota prediction model to obtain the first inventory quota value, including but not limited to the following steps:
[0078] Step S51, each decision tree performs regression analysis on the attribute information of the second installer and maintenance worker to obtain each intermediate inventory quota value;
[0079] Step S52, calculating the average of all intermediate inventory limit values to obtain a first inventory limit value.
[0080] It can be understood that each decision tree independently performs regression analysis based on the input data features (such as the work address corresponding to the installation and maintenance worker identification, historical violation records, etc.), and each decision tree predicts an intermediate inventory limit value. For regression problems, each leaf node l of each decision tree can be assigned a target value (i.e., the intermediate inventory limit value) The target value is the sub-target value y of all training samples on the leaf node l. i The mean value of the intermediate inventory quota is calculated according to the following formula:
[0081]
[0082] Among them, N l is the number of samples on leaf node l.
[0083] It should be noted that in this embodiment, the average of all intermediate inventory quota values is calculated to obtain the first inventory quota value according to the following formula:
[0084]
[0085] in, is the total number of decision trees, is the best result predicted by the tth decision tree.
[0086] In addition, in some embodiments, the random forest-based inventory quota configuration method provided in the embodiments of the present application also includes but is not limited to the following steps:
[0087] Step S81, obtaining historical violation records and historical inventory quota information corresponding to the installer and maintenance worker identification based on the second time period;
[0088] Step S82, calculating a risk score value based on historical violation records and historical inventory quota information;
[0089] Step S83: adjusting the current inventory limit value of the installer / maintenance worker identification based on the risk score value and a preset risk score threshold.
[0090] It can be understood that when the inventory quota configuration system of this embodiment allocates inventory quota values to different installer identifications, it adjusts the quotas in combination with the risk score value as a reference factor. Specifically, the risk score value is obtained according to the following steps: based on the second time period, the historical violation records and historical inventory quota information corresponding to the installer identification are obtained; based on the historical violation records and historical inventory quota information, the risk score value is calculated; the risk score value comprehensively considers the number and severity of historical violations corresponding to the installer identification, and can ensure that the allocated inventory quota can meet business needs while reducing operational risks. Specifically, the current inventory quota value of the installer identification is adjusted based on the risk score value and the preset risk score threshold. For example, for the installer identification corresponding to the situation where the number of historical violations exceeds the preset number or the severity of the violation is high, the corresponding risk score value is adjusted in real time (the higher the risk score value, the greater the risk); when the risk score value exceeds the preset risk score threshold, the inventory quota value allocated to the corresponding installer identification is reduced.
[0091] It should be noted that the risk score value of this embodiment is obtained according to the following formula:
[0092] R=ω1·N violations +ω2·S severity ;
[0093] Among them, N violations is the number of historical violations, S severity Score the severity of the violation, N violations and S severity They all belong to historical violation records, ω1 and ω2 are weight coefficients, and technicians in this field can adjust the specific values of ω1 and ω2 according to actual conditions.
[0094] In addition, in some embodiments, the random forest-based inventory quota configuration method provided in the embodiments of the present application also includes but is not limited to the following steps:
[0095] Step S91, inputting the historical inventory quota information corresponding to each installer and maintenance worker identification obtained based on the second time period into the first target inventory quota prediction model;
[0096] Step S92: training the first target inventory quota prediction model based on all historical inventory quota information to obtain the second target inventory quota prediction model.
[0097] It should be noted that the embodiment of the present application does not limit the specific selection of the first time period and the second time period, and those skilled in the art can select according to their needs.
[0098] It can be understood that the embodiment of the present application establishes a feedback loop mechanism, that is, the historical inventory quota information corresponding to each installer and maintenance worker identification obtained based on the second time period is input into the first target inventory quota prediction model, and the first target inventory quota prediction model is trained based on all historical inventory quota information to obtain the second target inventory quota prediction model, so that the system model can self-learn and optimize based on real-time application data, so that the model can adapt to new data and new business needs, and improve the accuracy and effectiveness of the prediction.
[0099] like Figure 2 As shown, Figure 2 2 is a structural diagram of a control device provided in an embodiment of the present application. The present invention also provides a control device 200, including:
[0100] The processor 210 may be implemented by a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0101] The memory 220 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 220 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 220, and the processor 210 calls and executes the inventory quota configuration method based on random forest in the embodiment of this application;
[0102] Input / output interface 230, used to implement information input and output;
[0103] Communication interface 240, used to realize communication interaction between the apparatus and other devices, which can be realized by wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.);
[0104] bus 250 , which transmits information between the various components of the device (e.g., processor 210 , memory 220 , input / output interface 230 , and communication interface 240 );
[0105] The processor 210 , the memory 220 , the input / output interface 230 , and the communication interface 240 are connected to each other in communication within the device via the bus 250 .
[0106] In addition, an embodiment of the present application further provides an electronic device, including the control device 200 of the above embodiment.
[0107] In addition, an embodiment of the present application further provides a storage medium, which is a computer-readable storage medium and stores a computer program. When the computer program is executed by a processor, the above-mentioned random forest-based inventory quota configuration method is implemented.
[0108] As a non-transient computer-readable storage medium, the memory can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage devices. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and are implemented to be located in one place, or may also be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.
[0109] It will be appreciated by those skilled in the art that all or some of the steps and systems in the disclosed method above may be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that may be used to store desired information and may be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically include computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0110] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the above-mentioned implementation mode. Technical personnel familiar with the field can also make various equivalent deformations or substitutions under the shared conditions without violating the spirit of the present invention. These equivalent deformations or substitutions are all included in the scope defined by the claims of the present invention.
Claims
1. A method for allocating inventory quotas based on random forests, characterized in that: Applied to the inventory quota configuration system, the method includes: Acquire multiple pieces of first installation and maintenance worker attribute information, perform data preprocessing on each piece of the first installation and maintenance worker attribute information, and obtain multiple pieces of first information, wherein the first installation and maintenance worker attribute information includes work address, historical violation records, and historical inventory quota information; Extracting target feature information from each of the first information based on a preset feature selection rule, and generating each of the second information based on the target feature information, wherein the correlation between the target feature information and the inventory amount and the inventory demand is greater than a preset correlation threshold; Dividing all the second information by a cross-validation method to obtain a training set and a test set; The preset random forest model is trained and optimized according to the training set and the test set to obtain a first target inventory quota prediction model; Inputting the second installer attribute information to be detected into the first target inventory quota prediction model to obtain a first inventory quota value, determining an installer ID corresponding to the second installer attribute information, and configuring the first inventory quota value for the installer ID; acquiring new second installer attribute information corresponding to the installer identifier based on the first time period, and inputting the new second installer attribute information into the first target inventory quota prediction model to obtain a second inventory quota value; A quota adjustment value is calculated based on the second inventory quota value and the first inventory quota value, a third inventory quota value is determined based on the quota adjustment value and the second inventory quota value, and the third inventory quota value is configured to the installer ID, wherein the third inventory quota value is the inventory quota allocation value for the installer ID in the next period.
2. The inventory quota configuration method based on random forest according to claim 1 is characterized in that: The data preprocessing is performed on each of the first installation and maintenance worker attribute information to obtain a plurality of first information, including: Determine missing values from each of the first installation and maintenance worker attribute information, delete or interpolate the missing values, and obtain each intermediate information; Outlier deletion and data normalization are performed on each of the intermediate information in turn to obtain each of the first information.
3. The inventory quota configuration method based on random forest according to claim 1 is characterized in that: The random forest model includes a plurality of decision trees. The preset random forest model is trained and optimized according to the training set and the test set to obtain a first target inventory quota prediction model, including: Collecting multiple data subsets from the training set by a preset self-service sampling method; Constructing each of the decision trees based on each of the data subsets, and calculating the Gini impurity based on each of the data subsets; Determine a target split point from the decision tree based on the Gini impurity, and split the corresponding decision tree at each target split point; All the segmented decision trees are combined into a first intermediate model; Calculating a model performance evaluation result corresponding to the first intermediate model using the test set and a preset model performance evaluation algorithm; Calculate the contribution of each of the data features to the first intermediate model in predicting the inventory amount by using a preset feature importance evaluation algorithm and the data features corresponding to each of the decision trees; Based on the model performance evaluation result and the contribution, the model parameters of the first intermediate model are adjusted to obtain the first target inventory amount prediction model, wherein the model parameters include the number of decision trees, the depth of each decision tree, and the number of data features.
4. The inventory quota configuration method based on random forest according to claim 1 is characterized in that: The quota adjustment value calculated based on the second inventory quota value and the first inventory quota value is obtained according to the following formula: Wherein, α is an adjustable coefficient, the value range of α is (0,1), ΔQ is the amount adjustment value, is the first inventory limit value, Q used The second inventory limit value.
5. The inventory quota configuration method based on random forest according to claim 1 is characterized in that: The first target inventory quota prediction model includes a plurality of decision trees. Inputting the second installation and maintenance worker attribute information to be detected into the first target inventory quota prediction model to obtain the first inventory quota value includes: Each of the decision trees performs regression analysis on the second installation and maintenance worker attribute information to obtain each intermediate inventory quota value; Calculate the average of all the intermediate inventory limit values to obtain the first inventory limit value.
6. The random forest-based inventory quota configuration method according to claim 1, characterized in that: The method further comprises: Acquire the historical violation record and the historical inventory quota information corresponding to the installer identification based on a second time period; Calculating a risk score value based on the historical violation records and the historical inventory quota information; The current inventory limit value of the installer identification is adjusted based on the risk score value and a preset risk score threshold.
7. The random forest-based inventory quota configuration method according to claim 6, characterized in that: There are multiple installer and maintenance worker identifiers, and the method further includes: Inputting the historical inventory quota information corresponding to each of the installer and maintenance worker identifiers acquired based on the second time period into the first target inventory quota prediction model; The first target inventory quota prediction model is trained based on all of the historical inventory quota information to obtain a second target inventory quota prediction model.
8. A control device, characterized in that: It includes at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions that can be executed by the at least one control processor, and the instructions are executed by the at least one control processor so that the at least one control processor can execute the random forest-based inventory limit configuration method as described in any one of claims 1 to 7.
9. An electronic device, characterized in that: Includes the control device as claimed in claim 8.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the random forest-based inventory quota configuration method as described in any one of claims 1 to 7.
Citation Information
Cited By
Special installment credit line adjustment method and device, equipment and storage medium
CN119624630A
