Data model training method, device, electronic device and readable medium

Through the grouping and virtualization technology of training data, the problems of slow speed and low efficiency of machine learning algorithms in massive sample training are solved, and the effects of quickly finding optimal parameters and efficient training are achieved.

CN110866605BActive Publication Date: 2024-09-20BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD +1
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN201810981379.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-08-27
Publication Date
2024-09-20
Estimated Expiration
2038-08-27

AI Technical Summary

Technical Problem

During the training process of existing machine learning algorithms, the training speed is slow when faced with massive samples, the parameter adjustment is slow, it is difficult to find the optimal parameters in a short time, and the operating efficiency is low in a distributed environment, causing algorithm engineers and software engineers to Encountered data skew and memory overflow problems during engineering implementation.

Method used

By grouping training data according to predetermined rules, multiple grouped data are generated and input into multiple data models for training. The data models run in multiple virtual containers and use virtualization technology and distributed memory computing to automatically adjust parameters to Improve training speed and accuracy.

Benefits of technology

It significantly shortens the algorithm optimization time and delivery time, improves the accuracy and stability of the model, solves the problems of low single-machine operation efficiency and difficulty in engineering implementation, and achieves efficient training in a distributed environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110866605B
    Figure CN110866605B
Patent Text Reader

Abstract

The present application provides a data model training method, device, electronic device and readable medium, the method comprising: grouping training data according to a predetermined rule to generate multiple grouped data; inputting the multiple grouped data into multiple data models for data training, the multiple data models running in multiple virtual containers; obtaining multiple groups of model parameters for multiple data models after data training; and determining multiple first data models respectively through the multiple groups of model parameters. The data model training method, device, electronic device and readable medium of the present application can improve the training speed of the algorithm model when facing a large number of samples, greatly shorten the algorithm optimization time and delivery time, and improve the accuracy and stability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of machine learning, and in particular to a data model training method, device, electronic device and computer-readable medium. Background Art

[0002] Machine learning is the process of using machine learning algorithms to enable machines to learn patterns from a large number of existing data samples, so that when new data samples are input, the machine can achieve intelligent recognition or prediction functions. A large number of studies have shown that the more samples involved in training, the higher the accuracy of the convergence of the machine learning algorithm model. In the development and training process of existing machine learning algorithms, algorithm engineers usually first conduct experiments on a small number of samples, continuously improve the algorithm model, and improve the accuracy of the algorithm to meet business requirements; then software engineers implement the algorithm model and put it online. Since the accuracy of the algorithm on the overall sample cannot be guaranteed, it often takes a long time of online improvement to reach a stable state.

[0003] However, the above training process for the algorithm model has certain defects, as described below:

[0004] (1) Since algorithm engineers conduct experiments on some samples, the algorithm parameters adjusted based on some samples may not be optimal for the overall samples and generally need to be readjusted. However, in a massive overall sample, a parameter verification may take more than ten hours, and the optimization process is very slow. It is impossible to find the optimal parameters in a short time. Moreover, it is impossible to automatically adjust the parameters as the number of samples increases.

[0005] (2) The algorithm codes developed by algorithm engineers rely on many scientific algorithm packages. Due to the differences between the algorithm development environment and the online environment, a lot of repetitive work of algorithm engineers and software engineers will be wasted. In engineering implementation, data skew and memory overflow problems are often encountered, making algorithm engineering implementation difficult.

[0006] (3) The algorithm codes developed by algorithm engineers are generally run on a single machine and cannot be run in a distributed environment, resulting in low algorithm execution efficiency. Summary of the invention

[0007] In view of this, the present application provides a data model training method, device, electronic device and computer-readable medium, which can improve the training speed of the algorithm model when facing massive samples, greatly shorten the algorithm optimization time and delivery time, and improve accuracy and stability.

[0008] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.

[0009] According to a first aspect of an embodiment of the present application, a data model training method is proposed, the method comprising: grouping training data according to a predetermined rule to generate multiple grouped data; inputting the multiple grouped data into multiple data models for data training, respectively, and the multiple data models are run in multiple virtual containers; obtaining multiple groups of model parameters for the multiple data models after data training; and determining multiple first data models respectively through the multiple groups of model parameters.

[0010] In an exemplary embodiment of the present application, it further includes: preprocessing the original data to generate the training data.

[0011] In an exemplary embodiment of the present application, preprocessing the original data to generate the training data includes: sorting the original data according to time to generate the training data.

[0012] In an exemplary embodiment of the present application, grouping the training data according to a predetermined rule to generate a plurality of grouped data includes: grouping the training data according to commodity categories to generate a plurality of grouped data.

[0013] In an exemplary embodiment of the present application, grouping the training data according to commodity categories to generate multiple grouped data includes: grouping the training data according to commodity categories to generate multiple first grouped data; and grouping the first grouped data according to the data volume of the first grouped data to generate the multiple grouped data.

[0014] In an exemplary embodiment of the present application, it also includes: inputting the multiple grouped data into multiple data models for data training respectively, and the multiple data models run in multiple virtual containers including: storing the multiple grouped data in multiple task execution units; and associating the multiple task execution units with multiple virtual containers for data training.

[0015] In an exemplary embodiment of the present application, multiple data models are run in multiple virtual containers, including: establishing multiple virtual containers through a data container engine; encapsulating the algorithm codes of the multiple data models into multiple application requests; and specifying virtual containers for the multiple application requests respectively through a resource manager to run the multiple data models in multiple virtual containers.

[0016] In an exemplary embodiment of the present application, inputting the plurality of grouped data into a plurality of data models for data training respectively comprises: the data model in the virtual container performs data training by calling the grouped data in the task execution unit.

[0017] In an exemplary embodiment of the present application, obtaining multiple groups of model parameters for multiple data models after data training includes: obtaining multiple groups of first model parameter groups for multiple data models after data training; determining a parameter combination set for each first model parameter group in the multiple groups of first model parameter groups; and performing model training again through the parameter combination set to determine the multiple groups of model parameters.

[0018] In an exemplary embodiment of the present application, the virtual container is started by an application image, and the application image includes a predetermined software environment.

[0019] According to a second aspect of an embodiment of the present application, a data model training device is proposed, which includes: a grouping module, used to group the training data according to a predetermined rule to generate multiple grouped data; a training module, used to input the multiple grouped data into multiple data models for data training, and the multiple data models run in multiple virtual containers; a parameter module, used to obtain multiple groups of model parameters for multiple data models after data training; and a model module, used to determine multiple first data models respectively through the multiple groups of model parameters.

[0020] According to the third aspect of an embodiment of the present application, an electronic device is proposed, which includes: one or more processors; a storage device for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement any of the data model training methods described above.

[0021] According to a fourth aspect of an embodiment of the present application, a computer-readable medium is proposed, on which a computer program is stored, characterized in that when the program is executed by a processor, a data model training method as described in any one of the above items is implemented.

[0022] According to the data model training method, device, electronic device and computer-readable medium of the present application, the training speed of the algorithm model when facing massive samples can be improved, the algorithm optimization time and delivery time can be greatly shortened, and the accuracy and stability can be improved.

[0023] It is to be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application. The drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0025] Figure 1 It is a system block diagram of a data model training method and device according to an exemplary embodiment.

[0026] Figure 2 The figure is a flow chart of a data model training method according to an exemplary embodiment.

[0027] Figure 3 The figure is a flow chart of a data model training method according to an exemplary embodiment.

[0028] Figure 4 The figure is a flow chart of a data model training method according to an exemplary embodiment.

[0029] Figure 5 is an architectural diagram of a data model training method according to another exemplary embodiment.

[0030] Figure 6 is a schematic diagram of a data model training method according to another exemplary embodiment.

[0031] Figure 7 is a flowchart of a data model training method according to another exemplary embodiment.

[0032] Figure 8 is a flowchart of a data model training method according to another exemplary embodiment.

[0033] Fig. 9 is a flowchart of a data model training method according to another exemplary embodiment.

[0034] Fig.10 The figure is a flow chart of a data model training method according to an exemplary embodiment.

[0035] Fig.11 It is a block diagram of a data model training device according to an exemplary embodiment.

[0036] Fig.12 is a block diagram of a data model training device according to another exemplary embodiment.

[0037] Fig.13 It is a block diagram of an electronic device for data model training according to an exemplary embodiment. DETAILED DESCRIPTION

[0038] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that the present invention will be comprehensive and complete and fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.

[0039] The described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present invention. However, those skilled in the art will appreciate that the technical solution of the present invention may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring various aspects of the present invention.

[0040] The accompanying drawings are only schematic illustrations of the present invention, and the same reference numerals in the drawings represent the same or similar parts, so their repeated description will be omitted. Some block diagrams shown in the accompanying drawings do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0041] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and steps, nor must they be executed in the order described. For example, some steps can be decomposed, and some steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0042] Exemplary embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0043] Figure 1 It is a system block diagram of a data model training method and device according to an exemplary embodiment.

[0044] The server 105 may be a server that provides various services, such as a background management server (only an example) that provides support for the data model training system operated by the user using the terminal devices 101, 102, and 103. The background management server may analyze and process the received data such as the data model training request, and feed back the processing results (such as grouping data, model optimal parameters - only an example) to the terminal device.

[0045] The server 105 may, for example, group the training data according to a predetermined rule to generate a plurality of grouped data; the server 105 may, for example, input the plurality of grouped data into a plurality of data models for data training, and the plurality of data models run in a plurality of virtual containers; the server 105 may, for example, obtain a plurality of groups of model parameters for the plurality of data models after the data training; the server 105 may, for example, respectively determine a plurality of first data models through the plurality of groups of model parameters.

[0046] The server 105 may be a physical server, or may be composed of multiple servers, a part of the server 105 may be used as the data model training task submission system in the present application, for sending models to be trained and training samples; and a part of the server 105 may be used as the data model training system in the present application, for grouping the training data according to predetermined rules to generate multiple grouped data; inputting the multiple grouped data into multiple data models for data training, and the multiple data models run in multiple virtual containers; obtaining multiple groups of model parameters for the multiple data models after the data training; and determining multiple first data models respectively through the multiple groups of model parameters.

[0047] It should be noted that the data model training method provided in the embodiment of the present application can be executed by the server 105, and accordingly, the data model training device can be set in the server 105. The request end provided to the user for the data model training task and the data model training result is generally located in the terminal device 101, 102, 103.

[0048] Figure 2 is a flow chart of a data model training method according to an exemplary embodiment. Figure 2 The data model training method shown can improve the training speed of the algorithm model when facing massive samples, greatly shorten the algorithm optimization time and delivery time, and improve the accuracy and stability. Figure 2 , the data model training method in the exemplary embodiment of the present application is described.

[0049] In step S210, the training data is grouped according to a predetermined rule to generate a plurality of grouped data. The training data may be grouped according to commodity categories to generate a plurality of grouped data. For example, the training data may be grouped according to commodity categories to generate a plurality of first grouped data; and the first grouped data may be grouped according to the data volume of the first grouped data to generate a plurality of grouped data.

[0050] According to an example embodiment, the original data may be preprocessed to generate training data. The original data may not meet the data quality required by the input sample, and the data quality can be guaranteed by preprocessing the original data. For example, the original data may be subjected to missing value completion, standardization, normalization, etc., and the technical solution of the present invention is not particularly limited to this.

[0051] According to an example embodiment, preprocessing the raw data to generate training data may further include sorting the raw data by time to generate training data. The raw data is usually daily recorded data. If it is directly input into the algorithm, a large amount of memory resources will be wasted and the algorithm execution efficiency will be affected. In this example embodiment, for example, the raw data can be converted into a time series format or other data formats, but the present invention is not limited thereto.

[0052] In step S220, multiple grouped data are respectively input into multiple data models for data training, and the multiple data models are run in multiple virtual containers. Among them, the virtual container can be started, for example, by an application image, and the application image includes a predetermined software environment. The predetermined software environment can adopt Docker virtualization technology, for example. Docker is an open source application container engine. Container virtualization technology is kernel-level virtualization, and the additional demand for resources is very low, achieving lightweight virtualization far exceeding traditional virtual machines. Docker container can be understood as a lightweight sandbox. An application is running in each container, different containers are isolated from each other, and containers communicate with each other through the network. Creating and stopping containers are very quick, almost the same as creating and terminating native applications.

[0053] According to an example embodiment, a plurality of grouped data may be first stored in a plurality of task execution units; and the plurality of task execution units may be associated with a plurality of virtual containers for data training. The task execution unit may be, for example, an executor, which is actually an execution unit of a Spark task. Spark is a general parallel framework similar to Hadoop MapReduce open sourced by UC Berkeley AMP lab (AMP Lab of the University of California, Berkeley). Compared with the parallel computing model MapReduce, Spark has a performance advantage of ten or even a hundred times.

[0054] According to an example embodiment, multiple virtual containers can be established through a data container engine; the algorithm codes of the multiple data models are encapsulated into multiple application requests; and virtual containers are respectively specified for the multiple application requests through a resource manager to run the multiple data models in multiple virtual containers. Among them, the resource manager can use YARN (Yet Another Resource Negotiator), which is a new Hadoop resource manager. YARN consists of the following major components: (1) a global resource manager ResourceManager; (2) each node agent NodeManager of ResourceManager; (3) ApplicationMaster representing each application (4) each ApplicationMaster has multiple containers Container running on Nodemanager. For example, ResourceManager (resource manager) can be used to specify containers (such as Docker containers) for multiple application requests.

[0055] According to an example embodiment, the data model in the virtual container can be trained by calling the grouped data in the task execution unit. For example, the application (AppMaster) in YARN can be registered with the ResourceManager and apply for resources.

[0056] In step S230, multiple groups of model parameters of multiple data models are obtained after data training. For example, multiple data models can be trained for sample data of different commodity types to obtain corresponding multiple groups of model parameters.

[0057] According to an example embodiment, step S230 may include: obtaining multiple groups of first model parameter groups for multiple data models after data training; determining a parameter combination set for each of the multiple groups of first model parameter groups; and performing model training again through the parameter combination set to determine multiple groups of model parameters. For example, after training on sample data of multiple types of goods, the corresponding multiple groups of first model parameter groups obtained may have parameters within a specified range. In order to obtain the optimal model parameter set, different parameter combinations may be tried for the multiple groups of first model parameter groups, and the grouped data may be pulled again for model training to generate optimal parameters, i.e., multiple groups of model parameters.

[0058] In step S240, multiple first data models are determined respectively by the multiple groups of model parameters. When multiple groups of model parameters of multiple corresponding models are obtained by step S230, they are applied to the multiple corresponding models, that is, multiple first data models are obtained.

[0059] According to the data model training method of the present application, by inputting multiple grouped data into multiple data models for data training, and determining multiple first data models respectively through the obtained multiple sets of model parameters, the training speed of the algorithm model when facing massive samples can be improved, the algorithm optimization time and delivery time can be greatly shortened, and the accuracy and stability can be improved.

[0060] Figure 3 is a flow chart of a data model training method according to an exemplary embodiment. Figure 3 , data model training methods may include:

[0061] Step S310: multiple virtual containers are created through a data container engine. For example, a Docker container may be allocated to an AppMaster through a node agent (NodeManager).

[0062] Step S320: Encapsulate the algorithm codes of the multiple data models into multiple application requests. For example, AppMaster and Executor execution mirrors may be set to encapsulate the algorithm codes into Application and submit them to ResourceManager.

[0063] Step S330, the resource manager specifies virtual containers for multiple application requests respectively to run multiple data models in multiple virtual containers. For example, when the ResourceManager receives the application request, it randomly obtains a NodeManager to specify a Docker container and starts the AppMaster in the Docker container. According to the example embodiment, the data model in the virtual container can be trained by calling the grouped data in the task execution unit (e.g., Executor).

[0064] Figure 4 is a flow chart of a data model training method according to an exemplary embodiment. Figure 4 , data model training methods may include:

[0065] Step S410, after data training, multiple sets of first model parameter groups of multiple data models are obtained. For example, in the first model parameter group, the parameters may be in a specified range, not a fixed value.

[0066] Step S420, determining a parameter combination set for each of the multiple first model parameter groups. For example, the first model parameter group is a parameter range combination obtained by training samples of a specific commodity type. Considering that there are still certain similarities between samples of different commodity types, for example, the prices of fresh products and fruit and vegetable products may be affected by the purchasing power of consumers, multiple first model parameter groups can be cross-combined to generate their parameter combination set.

[0067] Step S430, retraining the model using the parameter combination set to determine the multiple sets of model parameters. For example, the multiple parameter combination sets in step S430 may be retrained with their corresponding models to obtain optimal model parameters.

[0068] Figure 5 is an architecture diagram of a data model training method according to another exemplary embodiment. Figure 5 ,The data model training method can combine Docker virtualization technology and Spark ,distributed memory computing technology. First, develop the basic image, and generate ,different application images according to different algorithms. These application images contain the ,whole software environment of the algorithm (e.g. Pandas, Numpy, Sklearn, etc.). Use the application image to start the Docker container, and the YARN caller runs the ,Executor in the Docker container. Finally, the output results are ,collected.

[0069] Figure 6 is a schematic diagram of a data model training method according to another exemplary embodiment. Figure 6 , the execution steps of the algorithm code can be:

[0070] (1) Set up AppMaster and Executor to execute the image, encapsulate the algorithm code into an Application and submit it to ResourceManager.

[0071] (2) After receiving the request, ResourceManager randomly finds a NodeManager and assigns a Docker container to AppMaster.

[0072] (3) Start AppMaster in the Docker container.

[0073] (4) AppMaster registers with ResourceManager and applies for resources.

[0074] (5) After applying for resources, start the Docker container on each NodeManager and execute the Executor.

[0075] (6) AppMaster continuously assigns tasks to Executor.

[0076] Figure 7 This is a flow chart of a data model training method according to another exemplary embodiment. In the data preprocessing process, the source data is generally some daily record data. Directly inputting the data into the algorithm wastes a lot of memory resources and affects the algorithm execution efficiency. It is necessary to convert the daily record data into a time series format (or other formats, taking time series as an example). Figure 7 , the data model training method may include:

[0077] Step S710: Grouping: First, the source data is grouped, for example, the source data with the same business key are all placed in one group.

[0078] Step S720, sorting. For example, each group of data is sorted in ascending order according to date. If missing values ​​are not supplemented and duplicate values ​​are not deleted in the above steps of data preprocessing, the above steps need to be performed first, and then sorting is performed.

[0079] Step S730, generate a time series. For example, retain the start date and generate an array of the length from the start date to today, which is a complete and continuous time series.

[0080] Figure 8 This is a flow chart of a data model training method according to another exemplary embodiment. Although the memory space occupied by the time series data generated after preprocessing has been greatly reduced, it is still a huge amount of data. If it is directly involved in training, it will still be very time-consuming. Therefore, it is necessary to distribute the data so that the data is approximately evenly distributed in different machines for training. To avoid data skew, before distributing the data, the following steps can be performed on the time series data:

[0081] Step S810, statistical analysis. For example, the data may be statistically analyzed by correlation analysis or other methods. Step S820, determining a grouping strategy. For example, the grouping strategy may be: classifying according to the key with the least correlation. Step S830, distributing data. For example, after grouping is completed according to the grouping strategy of step S820, each group of data is distributed to multiple Executors.

[0082] Fig. 9 FIG. 1 is a flow chart of a data model training method according to another exemplary embodiment. Fig. 9When the data in step S830 is grouped by category, the data can be classified into primary, secondary, and tertiary categories according to the key of the time series data part, and the number of keys in each category is counted respectively. If the number of keys in the primary category is less than 100,000, the data of this primary category and the primary category ID are directly distributed to the Executor. If the number of keys in the primary category is greater than 100,000, the number of keys of all the secondary categories under it is analyzed, and the secondary categories and category IDs (primary category IDs and secondary category IDs) with a key number less than 100,000 are distributed to different Executors respectively. If there is a secondary category with a key number greater than 100,000, the statistics of the third-level category are continued, and so on, until all data distribution is completed.

[0083] Fig.10 FIG. 1 is a flowchart of a data model training method according to another exemplary embodiment. Fig.10 After obtaining multiple groups of first model parameter groups according to step 310, the first model parameter groups may not be optimal yet, or may be range parameters that include the optimal parameters. In order to obtain the optimal parameters of the algorithm, it is necessary to try different parameter combinations, pull group data according to the grouping strategy, perform group model training separately, and finally generate the results, that is, the optimal parameters of the model.

[0084] According to the data model training method of the present application, combined with virtualization technology and distributed memory computing, the algorithm is run in a virtualized container, and the serial algorithm model training is improved to group and parallel training of the algorithm according to different grouping strategies, which greatly shortens the algorithm optimization time and delivery time, and improves the accuracy and stability of algorithm convergence. In summary, the data model training method of the present application has the following beneficial effects: (1) Improve the training speed of the algorithm model in massive samples, quickly obtain the optimal algorithm parameters, and automatically adjust the parameters as the samples are different. (2) Solve the problem of difficult algorithm engineering implementation, achieve seamless connection between algorithm engineers and software engineers, and greatly shorten the time for algorithm engineering implementation. (3) Solve the problem that the algorithm cannot run in a distributed environment and improve the execution efficiency of the algorithm.

[0085] Fig.11 is a block diagram of a data model training device according to an exemplary embodiment. Fig.11 The data model training device may include: a grouping module 1110, a training module 1120, a parameter module 1130, and a model module 1140.

[0086] In the data model training device, the grouping module 1110 is used to group the training data according to a predetermined rule to generate multiple grouped data. The training data can be grouped according to commodity categories to generate multiple grouped data. For example, the training data can be grouped according to commodity categories to generate multiple first grouped data; and the first grouped data can be grouped according to the data volume of the first grouped data to generate multiple grouped data.

[0087] The training module 1120 is used to input the plurality of grouped data into a plurality of data models for data training, and the plurality of data models are run in a plurality of virtual containers. The virtual container can be started, for example, by an application image, and the application image includes a predetermined software environment. The predetermined software environment can adopt, for example, Docker virtualization technology.

[0088] The parameter module 1130 is used to obtain multiple sets of model parameters of multiple data models after data training. For example, multiple data models can be trained for sample data of different commodity types to obtain corresponding multiple sets of model parameters.

[0089] According to an example embodiment, the parameter module 1130 can be used to: obtain multiple groups of first model parameter groups for multiple data models after data training; determine a parameter combination set for each group of first model parameter groups in the multiple groups of first model parameter groups; and perform model training again through the parameter combination set to determine multiple groups of model parameters.

[0090] The model module 1140 is used to determine multiple first data models respectively through the multiple groups of model parameters. When multiple groups of model parameters of multiple corresponding models are obtained through step S230, they are applied to the multiple corresponding models, that is, multiple first data models are obtained.

[0091] Fig.12 is a block diagram of a data model training device according to another exemplary embodiment. Fig.12 The data model training device may include a data preprocessing module 1210, a data conversion module 1220, a data distribution module 1230, a model training module 1240, a model collection module 1250 and a performance evaluation module 1260.

[0092] In the data model training device, in order to ensure the data quality of the input algorithm, the data preprocessing module 1210 can be used to preprocess the data, such as removing unique attributes, filling missing values, one-hot encoding attributes, standardizing and normalizing the data, and other operations.

[0093] The source data is generally daily recorded data. If it is directly input into the algorithm, a large amount of memory resources will be wasted and the algorithm execution efficiency will be affected. The data conversion module 1220 can be used to convert the daily recorded data into a time series format or other formats.

[0094] After the data conversion module 1220, the memory space occupied by the generated time series data has been greatly reduced, but it is still a massive amount of data. If it is directly used for training, it will still be time-consuming. The data can be distributed through the data distribution module 1230 to distribute the data approximately evenly on different machines for training. To avoid data skew, before data distribution, it is necessary to perform statistical analysis on the time series data, determine the distribution strategy, and distribute the data according to the distribution strategy.

[0095] After the data distribution module 1230, the data is distributed approximately evenly to different executors, and the number of executors is determined. Since the data is relatively evenly distributed, each executor does not need to apply for too many resources. Each executor has 4 executor-cores and 20G executor-memory. The executor can be run on a Docker container through the model training module 1240. The Docker container is started through an application image. The application image is developed by an algorithm engineer and comes with the software environment of the entire algorithm. The algorithm code does not need to be changed to perform model training, achieving seamless integration of the algorithm and the project. Through the above model, the data skew problem and the algorithm operating environment problem are solved from the source, the training process is more stable, and the model can be trained in parallel.

[0096] After using Docker container for model training, the output results are out of order. The model collection module 1250 can be used to orderly merge the model training outputs of the same parameters according to the grouping strategy and store them in a distributed file system (such as HDFS) in a specified format to facilitate subsequent algorithm performance evaluation.

[0097] Due to different business scenarios, the focus of algorithm performance evaluation is also different. The following describes the performance evaluation process with accuracy as the evaluation indicator. For models trained with different parameters, the algorithm performance evaluation module 1260 inputs the test set into each algorithm model, outputs the predicted value, combines the true value and the predicted value, calculates the accuracy of the algorithm, and selects the algorithm model with high accuracy as the final algorithm model.

[0098] According to the data model training device of the present application, by inputting multiple grouped data into multiple data models for data training, and determining multiple first data models respectively through the obtained multiple sets of model parameters, the training speed of the algorithm model when facing massive samples can be improved, the algorithm optimization time and delivery time can be greatly shortened, and the accuracy and stability can be improved.

[0099] Fig.13 It is a block diagram of an electronic device for data model training according to an exemplary embodiment.

[0100] Refer to the following Fig.13 1300 according to this embodiment of the present application is described. Fig.13 The electronic device 1300 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0101] like Fig.13 As shown, the computer system 1300 includes a central processing unit (CPU) 1301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1302 or a program loaded from a storage portion 1308 to a random access memory (RAM) 1303. For example, the central processing unit 1301 can perform the following operations: Figure 2 , Figure 3 , Figure 4 , Figure 5 , Figure 6 , Figure 7 , Figure 8 , Fig. 9 , Fig.10 One or more of the steps shown.

[0102] In the RAM 1303, various programs and data required for system operation are also stored, such as packet data, model parameters, etc. The CPU 1301, ROM 1302, and RAM 1303 are connected to each other via a bus 1304. An input / output (I / O) interface 1305 is also connected to the bus 1304.

[0103] The following components are connected to the I / O interface 1305: an input section 1306 including a touch screen, a keyboard, etc.; an output section 1307 including a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 1308 including a flash memory, etc.; and a communication section 1309 including a wireless network card, a high-speed network card, etc. The communication section 1309 performs communication processing via a network such as the Internet. A drive 1310 is also connected to the I / O interface 1305 as needed. A removable medium 1311, such as a semiconductor memory, a magnetic disk, etc., is installed on the drive 1310 as needed, so that a computer program read therefrom is installed into the storage section 1308 as needed.

[0104] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution of the embodiment of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including a number of instructions for a computing device (which can be a personal computer, a server, a mobile terminal, or a smart device, etc.) to execute the method according to the embodiment of the present invention, for example Figure 2 , Figure 3 , Figure 4 , Figure 5 , Figure 6 , Figure 7 , Figure 8 , Fig. 9 , Fig.10 One or more of the steps shown.

[0105] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0106] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not claimed by the present invention. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the claims.

[0107] It should be understood that the present invention is not limited to the detailed structures, drawings or implementations shown herein, but rather the present invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

Claims

1. A data model training method, characterized in that: include: The training data is grouped according to a predetermined rule to generate a plurality of grouped data, which includes: grouping the training data according to commodity categories to generate a plurality of grouped data; Inputting the plurality of grouped data into a plurality of data models respectively for parallel data training, wherein the plurality of data models are run in a plurality of virtual containers; After data training, multiple sets of model parameters of multiple data models are obtained; Determine a plurality of first data models respectively by using the plurality of groups of model parameters; and Input the test set into each first data model, output the predicted value, combine the true value and the predicted value to obtain the accuracy of each first data model, and select an algorithm model from the multiple first data models according to the accuracy; Among them, obtaining multiple sets of model parameters of multiple data models after data training includes: After data training, multiple groups of first model parameter groups of multiple data models are obtained, each group of first model parameter groups is a parameter range combination obtained by training the grouped data of the corresponding commodity category; Cross-combining the plurality of first model parameter groups, and determining a parameter combination set for each of the plurality of first model parameter groups; The grouped data of the corresponding commodity category is pulled again through the parameter combination set to train the corresponding data model to determine the multiple groups of model parameters.

2. The method according to claim 1, characterized in that Also includes: The original data is preprocessed to generate the training data.

3. The method according to claim 2, characterized in that Preprocessing the original data to generate the training data includes: The original data is sorted according to time to generate the training data.

4. The method according to claim 1, characterized in that The training data is grouped according to the commodity category to generate a plurality of grouped data including: Performing grouping processing on the training data according to commodity categories to generate a plurality of first grouping data; and The first packet data is grouped according to the data amount of the first packet data to generate the plurality of packet data.

5. The method according to claim 1, characterized in that Inputting the plurality of grouped data into a plurality of data models for parallel data training respectively, wherein the plurality of data models are run in a plurality of virtual containers comprises: storing the plurality of group data in a plurality of task execution units; and Multiple task execution units are associated with multiple virtual containers for data training.

6. The method according to claim 1, characterized in that Multiple data models run in multiple virtual containers including: Establish multiple virtual containers through the data container engine; Encapsulating the algorithm codes of the multiple data models into multiple application requests; and The resource manager specifies virtual containers for the multiple application requests respectively so as to run the multiple data models in the multiple virtual containers.

7. The method according to claim 6, characterized in that Inputting the plurality of grouped data into a plurality of data models respectively for parallel data training comprises: The data model in the virtual container performs data training by calling the grouped data in the task execution unit.

8. The method according to claim 1, characterized in that The virtual container is started by an application image, and the application image includes a predetermined software environment.

9. A data model training device, characterized in that: include: A grouping module, used to group the training data according to a predetermined rule to generate a plurality of grouped data; The grouping module is also used to group the training data according to commodity categories to generate multiple grouping data; A training module, used for inputting the plurality of grouped data into a plurality of data models respectively for parallel data training, wherein the plurality of data models are run in a plurality of virtual containers; A parameter module, used to obtain multiple groups of model parameters of multiple data models after data training; wherein the parameter module is further used to obtain multiple groups of first model parameter groups of multiple data models after data training, each group of first model parameter groups is a parameter range combination obtained by training the grouped data of the corresponding commodity category; cross-combining the multiple first model parameter groups to determine a parameter combination set for each of the multiple first model parameter groups; and pulling the grouped data of the corresponding commodity category again through the parameter combination set to train the corresponding data model to determine the multiple groups of model parameters; and The model module is used to determine multiple first data models respectively through the multiple groups of model parameters; and input the test set into each first data model, output the predicted value, combine the true value and the predicted value to obtain the accuracy of each first data model, and select the algorithm model from the multiple first data models according to the accuracy.

10. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 8.

11. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Machine learning model generation method and machine learning model generation device

    CN105912500A

  • Distributed deep learning system based on Docker container and establishment method and working method thereof

    CN107450961A

  • Cluster management method and device based on Docker

    CN107733977A

  • Intelligent big data system and method and equipment for providing intelligent big data service

    CN107885762A

  • Machine learning training system and method based on edge cloud computing

    CN108427992A