WO2022062449A1 - User grouping method and apparatus, and electronic device and storage medium - Google Patents

User grouping method and apparatus, and electronic device and storage medium Download PDF

Info

Publication number
WO2022062449A1
WO2022062449A1 PCT/CN2021/096532 CN2021096532W WO2022062449A1 WO 2022062449 A1 WO2022062449 A1 WO 2022062449A1 CN 2021096532 W CN2021096532 W CN 2021096532W WO 2022062449 A1 WO2022062449 A1 WO 2022062449A1
Authority
WO
WIPO (PCT)
Prior art keywords
grouping
sample data
user
model
data
Prior art date
Application number
PCT/CN2021/096532
Other languages
French (fr)
Chinese (zh)
Inventor
徐卓扬
赵惟
孙行智
胡岗
左磊
赵婷婷
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2022062449A1 publication Critical patent/WO2022062449A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/9035Filtering based on additional data, e.g. user or group profiles
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"

Definitions

  • the present application relates to the technical field of artificial intelligence, and in particular, to a user grouping method, apparatus, electronic device, and computer-readable storage medium.
  • the inventor realized that the current user grouping methods are either knowledge-based user grouping methods or knowledge and data-based user grouping methods, both of which require professional guide knowledge, such as professional medical knowledge, to sort out , this sorting behavior requires a lot of human time, high cost, and low efficiency; and these two clustering methods are based on guide knowledge rather than pure data-driven models, which lack scalability.
  • a user grouping method is applied to an electronic device, and includes:
  • optimization loss function use the sample data to train the user grouping model to obtain an optimized user grouping model
  • the user data to be grouped is grouped by using the optimized user grouping model, a grouping result is obtained, and the grouping result is output through the display screen of the electronic device.
  • a user grouping device comprising:
  • the sample data acquisition module is used to acquire the user's return visit data from the database communicatively connected with the electronic device, and organize the return visit data to obtain the sample data;
  • a grouping prediction model training module configured to use the sample data to train a pre-built grouping prediction model, and use the trained grouping prediction model to obtain an output result of the sample data
  • a loss function improvement module configured to adjust the loss function of the pre-built user grouping model based on the output result to obtain an optimized loss function
  • the user grouping model training module uses the sample data to train the user grouping model to obtain an optimized user grouping model
  • the grouping module is configured to use the optimized user grouping model to group the user data to be grouped, obtain a grouping result, and output the grouping result through the display screen of the electronic device.
  • An electronic device comprising:
  • a processor that executes computer program instructions stored in the memory to achieve the following steps:
  • optimization loss function use the sample data to train the user grouping model to obtain an optimized user grouping model
  • the user data to be grouped is grouped by using the optimized user grouping model, a grouping result is obtained, and the grouping result is output through the display screen of the electronic device.
  • a computer-readable storage medium storing a computer program, the computer program being executed by a processor to implement the following steps:
  • optimization loss function use the sample data to train the user grouping model to obtain an optimized user grouping model
  • the user data to be grouped is grouped by using the optimized user grouping model, a grouping result is obtained, and the grouping result is output through the display screen of the electronic device.
  • the present application can achieve the purpose of more efficient, scalable, and purely data-driven user grouping.
  • FIG. 1 is a schematic flowchart of a user grouping method provided by an embodiment of the present application.
  • FIG. 2 is a schematic flowchart of a method for generating sample data according to an embodiment of the present application
  • FIG. 3 is a schematic flowchart of a model training method provided by an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of a method for improving a loss function provided by an embodiment of the present application
  • FIG. 5 is a schematic flowchart of a method for generating an optimized user grouping model according to an embodiment of the present application
  • FIG. 6 is a schematic flowchart of a grouping method provided by an embodiment of the present application.
  • FIG. 7 is a schematic block diagram of a user grouping device according to an embodiment of the present application.
  • FIG. 8 is a schematic diagram of an internal structure of an electronic device for implementing a user grouping method provided by an embodiment of the present application.
  • the execution subject of the user grouping method provided by the embodiment of the present application includes, but is not limited to, at least one of the electronic devices that can be configured to execute the method provided by the embodiment of the present application, such as a server and a terminal.
  • the user grouping method can be executed by software or hardware installed in a terminal device or a server device, and the software can be a blockchain platform.
  • the server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
  • the user grouping method includes:
  • the database is connected in communication with the electronic device that executes the user grouping method described in this solution.
  • the user is a patient who has suffered from a disease. Therefore, the return visit data of the user includes long-term follow-up records of multiple patients, including but not limited to demographic information. , Inspection and inspection indicators, medication history, expert prescription and other indicator data.
  • the expert prescribing medicine can be considered as expert grouping, as the standard grouping result of user grouping.
  • the return visit data can be obtained from the database of the medical platform.
  • the return visit data can also be obtained from a preset blockchain node.
  • the re-visit data is sorted to obtain sample data, including:
  • the grouping prediction model described in this application is a deep neural network (Deep Neural Networks, DNN) model for predicting multi-classification problems.
  • the DNN model includes an input layer, a hidden layer, an output layer and a softmax function.
  • the input layer is used to receive data;
  • the hidden layer is used to calculate the data and enhance the classification capability of the model;
  • the output layer includes a plurality of output nodes, each output node outputs the corresponding category of the node
  • the softmax function is used to convert the output score to a probability value.
  • the grouping prediction model needs to be trained to improve the accuracy of the grouping prediction model.
  • the use of the sample data to train the pre-built grouping prediction model includes:
  • the preset stop condition means that the loss value no longer decreases.
  • H(p,q) is the loss function value
  • n is the total number of clustering schemes
  • p(x i ) is the true probability value of the i-th clustering scheme
  • q(x i ) is the predicted probability value of the i-th clustering scheme .
  • the sample data is input into the trained grouping prediction model, and the output result of the sample data is obtained.
  • the pre-built user grouping model is a DQN (Deep Q-learning, deep Q-value learning) model based on a deep reinforcement learning algorithm, which can optimize the long-term goal of the sequence decision problem.
  • DQN Deep Q-learning, deep Q-value learning
  • the input of the DQN model is state
  • the output is the Q (expected reward) value corresponding to each action
  • reward participates in training to optimize the model's selection of actions.
  • the input state of the user grouping model is the sample data
  • the action is the unique code of the grouping scheme
  • the loss function needs to be improved.
  • the loss function of the pre-built user grouping model is improved based on the output result, including:
  • the method for modifying the selection of the grouping scheme in the loss function includes:
  • a"' is the grouping scheme corresponding to the maximum Q value of the output after the sample data s' is input into the user grouping model; is the corresponding grouping scheme output by the user grouping model when the input is sample data s'
  • the Q value of , A′ DNN is the n clustering schemes with the highest output prediction probability value when the clustering prediction model inputs sample data s′, n is a preset constant, and can be 1/3 of the total number of all clustering schemes.
  • the preset penalty item is the penalty item that the current grouping scheme is higher than the expert grouping scheme, including:
  • P(s) is the penalty value
  • Q(s,a) is the Q value of the corresponding grouping scheme a output by the user grouping model when the input is sample data s
  • a DNN is the input sample of the grouping prediction model
  • the n clustering schemes with the highest predicted probability output when the data is s, n is a preset constant, and the value can be 1/3 of the total number of all clustering schemes; is the average of the Q values of all the grouping schemes output by the user grouping model when the input is the sample data s belonging to the A DNN .
  • the embodiment of the present application improves the loss function through the above steps to obtain an optimized loss function.
  • the optimized loss function includes:
  • the loss function is improved to limit the model's tendency to adopt a grouping scheme that is most likely to be decided by experts, thereby improving the credibility of the grouping scheme.
  • the S4 includes:
  • the present application utilizes a large amount of user return visit data collected for training and learning, and the data utilization rate is relatively high.
  • the user data to be grouped is grouped by using the optimized user grouping model to obtain a grouping scheme, including:
  • the optimized user grouping model is used to group patients, and the obtained grouping results can help doctors to quickly understand the treatment conditions of the patients, so as to carry out the next treatment plan.
  • a large amount of return visit data is collected as sample data, which is conducive to the subsequent optimization of the grouping model; the sample data is used to train a pre-built grouping prediction model, and the trained grouping prediction model is used to obtain the
  • the output result of the sample data uses the grouping prediction model to perform grouping prediction, which improves the work efficiency; adjusts the loss function of the pre-built user grouping model based on the output result to obtain an optimized loss function, and restricts the user grouping by improving the loss function.
  • the model adopts the grouping scheme most likely to be decided by experts to improve the accuracy of the grouping scheme; according to the optimization loss function, use the sample data to train the user grouping model to obtain an optimized user grouping model, and use the collected sample data for training.
  • the user grouping method, device and computer-readable storage medium proposed in this application can achieve the purpose of more efficient, scalable, and purely data-driven user grouping.
  • FIG. 7 it is a functional block diagram of the user grouping device of the present application.
  • the user grouping apparatus 100 described in this application may be installed in an electronic device. According to the implemented functions, the user grouping apparatus 100 may include a sample data acquisition module 101 , a grouping prediction model training module 102 , a loss function improvement module 103 , a user grouping model training module 104 and a grouping module 105 .
  • the modules described in the present invention can also be called units, which refer to a series of computer program segments that can be executed by the electronic device processor and can perform fixed functions, and are stored in the memory of the electronic device.
  • each module/unit is as follows:
  • the sample data acquisition module 101 is configured to acquire the user's return visit data from a database, and organize the return visit data to obtain sample data.
  • the sample data acquisition module 101 specifically performs the following operations:
  • the grouping prediction model training module 102 is configured to use the sample data to train a pre-built grouping prediction model, and use the trained grouping prediction model to obtain an output result of the sample data.
  • the grouping prediction model training module 102 specifically performs the following operations:
  • the parameters of the grouping prediction model are modified according to the loss function, and the grouping operation is performed again on the sample data by using the modified grouping prediction model until a preset stopping condition is reached.
  • the loss function improvement module 103 is configured to adjust the loss function of the pre-built user grouping model based on the output result to obtain an optimized loss function.
  • the method for modifying the selection of the grouping scheme in the loss function includes:
  • a"' is the grouping scheme corresponding to the maximum Q value of the output after the sample data s' is input into the user grouping model; is the corresponding grouping scheme output by the user grouping model when the input is sample data s'
  • the Q value of , A′ DNN is the n clustering schemes with the highest output prediction probability value when the clustering prediction model inputs sample data s′, n is a preset constant, and can be 1/3 of the total number of all clustering schemes.
  • the optimized loss function includes:
  • the loss function is improved to limit the model's tendency to adopt a grouping scheme that is most likely to be decided by experts, thereby improving the credibility of the grouping scheme.
  • the user grouping model training module 104 is configured to use the sample data to train the user grouping model according to the optimization loss function to obtain an optimized user grouping model.
  • the user grouping model training module 104 is specifically used for:
  • the optimized user grouping model is obtained.
  • the grouping module 105 is configured to use the optimized user grouping model to group the user data to be grouped, obtain a grouping result, and output the grouping result.
  • the grouping module 105 specifically performs the following operations:
  • the grouping scheme with the largest expected reward value (Q value) is selected as the grouping result of the user data to be grouped.
  • FIG. 8 it is a schematic structural diagram of an electronic device implementing the user grouping method of the present application.
  • the electronic device 1 may include a processor 10, a memory 11 and a bus, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a user grouping program 12.
  • the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, magnetic disk, CD etc.
  • the memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, such as a mobile hard disk of the electronic device 1 .
  • the memory 11 may also be an external storage device of the electronic device 1, such as a pluggable mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital) equipped on the electronic device 1. , SD) card, flash memory card (Flash Card), etc.
  • the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device.
  • the memory 11 can not only be used to store application software installed in the electronic device 1 and various types of data, such as the code of the user grouping program 12, etc., but also can be used to temporarily store data that has been output or will be output.
  • the processor 10 may be composed of integrated circuits, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits packaged with the same function or different functions, including one or more integrated circuits.
  • Central Processing Unit CPU
  • microprocessor digital processing chip
  • graphics processor and combination of various control chips, etc.
  • the processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect the various components of the entire electronic device, by running or executing the program or module (for example, executing the program) stored in the memory 11. User grouping program, etc.), and call the data stored in the memory 11 to execute various functions of the electronic device 1 and process data.
  • the bus may be a peripheral component interconnect (PCI for short) bus or an extended industry standard architecture (Extended industry standard architecture, EISA for short) bus or the like.
  • PCI peripheral component interconnect
  • EISA Extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus and so on.
  • the bus is configured to implement connection communication between the memory 11 and at least one processor 10 and the like.
  • FIG. 8 only shows an electronic device with components. Those skilled in the art can understand that the structure shown in FIG. 8 does not constitute a limitation on the electronic device 1, and may include fewer or more components than those shown in the figure. components, or a combination of certain components, or a different arrangement of components.
  • the electronic device 1 may also include a power supply (such as a battery) for powering the various components, preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that the power management
  • the device implements functions such as charge management, discharge management, and power consumption management.
  • the power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and any other components.
  • the electronic device 1 may further include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
  • the electronic device 1 may also include a network interface, optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
  • a network interface optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
  • the electronic device 1 may further include a user interface, and the user interface may be a display (Display), an input unit (eg, a keyboard (Keyboard)), optionally, the user interface may also be a standard wired interface or a wireless interface.
  • the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, and the like.
  • the display may also be appropriately called a display screen or a display unit, which is used for displaying information processed in the electronic device 1 and for displaying a visualized user interface.
  • the user grouping program 12 stored in the memory 11 in the electronic device 1 is a combination of multiple instructions, and when running in the processor 10, can realize:
  • optimization loss function use the sample data to train the user grouping model to obtain an optimized user grouping model
  • the user data to be grouped is grouped by using the optimized user grouping model, a grouping result is obtained, and the grouping result is output through the display screen of the electronic device.
  • the modules/units integrated by the electronic device 1 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium, and the computer-readable storage medium can be stored in a computer-readable storage medium. Can be volatile or non-volatile.
  • the computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, removable hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory) .
  • the computer-readable medium stores a computer program, and the computer program is executed by the processor to realize the following steps:
  • optimization loss function use the sample data to train the user grouping model to obtain an optimized user grouping model
  • the user data to be grouped is grouped by using the optimized user grouping model, a grouping result is obtained, and the grouping result is output through the display screen of the electronic device.
  • modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, may be located in one place, or may 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 solution in this embodiment.
  • each functional module in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of hardware plus software function modules.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Business, Economics & Management (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • Artificial Intelligence (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Health & Medical Sciences (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Strategic Management (AREA)
  • Economics (AREA)
  • Human Resources & Organizations (AREA)
  • Game Theory and Decision Science (AREA)
  • Development Economics (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Marketing (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • General Business, Economics & Management (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A user grouping method and apparatus, and an electronic device and a computer-readable storage medium. The method comprises: acquiring, from a database, return visit data of a user, and organizing the return visit data to obtain sample data (S1); training a pre-built grouping prediction model, so as to obtain an output result of the sample data (S2); adjusting a loss function of a pre-built user grouping model on the basis of the output result, so as to obtain an optimized loss function (S3); training the user grouping model according to the optimized loss function, so as to obtain an optimized user grouping model (S4); and by using the optimized user grouping model, grouping user data to be grouped, so as to obtain a grouping result, and outputting the grouping result by means of a display screen (S5). The efficiency and scalability of user grouping are improved. The return visit data can also be stored in a blockchain.

Description

用户分群方法、装置、电子设备及存储介质User grouping method, device, electronic device and storage medium
本申请要求于2020年9月25日提交中国专利局、申请号为CN202011021840.8,发明名称为“用户分群方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed on September 25, 2020 with the application number CN202011021840.8 and the invention title is "User Grouping Method, Device, Electronic Device and Storage Medium", the entire content of which is approved by Reference is incorporated in this application.
技术领域technical field
本申请涉及人工智能技术领域,尤其涉及一种用户分群方法、装置、电子设备及计算机可读存储介质。The present application relates to the technical field of artificial intelligence, and in particular, to a user grouping method, apparatus, electronic device, and computer-readable storage medium.
背景技术Background technique
不同的用户具有不同的年龄、性别等差异,因此,对不同用户的服务方式或者策略也不尽相同。例如,不同的患者即使患的病相同,但是治疗方法也会不一样。因此,需要把患者分成若干的子群,为每个子群制定不一样的治疗方法,达到最佳的治疗效果。Different users have different age, gender and other differences, therefore, different service methods or strategies for different users are also different. For example, different patients may be treated differently even if they have the same disease. Therefore, it is necessary to divide patients into several subgroups, and formulate different treatment methods for each subgroup to achieve the best treatment effect.
发明人意识到目前的用户分群方法,要么是基于知识的用户分群方法,要么是基于知识和数据的用户分群方法,这两种分群方法都需要对专业的指南知识,如专业医学知识,进行梳理,这种梳理行为需要耗费大量的人力时间,成本过高,效率较低;且这两种分群方法以指南知识为基础,而不是纯数据驱动模型,缺乏可扩展性。The inventor realized that the current user grouping methods are either knowledge-based user grouping methods or knowledge and data-based user grouping methods, both of which require professional guide knowledge, such as professional medical knowledge, to sort out , this sorting behavior requires a lot of human time, high cost, and low efficiency; and these two clustering methods are based on guide knowledge rather than pure data-driven models, which lack scalability.
发明内容SUMMARY OF THE INVENTION
一种用户分群方法,所述方法应用于电子设备中,并包括:A user grouping method, the method is applied to an electronic device, and includes:
从与所述电子设备通讯连接的数据库中获取用户的回访数据,并将所述回访数据进行整理,得到样本数据;Obtain the user's return visit data from the database communicatively connected with the electronic device, and organize the return visit data to obtain sample data;
利用所述样本数据对预构建的分群预测模型进行训练,并利用训练完成的所述分群预测模型得到所述样本数据的输出结果;Use the sample data to train a pre-built grouping prediction model, and use the trained grouping prediction model to obtain an output result of the sample data;
基于所述输出结果对预构建的用户分群模型的损失函数进行调整,得到优化损失函数;Adjust the loss function of the pre-built user grouping model based on the output result to obtain an optimized loss function;
根据所述优化损失函数,利用所述样本数据对所述用户分群模型进行训练,得到优化用户分群模型;According to the optimization loss function, use the sample data to train the user grouping model to obtain an optimized user grouping model;
利用所述优化用户分群模型对待分群用户数据进行分群,得到分群结果,并将所述分群结果通过所述电子设备的显示屏幕输出。The user data to be grouped is grouped by using the optimized user grouping model, a grouping result is obtained, and the grouping result is output through the display screen of the electronic device.
一种用户分群装置,所述装置包括:A user grouping device, the device comprising:
样本数据获取模块,用于从与电子设备通讯连接的数据库中获取用户的回访数据,并将所述回访数据进行整理,得到样本数据;The sample data acquisition module is used to acquire the user's return visit data from the database communicatively connected with the electronic device, and organize the return visit data to obtain the sample data;
分群预测模型训练模块,用于利用所述样本数据对预构建的分群预测模型进行训练,并利用训练完成的所述分群预测模型得到所述样本数据的输出结果;a grouping prediction model training module, configured to use the sample data to train a pre-built grouping prediction model, and use the trained grouping prediction model to obtain an output result of the sample data;
损失函数改进模块,用于基于所述输出结果对预构建的用户分群模型的损失函数进行调整,得到优化损失函数;a loss function improvement module, configured to adjust the loss function of the pre-built user grouping model based on the output result to obtain an optimized loss function;
用户分群模型训练模块,根据所述优化损失函数,利用所述样本数据对所述用户分群模型进行训练,得到优化用户分群模型;The user grouping model training module, according to the optimization loss function, uses the sample data to train the user grouping model to obtain an optimized user grouping model;
分群模块,用于利用所述优化用户分群模型对待分群用户数据进行分群,得到分群结果,并将所述分群结果通过所述电子设备的显示屏幕输出。The grouping module is configured to use the optimized user grouping model to group the user data to be grouped, obtain a grouping result, and output the grouping result through the display screen of the electronic device.
一种电子设备,所述电子设备包括:An electronic device comprising:
存储器,存储至少一个计算机程序指令;及a memory that stores at least one computer program instruction; and
处理器,执行所述存储器中存储的计算机程序指令以实现如下步骤:A processor that executes computer program instructions stored in the memory to achieve the following steps:
从与所述电子设备通讯连接的数据库中获取用户的回访数据,并将所述回访数据进行整理,得到样本数据;Obtain the user's return visit data from the database communicatively connected with the electronic device, and organize the return visit data to obtain sample data;
利用所述样本数据对预构建的分群预测模型进行训练,并利用训练完成的所述分群预测模型得到所述样本数据的输出结果;Use the sample data to train a pre-built grouping prediction model, and use the trained grouping prediction model to obtain an output result of the sample data;
基于所述输出结果对预构建的用户分群模型的损失函数进行调整,得到优化损失函数;Adjust the loss function of the pre-built user grouping model based on the output result to obtain an optimized loss function;
根据所述优化损失函数,利用所述样本数据对所述用户分群模型进行训练,得到优化用户分群模型;According to the optimization loss function, use the sample data to train the user grouping model to obtain an optimized user grouping model;
利用所述优化用户分群模型对待分群用户数据进行分群,得到分群结果,并将所述分群结果通过所述电子设备的显示屏幕输出。The user data to be grouped is grouped by using the optimized user grouping model, a grouping result is obtained, and the grouping result is output through the display screen of the electronic device.
一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行实现如下步骤:A computer-readable storage medium storing a computer program, the computer program being executed by a processor to implement the following steps:
从与电子设备通讯连接的数据库中获取用户的回访数据,并将所述回访数据进行整理,得到样本数据;Obtain the user's return visit data from a database communicatively connected to the electronic device, and organize the return visit data to obtain sample data;
利用所述样本数据对预构建的分群预测模型进行训练,并利用训练完成的所述分群预测模型得到所述样本数据的输出结果;Use the sample data to train a pre-built grouping prediction model, and use the trained grouping prediction model to obtain an output result of the sample data;
基于所述输出结果对预构建的用户分群模型的损失函数进行调整,得到优化损失函数;Adjust the loss function of the pre-built user grouping model based on the output result to obtain an optimized loss function;
根据所述优化损失函数,利用所述样本数据对所述用户分群模型进行训练,得到优化用户分群模型;According to the optimization loss function, use the sample data to train the user grouping model to obtain an optimized user grouping model;
利用所述优化用户分群模型对待分群用户数据进行分群,得到分群结果,并将所述分群结果通过所述电子设备的显示屏幕输出。The user data to be grouped is grouped by using the optimized user grouping model, a grouping result is obtained, and the grouping result is output through the display screen of the electronic device.
本申请可以实现更高效的、可扩展的、纯数据驱动的用户分群的目的。The present application can achieve the purpose of more efficient, scalable, and purely data-driven user grouping.
附图说明Description of drawings
图1为本申请一实施例提供的用户分群方法的流程示意图;1 is a schematic flowchart of a user grouping method provided by an embodiment of the present application;
图2为本申请一实施例提供的样本数据生成方法的流程示意图;2 is a schematic flowchart of a method for generating sample data according to an embodiment of the present application;
图3为本申请一实施例提供的模型训练方法的流程示意图;3 is a schematic flowchart of a model training method provided by an embodiment of the present application;
图4为本申请一实施例提供的损失函数改进方法的流程示意图;4 is a schematic flowchart of a method for improving a loss function provided by an embodiment of the present application;
图5为本申请一实施例提供的优化用户分群模型生成方法的流程示意图;5 is a schematic flowchart of a method for generating an optimized user grouping model according to an embodiment of the present application;
图6为本申请一实施例提供的分群方法的流程示意图;6 is a schematic flowchart of a grouping method provided by an embodiment of the present application;
图7为本申请一实施例提供的用户分群装置的模块示意图;FIG. 7 is a schematic block diagram of a user grouping device according to an embodiment of the present application;
图8为本申请一实施例提供的实现用户分群方法的电子设备的内部结构示意图;8 is a schematic diagram of an internal structure of an electronic device for implementing a user grouping method provided by an embodiment of the present application;
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional characteristics and advantages of the purpose of the present application will be further described with reference to the accompanying drawings in conjunction with the embodiments.
具体实施方式detailed description
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application.
本申请实施例提供的用户分群方法的执行主体包括但不限于服务端、终端等能够被配置为执行本申请实施例提供的该方法的电子设备中的至少一种。换言之,所述用户分群方法可以由安装在终端设备或服务端设备的软件或硬件来执行,所述软件可以是区块链平台。所述服务端包括但不限于:单台服务器、服务器集群、云端服务器或云端服务器集群等。The execution subject of the user grouping method provided by the embodiment of the present application includes, but is not limited to, at least one of the electronic devices that can be configured to execute the method provided by the embodiment of the present application, such as a server and a terminal. In other words, the user grouping method can be executed by software or hardware installed in a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
参照图1所示,为本申请一实施例提供的用户分群方法的流程示意图。在本实施例中,所述用户分群方法包括:Referring to FIG. 1 , it is a schematic flowchart of a user grouping method provided by an embodiment of the present application. In this embodiment, the user grouping method includes:
S1、从数据库中获取用户的回访数据,并将所述回访数据进行整理,得到样本数据。S1. Acquire the user's return visit data from a database, and organize the return visit data to obtain sample data.
本申请实施例中,所述数据库与执行本方案所述用户分群方法的电子设备通讯连接。In the embodiment of the present application, the database is connected in communication with the electronic device that executes the user grouping method described in this solution.
较佳地,本申请其中一个实施例中,所述用户为曾经患过病的患者,因此,所述用户的回访数据包括多个患者的长期随访记录,内容包括但不限于,人口统计学信息、检验检查指标、用药史、专家开药等指标数据。其中,所述专家开药可认为是专家分群,作为用 户分群的标准分群结果。Preferably, in one of the embodiments of the present application, the user is a patient who has suffered from a disease. Therefore, the return visit data of the user includes long-term follow-up records of multiple patients, including but not limited to demographic information. , Inspection and inspection indicators, medication history, expert prescription and other indicator data. Wherein, the expert prescribing medicine can be considered as expert grouping, as the standard grouping result of user grouping.
本申请实施例中,所述回访数据可以从医疗平台的数据库中获取,为了保证上述回访数据的私密和安全性,上述回访数据也可以从预设的区块链节点中获取。In the embodiment of the present application, the return visit data can be obtained from the database of the medical platform. In order to ensure the privacy and security of the return visit data, the return visit data can also be obtained from a preset blockchain node.
详细地,参阅图2所示,所述将所述回访数据进行整理,得到样本数据,包括:In detail, referring to FIG. 2 , the re-visit data is sorted to obtain sample data, including:
S10、将所述回访数据按照时间顺序进行排序,得到初始样本数据;S10, sorting the return visit data in chronological order to obtain initial sample data;
S11、将所述初始样本数据中的指标数据转化为多维特征向量,得到样本数据。S11. Convert the index data in the initial sample data into a multi-dimensional feature vector to obtain sample data.
S2、利用所述样本数据对预构建的分群预测模型进行训练,并利用训练完成的所述分群预测模型得到所述样本数据的输出结果。S2. Use the sample data to train a pre-built grouping prediction model, and use the trained grouping prediction model to obtain an output result of the sample data.
较佳地,本申请中所述分群预测模型是用于预测多分类问题的深度神经网络(Deep Neural Networks,DNN)模型。其中,所述DNN模型包括输入层、隐藏层、输出层和softmax函数。所述输入层用于接收数据;所述隐藏层用于对所述数据进行计算以及增强模型的分类能力;所述输出层包括多个输出结点,每个输出结点输出该结点对应类别的得分,所述softmax函数用于把所述输出得分换算为概率值。Preferably, the grouping prediction model described in this application is a deep neural network (Deep Neural Networks, DNN) model for predicting multi-classification problems. Wherein, the DNN model includes an input layer, a hidden layer, an output layer and a softmax function. The input layer is used to receive data; the hidden layer is used to calculate the data and enhance the classification capability of the model; the output layer includes a plurality of output nodes, each output node outputs the corresponding category of the node The softmax function is used to convert the output score to a probability value.
进一步地,对于所述预构建的分群预测模型,需要对所述分群预测模型进行训练,提高所述分群预测模型的准确率。Further, for the pre-built grouping prediction model, the grouping prediction model needs to be trained to improve the accuracy of the grouping prediction model.
详细地,参阅图3所示,所述利用所述样本数据对预构建的分群预测模型进行训练,包括:In detail, referring to FIG. 3 , the use of the sample data to train the pre-built grouping prediction model includes:
S20、利用所述分群预测模型对所述样本数据执行分群操作,得到多个分群方案的预测概率值;S20, using the grouping prediction model to perform a grouping operation on the sample data to obtain prediction probability values of multiple grouping schemes;
S21、计算所述预测概率值与标准分群结果的交叉熵损失函数,得到损失值;S21, calculating the cross-entropy loss function of the predicted probability value and the standard grouping result to obtain a loss value;
S22、根据损失函数对所述分群预测模型的参数进行修改,并利用修改后的分群预测模型重新对所述样本数据执行分群操作,直到预设的停止条件达到。S22. Modify the parameters of the grouping prediction model according to the loss function, and re-perform the grouping operation on the sample data by using the modified grouping prediction model until a preset stop condition is reached.
其中,所述预设的停止条件是指所述损失值不再下降。Wherein, the preset stop condition means that the loss value no longer decreases.
本申请实施例中所述交叉熵损失函数,包括:The cross-entropy loss function described in the embodiments of the present application includes:
Figure PCTCN2021096532-appb-000001
Figure PCTCN2021096532-appb-000001
其中,H(p,q)是损失函数值,n是分群方案总数,p(x i)是第i个分群方案的真实概率值,q(x i)是第i个分群方案的预测概率值。 Among them, H(p,q) is the loss function value, n is the total number of clustering schemes, p(x i ) is the true probability value of the i-th clustering scheme, and q(x i ) is the predicted probability value of the i-th clustering scheme .
进一步地,本申请实施例将所述样本数据输入至训练完成的分群预测模型,得到所述样本数据的输出结果。Further, in the embodiment of the present application, the sample data is input into the trained grouping prediction model, and the output result of the sample data is obtained.
S3、基于所述输出结果对预构建的用户分群模型的损失函数进行调整,得到优化损失函数。S3. Adjust the loss function of the pre-built user grouping model based on the output result to obtain an optimized loss function.
优选地,所述预构建的用户分群模型是基于深度强化学习算法的DQN(Deep Q-learning,深度Q值学习)模型,可以优化序列决策问题的长期目标。Preferably, the pre-built user grouping model is a DQN (Deep Q-learning, deep Q-value learning) model based on a deep reinforcement learning algorithm, which can optimize the long-term goal of the sequence decision problem.
较佳地,所述DQN模型的输入为state,输出为各个action对应的Q(预期奖励)值,reward参与训练以优化模型对action的选择。本申请较佳实施例中,所述用户分群模型的输入state为所述样本数据,action为分群方案的独特编码,reward(奖励)根据患病种类不同而不同,以糖尿病为例,reward=-(用户下次回访是否发生并发症)-(用户下次回访是否发生低血糖事件)+(用户下次回访糖化血红蛋白是否达标)。Preferably, the input of the DQN model is state, the output is the Q (expected reward) value corresponding to each action, and reward participates in training to optimize the model's selection of actions. In a preferred embodiment of the present application, the input state of the user grouping model is the sample data, the action is the unique code of the grouping scheme, and the reward (reward) varies according to the type of disease. Taking diabetes as an example, reward=- (Whether there is a complication in the user's next return visit) - (whether a hypoglycemia event occurs in the user's next return visit) + (whether the user's next return visit is up to the glycated hemoglobin standard).
本申请实施例中所述损失函数如下:The loss function described in the embodiments of the present application is as follows:
L=R+Q(s′,a″)-Q(s,a)L=R+Q(s′,a″)-Q(s,a)
其中,s是当前样本数据;a是当前分群方案;s′是当前样本数据的下一个样本数据;a″是样本数据s′输入所述用户分群模型后,输出的最大Q值对应的分群方案;Q(s,a)是所述用户分群模型在输入为样本数据s时,输出的对应分群方案a的Q值;Q(s′,a″)是所述用户分群模型在输入为样本数据s′时,输出的对应分群方案a″的Q值;R是样本数据s的reward (奖励)。Among them, s is the current sample data; a is the current grouping scheme; s' is the next sample data of the current sample data; a" is the grouping scheme corresponding to the maximum Q value output after the sample data s' is input into the user grouping model ; Q(s, a) is the Q value of the corresponding grouping scheme a output by the user grouping model when the input is sample data s; Q(s', a") is the user grouping model when the input is sample data s', the output corresponding to the Q value of the grouping scheme a"; R is the reward (reward) of the sample data s.
优选地,为了使所述用户分群模型的分群结果尽可能靠近专家分群结果,提高分群结果的可信度,需要对所述损失函数进行改进。Preferably, in order to make the grouping result of the user grouping model as close to the expert grouping result as possible and improve the reliability of the grouping result, the loss function needs to be improved.
详细地,参阅图4所示,所述基于所述输出结果对预构建的用户分群模型的损失函数进行改进,包括:In detail, referring to Fig. 4, the loss function of the pre-built user grouping model is improved based on the output result, including:
S30、修改所述损失函数中分群方案的选择方法;S30, modifying the selection method of the grouping scheme in the loss function;
S31、在所述损失函数中增加预设惩罚项。S31. Add a preset penalty item to the loss function.
进一步地,所述修改所述损失函数中分群方案的选择方法,包括:Further, the method for modifying the selection of the grouping scheme in the loss function includes:
将所述选择方法修改为如下函数:Modify the selection method to the following function:
Figure PCTCN2021096532-appb-000002
Figure PCTCN2021096532-appb-000002
Figure PCTCN2021096532-appb-000003
Figure PCTCN2021096532-appb-000003
其中,a″′是样本数据s′输入所述用户分群模型后,输出的最大Q值对应的分群方案;
Figure PCTCN2021096532-appb-000004
是所述用户分群模型在输入为样本数据s′时,输出的对应分群方案
Figure PCTCN2021096532-appb-000005
的Q值,A′ DNN是所述分群预测模型输入样本数据s′时输出的预测概率值最高的n种分群方案,n为预设常数,可取值为所有分群方案总数的1/3。
Among them, a"' is the grouping scheme corresponding to the maximum Q value of the output after the sample data s' is input into the user grouping model;
Figure PCTCN2021096532-appb-000004
is the corresponding grouping scheme output by the user grouping model when the input is sample data s'
Figure PCTCN2021096532-appb-000005
The Q value of , A′ DNN is the n clustering schemes with the highest output prediction probability value when the clustering prediction model inputs sample data s′, n is a preset constant, and can be 1/3 of the total number of all clustering schemes.
进一步地,所述预设惩罚项是当前分群方案高出专家分群方案的惩罚项,包括:Further, the preset penalty item is the penalty item that the current grouping scheme is higher than the expert grouping scheme, including:
Figure PCTCN2021096532-appb-000006
Figure PCTCN2021096532-appb-000006
Figure PCTCN2021096532-appb-000007
Figure PCTCN2021096532-appb-000007
其中,P(s)是惩罚值;Q(s,a)是所述用户分群模型在输入为样本数据s时,输出的对应分群方案a的Q值;A DNN是所述分群预测模型输入样本数据s时输出的预测概率值最高的n种分群方案,n为预设常数,可取值为所有分群方案总数的1/3;
Figure PCTCN2021096532-appb-000008
是所述用户分群模型在输入为样本数据s时,输出的所有分群方案属于A DNN的Q值的平均值。
Among them, P(s) is the penalty value; Q(s,a) is the Q value of the corresponding grouping scheme a output by the user grouping model when the input is sample data s; A DNN is the input sample of the grouping prediction model The n clustering schemes with the highest predicted probability output when the data is s, n is a preset constant, and the value can be 1/3 of the total number of all clustering schemes;
Figure PCTCN2021096532-appb-000008
is the average of the Q values of all the grouping schemes output by the user grouping model when the input is the sample data s belonging to the A DNN .
详细地,本申请实施例通过上述步骤对所述损失函数进行改进,得到优化损失函数。进一步地,所述优化损失函数包括:In detail, the embodiment of the present application improves the loss function through the above steps to obtain an optimized loss function. Further, the optimized loss function includes:
L=R+Q(s′,a″′)-Q(s,a)+P(s)L=R+Q(s′,a″′)-Q(s,a)+P(s)
其中,s是当前样本数据;a是当前分群方案;s′是当前样本数据的下一个样本数据;a″′是样本数据s′输入所述用户分群模型后,输出的最大Q值对应的分群方案;Q(s,a)是所述用户分群模型在输入为样本数据s时,输出的对应分群方案a的Q值;Q(s′,a″′)是所述用户分群模型在输入为样本数据s′时,输出的对应分群方案a″′的Q值;R是样本数据s的reward(奖励);P(s)是惩罚值。Among them, s is the current sample data; a is the current grouping scheme; s' is the next sample data of the current sample data; a"' is the grouping corresponding to the maximum Q value output after the sample data s' is input into the user grouping model scheme; Q(s,a) is the Q value of the corresponding grouping scheme a output by the user grouping model when the input is sample data s; Q(s′,a″′) is the user grouping model when the input is When the sample data is s', the Q value of the corresponding grouping scheme a"' is output; R is the reward (reward) of the sample data s; P(s) is the penalty value.
优选地,本申请只使用了纯数据的模型,但在模型训练过程中通过改进损失函数限制了模型倾向采取专家最可能决策的分群方案,提高分群方案的可信度。Preferably, only pure data models are used in the present application, but in the model training process, the loss function is improved to limit the model's tendency to adopt a grouping scheme that is most likely to be decided by experts, thereby improving the credibility of the grouping scheme.
S4、根据所述优化损失函数,利用所述样本数据对所述用户分群模型进行训练,得到优化用户分群模型。S4. According to the optimization loss function, use the sample data to train the user grouping model to obtain an optimized user grouping model.
详细地,参阅图5所示,所述S4包括:In detail, referring to Fig. 5, the S4 includes:
S40、将所述样本数据输入至所述用户分群模型中,得到训练结果;S40, inputting the sample data into the user grouping model to obtain a training result;
S41、利用所述优化损失函数计算所述训练结果的损失值;S41, using the optimized loss function to calculate the loss value of the training result;
S42、将所述损失值与预设的损失阈值进行比较;S42, comparing the loss value with a preset loss threshold;
S43、在所述损失值大于或等于所述损失阈值时,调整所述用户分群模型的参数,并返回S40,重新进行训练,得到训练结果;S43, when the loss value is greater than or equal to the loss threshold, adjust the parameters of the user grouping model, and return to S40 to retrain to obtain a training result;
S44、当所述损失值小于所述损失阈值时,得到所述优化用户分群模型。S44. When the loss value is less than the loss threshold, obtain the optimized user grouping model.
优选地,本申请利用了收集的大量用户回访数据进行训练学习,数据利用率较高。Preferably, the present application utilizes a large amount of user return visit data collected for training and learning, and the data utilization rate is relatively high.
S5、利用所述优化用户分群模型对待分群用户数据进行分群,得到分群结果,并将所述分群结果输出。S5. Use the optimized user grouping model to group the user data to be grouped, obtain a grouping result, and output the grouping result.
详细地,参阅图6所示,所述利用所述优化用户分群模型对待分群用户数据进行分群, 得到分群方案,包括:In detail, referring to FIG. 6 , the user data to be grouped is grouped by using the optimized user grouping model to obtain a grouping scheme, including:
S50、将所述待分群用户数据输入至所述优化用户分群模型中;S50, input the user data to be grouped into the optimized user grouping model;
S51、利用所述优化用户分群模型输出所述待分群用户数据的各个分群方案及各个分群方案对应的预期奖励值(Q值);S51, using the optimized user grouping model to output each grouping scheme of the user data to be grouped and the expected reward value (Q value) corresponding to each grouping scheme;
S52、选择预期奖励值(Q值)最大的分群方案作为所述待分群用户数据的分群结果。S52. Select the grouping scheme with the largest expected reward value (Q value) as the grouping result of the user data to be grouped.
较佳地,本申请较佳实施例通过所述优化用户分群模型对患者进行分群,得到的分群结果可以帮助医生快速了解患者的治疗情况,以便进行下一步的治疗方案。Preferably, in the preferred embodiment of the present application, the optimized user grouping model is used to group patients, and the obtained grouping results can help doctors to quickly understand the treatment conditions of the patients, so as to carry out the next treatment plan.
本申请实施例收集大量的回访数据作为样本数据,有利于后续对分群模型进行优化;利用所述样本数据对预构建的分群预测模型进行训练,并利用训练完成的所述分群预测模型得到所述样本数据的输出结果,利用分群预测模型进行分群预测,提高了工作效率;基于所述输出结果对预构建的用户分群模型的损失函数进行调整,得到优化损失函数,通过改进损失函数,限制用户分群模型采取专家最可能决策的分群方案,提高分群方案的准确性;根据所述优化损失函数,利用所述样本数据对所述用户分群模型进行训练,得到优化用户分群模型,利用收集的样本数据进行训练,没有浪费收集的数据信息,提高了数据利用率;利用所述优化用户分群模型对待分群用户数据进行分群,得到分群结果,减少了大量的人力劳动,且所述优化用户分群模型可扩展性强,便于后续进行扩展。因此本申请提出的用户分群方法、装置及计算机可读存储介质,可以实现更高效的、可扩展的、纯数据驱动的用户分群的目的。In this embodiment of the present application, a large amount of return visit data is collected as sample data, which is conducive to the subsequent optimization of the grouping model; the sample data is used to train a pre-built grouping prediction model, and the trained grouping prediction model is used to obtain the The output result of the sample data uses the grouping prediction model to perform grouping prediction, which improves the work efficiency; adjusts the loss function of the pre-built user grouping model based on the output result to obtain an optimized loss function, and restricts the user grouping by improving the loss function. The model adopts the grouping scheme most likely to be decided by experts to improve the accuracy of the grouping scheme; according to the optimization loss function, use the sample data to train the user grouping model to obtain an optimized user grouping model, and use the collected sample data for training. training, without wasting the collected data information, and improving the data utilization rate; using the optimized user grouping model to group the user data to be grouped to obtain a grouping result, reducing a lot of human labor, and the optimized user grouping model scalability Strong, easy for subsequent expansion. Therefore, the user grouping method, device and computer-readable storage medium proposed in this application can achieve the purpose of more efficient, scalable, and purely data-driven user grouping.
如图7所示,是本申请用户分群装置的功能模块图。As shown in FIG. 7 , it is a functional block diagram of the user grouping device of the present application.
本申请所述用户分群装置100可以安装于电子设备中。根据实现的功能,所述用户分群装置100可以包括样本数据获取模块101、分群预测模型训练模块102、损失函数改进模块103、用户分群模型训练模块104和分群模块105。本发所述模块也可以称之为单元,是指一种能够被电子设备处理器所执行,并且能够完成固定功能的一系列计算机程序段,其存储在电子设备的存储器中。The user grouping apparatus 100 described in this application may be installed in an electronic device. According to the implemented functions, the user grouping apparatus 100 may include a sample data acquisition module 101 , a grouping prediction model training module 102 , a loss function improvement module 103 , a user grouping model training module 104 and a grouping module 105 . The modules described in the present invention can also be called units, which refer to a series of computer program segments that can be executed by the electronic device processor and can perform fixed functions, and are stored in the memory of the electronic device.
在本实施例中,关于各模块/单元的功能如下:In this embodiment, the functions of each module/unit are as follows:
所述样本数据获取模块101,用于从数据库中获取用户的回访数据,并将所述回访数据进行整理,得到样本数据。The sample data acquisition module 101 is configured to acquire the user's return visit data from a database, and organize the return visit data to obtain sample data.
详细地,在将所述回访数据进行整理,得到样本数据时,所述样本数据获取模块101具体执行下述操作:In detail, when sorting the return visit data to obtain sample data, the sample data acquisition module 101 specifically performs the following operations:
将所述回访数据按照时间顺序进行排序,得到初始样本数据;Sorting the return visit data in chronological order to obtain initial sample data;
将所述初始样本数据中的指标数据转化为多维特征向量,得到样本数据。Convert the index data in the initial sample data into a multi-dimensional feature vector to obtain sample data.
所述分群预测模型训练模块102,用于利用所述样本数据对预构建的分群预测模型进行训练,并利用训练完成的所述分群预测模型得到所述样本数据的输出结果。The grouping prediction model training module 102 is configured to use the sample data to train a pre-built grouping prediction model, and use the trained grouping prediction model to obtain an output result of the sample data.
详细地,在利用所述样本数据对预构建的分群预测模型进行训练时,所述分群预测模型训练模块102具体执行下述操作:In detail, when using the sample data to train the pre-built grouping prediction model, the grouping prediction model training module 102 specifically performs the following operations:
利用所述分群预测模型对所述样本数据执行分群操作,得到多个分群方案的预测概率值;Perform a grouping operation on the sample data by using the grouping prediction model to obtain prediction probability values of multiple grouping schemes;
计算所述预测概率值与标准分群结果的交叉熵损失函数,得到损失值;Calculate the cross-entropy loss function of the predicted probability value and the standard grouping result to obtain a loss value;
根据损失函数对所述分群预测模型的参数进行修改,并利用修改后的分群预测模型重新对所述样本数据执行分群操作,直到预设的停止条件达到。The parameters of the grouping prediction model are modified according to the loss function, and the grouping operation is performed again on the sample data by using the modified grouping prediction model until a preset stopping condition is reached.
所述损失函数改进模块103,用于基于所述输出结果对预构建的用户分群模型的损失函数进行调整,得到优化损失函数。The loss function improvement module 103 is configured to adjust the loss function of the pre-built user grouping model based on the output result to obtain an optimized loss function.
进一步地,所述修改所述损失函数中分群方案的选择方法,包括:Further, the method for modifying the selection of the grouping scheme in the loss function includes:
将所述选择方法修改为如下函数:Modify the selection method to the following function:
Figure PCTCN2021096532-appb-000009
Figure PCTCN2021096532-appb-000009
Figure PCTCN2021096532-appb-000010
Figure PCTCN2021096532-appb-000010
其中,a″′是样本数据s′输入所述用户分群模型后,输出的最大Q值对应的分群方案;
Figure PCTCN2021096532-appb-000011
是所述用户分群模型在输入为样本数据s′时,输出的对应分群方案
Figure PCTCN2021096532-appb-000012
的Q值,A′ DNN是所述分群预测模型输入样本数据s′时输出的预测概率值最高的n种分群方案,n为预设常数,可取值为所有分群方案总数的1/3。
Among them, a"' is the grouping scheme corresponding to the maximum Q value of the output after the sample data s' is input into the user grouping model;
Figure PCTCN2021096532-appb-000011
is the corresponding grouping scheme output by the user grouping model when the input is sample data s'
Figure PCTCN2021096532-appb-000012
The Q value of , A′ DNN is the n clustering schemes with the highest output prediction probability value when the clustering prediction model inputs sample data s′, n is a preset constant, and can be 1/3 of the total number of all clustering schemes.
详细地,所述优化损失函数包括:In detail, the optimized loss function includes:
L=R+Q(s′,a″′)-Q(s,a)+P(s)L=R+Q(s′,a″′)-Q(s,a)+P(s)
其中,s是当前样本数据;a是当前分群方案;s′是当前样本数据的下一个样本数据;a″′是样本数据s′输入所述用户分群模型后,输出的最大Q值对应的分群方案;Q(s,a)是所述用户分群模型在输入为样本数据s时,输出的对应分群方案a的Q值;Q(s′,a″′)是所述用户分群模型在输入为样本数据s′时,输出的对应分群方案a″′的Q值;R是样本数据s的reward(奖励);P(s)是惩罚值。Among them, s is the current sample data; a is the current grouping scheme; s' is the next sample data of the current sample data; a"' is the grouping corresponding to the maximum Q value output after the sample data s' is input into the user grouping model scheme; Q(s,a) is the Q value of the corresponding grouping scheme a output by the user grouping model when the input is sample data s; Q(s′,a″′) is the user grouping model when the input is When the sample data is s', the Q value of the corresponding grouping scheme a"' is output; R is the reward (reward) of the sample data s; P(s) is the penalty value.
优选地,本申请只使用了纯数据的模型,但在模型训练过程中通过改进损失函数限制了模型倾向采取专家最可能决策的分群方案,提高分群方案的可信度。Preferably, only pure data models are used in the present application, but in the model training process, the loss function is improved to limit the model's tendency to adopt a grouping scheme that is most likely to be decided by experts, thereby improving the credibility of the grouping scheme.
所述用户分群模型训练模块104,用于根据所述优化损失函数,利用所述样本数据对所述用户分群模型进行训练,得到优化用户分群模型。The user grouping model training module 104 is configured to use the sample data to train the user grouping model according to the optimization loss function to obtain an optimized user grouping model.
详细地,所述用户分群模型训练模块104具体用于:In detail, the user grouping model training module 104 is specifically used for:
将所述样本数据输入至所述用户分群模型中,得到训练结果;Inputting the sample data into the user grouping model to obtain a training result;
利用所述优化损失函数计算所述训练结果的损失值;Calculate the loss value of the training result by using the optimized loss function;
将所述损失值与预设的损失阈值进行比较;comparing the loss value with a preset loss threshold;
在所述损失值大于或等于所述损失阈值时,调整所述用户分群模型的参数,并重新进行训练,得到训练结果;When the loss value is greater than or equal to the loss threshold, adjust the parameters of the user grouping model, and re-train to obtain a training result;
当所述损失值小于所述损失阈值时,得到所述优化用户分群模型。When the loss value is less than the loss threshold, the optimized user grouping model is obtained.
所述分群模块105,用于利用所述优化用户分群模型对待分群用户数据进行分群,得到分群结果,并将所述分群结果输出。The grouping module 105 is configured to use the optimized user grouping model to group the user data to be grouped, obtain a grouping result, and output the grouping result.
详细地,在利用所述优化用户分群模型对待分群用户数据进行分群,得到分群方案,所述分群模块105具体执行下述操作:In detail, when using the optimized user grouping model to group the user data to be grouped to obtain a grouping scheme, the grouping module 105 specifically performs the following operations:
将所述待分群用户数据输入至所述优化用户分群模型中;inputting the user data to be grouped into the optimized user grouping model;
利用所述优化用户分群模型输出所述待分群用户数据的各个分群方案及各个分群方案对应的预期奖励值(Q值);Use the optimized user grouping model to output each grouping scheme of the user data to be grouped and the expected reward value (Q value) corresponding to each grouping scheme;
选择预期奖励值(Q值)最大的分群方案作为所述待分群用户数据的分群结果。The grouping scheme with the largest expected reward value (Q value) is selected as the grouping result of the user data to be grouped.
如图8所示,是本申请实现用户分群方法的电子设备的结构示意图。As shown in FIG. 8 , it is a schematic structural diagram of an electronic device implementing the user grouping method of the present application.
所述电子设备1可以包括处理器10、存储器11和总线,还可以包括存储在所述存储器11中并可在所述处理器10上运行的计算机程序,如用户分群程序12。The electronic device 1 may include a processor 10, a memory 11 and a bus, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a user grouping program 12.
其中,所述存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、移动硬盘、多媒体卡、卡型存储器(例如:SD或DX存储器等)、磁性存储器、磁盘、光盘等。所述存储器11在一些实施例中可以是电子设备1的内部存储单元,例如该电子设备1的移动硬盘。所述存储器11在另一些实施例中也可以是电子设备1的外部存储设备,例如电子设备1上配备的插接式移动硬盘、智能存储卡(Smart Media Card,SMC)、安全数字(Secure Digital,SD)卡、闪存卡(Flash Card)等。进一步地,所述存储器11还可以既包括电子设备1的内部存储单元也包括外部存储设备。所述存储器11不仅可以用于存储安装于电子设备1的应用软件及各类数据,例如用户分群程序12的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。Wherein, the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, magnetic disk, CD etc. The memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, such as a mobile hard disk of the electronic device 1 . In other embodiments, the memory 11 may also be an external storage device of the electronic device 1, such as a pluggable mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital) equipped on the electronic device 1. , SD) card, flash memory card (Flash Card), etc. Further, the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 11 can not only be used to store application software installed in the electronic device 1 and various types of data, such as the code of the user grouping program 12, etc., but also can be used to temporarily store data that has been output or will be output.
所述处理器10在一些实施例中可以由集成电路组成,例如可以由单个封装的集成电路所组成,也可以是由多个相同功能或不同功能封装的集成电路所组成,包括一个或者多 个中央处理器(Central Processing unit,CPU)、微处理器、数字处理芯片、图形处理器及各种控制芯片的组合等。所述处理器10是所述电子设备的控制核心(Control Unit),利用各种接口和线路连接整个电子设备的各个部件,通过运行或执行存储在所述存储器11内的程序或者模块(例如执行用户分群程序等),以及调用存储在所述存储器11内的数据,以执行电子设备1的各种功能和处理数据。In some embodiments, the processor 10 may be composed of integrated circuits, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits packaged with the same function or different functions, including one or more integrated circuits. Central Processing Unit (CPU), microprocessor, digital processing chip, graphics processor and combination of various control chips, etc. The processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect the various components of the entire electronic device, by running or executing the program or module (for example, executing the program) stored in the memory 11. User grouping program, etc.), and call the data stored in the memory 11 to execute various functions of the electronic device 1 and process data.
所述总线可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。所述总线被设置为实现所述存储器11以及至少一个处理器10等之间的连接通信。The bus may be a peripheral component interconnect (PCI for short) bus or an extended industry standard architecture (Extended industry standard architecture, EISA for short) bus or the like. The bus can be divided into address bus, data bus, control bus and so on. The bus is configured to implement connection communication between the memory 11 and at least one processor 10 and the like.
图8仅示出了具有部件的电子设备,本领域技术人员可以理解的是,图8示出的结构并不构成对所述电子设备1的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。FIG. 8 only shows an electronic device with components. Those skilled in the art can understand that the structure shown in FIG. 8 does not constitute a limitation on the electronic device 1, and may include fewer or more components than those shown in the figure. components, or a combination of certain components, or a different arrangement of components.
例如,尽管未示出,所述电子设备1还可以包括给各个部件供电的电源(比如电池),优选地,电源可以通过电源管理装置与所述至少一个处理器10逻辑相连,从而通过电源管理装置实现充电管理、放电管理、以及功耗管理等功能。电源还可以包括一个或一个以上的直流或交流电源、再充电装置、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。所述电子设备1还可以包括多种传感器、蓝牙模块、Wi-Fi模块等,在此不再赘述。For example, although not shown, the electronic device 1 may also include a power supply (such as a battery) for powering the various components, preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that the power management The device implements functions such as charge management, discharge management, and power consumption management. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and any other components. The electronic device 1 may further include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
进一步地,所述电子设备1还可以包括网络接口,可选地,所述网络接口可以包括有线接口和/或无线接口(如WI-FI接口、蓝牙接口等),通常用于在该电子设备1与其他电子设备之间建立通信连接。Further, the electronic device 1 may also include a network interface, optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
可选地,该电子设备1还可以包括用户接口,用户接口可以是显示器(Display)、输入单元(比如键盘(Keyboard)),可选地,用户接口还可以是标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在电子设备1中处理的信息以及用于显示可视化的用户界面。Optionally, the electronic device 1 may further include a user interface, and the user interface may be a display (Display), an input unit (eg, a keyboard (Keyboard)), optionally, the user interface may also be a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, and the like. The display may also be appropriately called a display screen or a display unit, which is used for displaying information processed in the electronic device 1 and for displaying a visualized user interface.
应该了解,所述实施例仅为说明之用,在专利申请范围上并不受此结构的限制。It should be understood that the embodiments are only used for illustration, and are not limited by this structure in the scope of the patent application.
所述电子设备1中的所述存储器11存储的用户分群程序12是多个指令的组合,在所述处理器10中运行时,可以实现:The user grouping program 12 stored in the memory 11 in the electronic device 1 is a combination of multiple instructions, and when running in the processor 10, can realize:
从与所述电子设备通讯连接的数据库中获取用户的回访数据,并将所述回访数据进行整理,得到样本数据;Obtain the user's return visit data from the database communicatively connected with the electronic device, and organize the return visit data to obtain sample data;
利用所述样本数据对预构建的分群预测模型进行训练,并利用训练完成的所述分群预测模型得到所述样本数据的输出结果;Use the sample data to train a pre-built grouping prediction model, and use the trained grouping prediction model to obtain an output result of the sample data;
基于所述输出结果对预构建的用户分群模型的损失函数进行调整,得到优化损失函数;Adjust the loss function of the pre-built user grouping model based on the output result to obtain an optimized loss function;
根据所述优化损失函数,利用所述样本数据对所述用户分群模型进行训练,得到优化用户分群模型;According to the optimization loss function, use the sample data to train the user grouping model to obtain an optimized user grouping model;
利用所述优化用户分群模型对待分群用户数据进行分群,得到分群结果,并将所述分群结果通过所述电子设备的显示屏幕输出。The user data to be grouped is grouped by using the optimized user grouping model, a grouping result is obtained, and the grouping result is output through the display screen of the electronic device.
进一步地,所述电子设备1集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中,所述计算机可读存储介质可以是易失性的,也可以是非易失行动的。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)。所述计算机可读介质存储有计算机程序,所述计算机程序被处理器执行实现如下步骤:Further, if the modules/units integrated by the electronic device 1 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium, and the computer-readable storage medium can be stored in a computer-readable storage medium. Can be volatile or non-volatile. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, removable hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory) . The computer-readable medium stores a computer program, and the computer program is executed by the processor to realize the following steps:
从与电子设备通讯连接的数据库中获取用户的回访数据,并将所述回访数据进行整理,得到样本数据;Obtain the user's return visit data from a database communicatively connected to the electronic device, and organize the return visit data to obtain sample data;
利用所述样本数据对预构建的分群预测模型进行训练,并利用训练完成的所述分群预测模型得到所述样本数据的输出结果;Use the sample data to train a pre-built grouping prediction model, and use the trained grouping prediction model to obtain an output result of the sample data;
基于所述输出结果对预构建的用户分群模型的损失函数进行调整,得到优化损失函数;Adjust the loss function of the pre-built user grouping model based on the output result to obtain an optimized loss function;
根据所述优化损失函数,利用所述样本数据对所述用户分群模型进行训练,得到优化用户分群模型;According to the optimization loss function, use the sample data to train the user grouping model to obtain an optimized user grouping model;
利用所述优化用户分群模型对待分群用户数据进行分群,得到分群结果,并将所述分群结果通过所述电子设备的显示屏幕输出。The user data to be grouped is grouped by using the optimized user grouping model, a grouping result is obtained, and the grouping result is output through the display screen of the electronic device.
在本申请所提供的几个实施例中,应该理解到,所揭露的设备,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In the several embodiments provided in this application, it should be understood that the disclosed apparatus, apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the modules is only a logical function division, and there may be other division manners in actual implementation.
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, may be located in one place, or may 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 solution in this embodiment.
另外,在本申请各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。In addition, each functional module in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of hardware plus software function modules.
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。It will be apparent to those skilled in the art that the present application is not limited to the details of the above-described exemplary embodiments, but that the present application can be implemented in other specific forms without departing from the spirit or essential characteristics of the present application.
因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附关联图表记视为限制所涉及的权利要求。Accordingly, the embodiments are to be regarded in all respects as illustrative and not restrictive, and the scope of the application is to be defined by the appended claims rather than the foregoing description, which is therefore intended to fall within the scope of the claims. All changes within the meaning and scope of the equivalents of , are included in this application. Any accompanying reference signs in the claims should not be construed as limiting the involved claims.
此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。系统权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第二等词语用来表示名称,而并不表示任何特定的顺序。Furthermore, it is clear that the word "comprising" does not exclude other units or steps and the singular does not exclude the plural. Several units or means recited in the system claims can also be realized by one unit or means by means of software or hardware. Second-class terms are used to denote names and do not denote any particular order.
最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application and not to limit them. Although the present application has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present application can be Modifications or equivalent substitutions can be made without departing from the spirit and scope of the technical solutions of the present application.

Claims (20)

  1. 一种用户分群方法,其中,所述方法应用于电子设备中,并包括:A user grouping method, wherein the method is applied to an electronic device, and includes:
    从与所述电子设备通讯连接的数据库中获取用户的回访数据,并将所述回访数据进行整理,得到样本数据;Obtain the user's return visit data from the database communicatively connected with the electronic device, and organize the return visit data to obtain sample data;
    利用所述样本数据对预构建的分群预测模型进行训练,并利用训练完成的所述分群预测模型得到所述样本数据的输出结果;Use the sample data to train a pre-built grouping prediction model, and use the trained grouping prediction model to obtain an output result of the sample data;
    基于所述输出结果对预构建的用户分群模型的损失函数进行调整,得到优化损失函数;Adjust the loss function of the pre-built user grouping model based on the output result to obtain an optimized loss function;
    根据所述优化损失函数,利用所述样本数据对所述用户分群模型进行训练,得到优化用户分群模型;According to the optimization loss function, use the sample data to train the user grouping model to obtain an optimized user grouping model;
    利用所述优化用户分群模型对待分群用户数据进行分群,得到分群结果,并将所述分群结果通过所述电子设备的显示屏幕输出。The user data to be grouped is grouped by using the optimized user grouping model, a grouping result is obtained, and the grouping result is output through the display screen of the electronic device.
  2. 如权利要求1所述的用户分群方法,其中,所述将所述回访数据进行整理,得到样本数据,包括:The method for user grouping according to claim 1, wherein said organizing the return visit data to obtain sample data, comprising:
    将所述回访数据按照时间顺序进行排序,得到初始样本数据;Sorting the return visit data in chronological order to obtain initial sample data;
    将所述初始样本数据中的指标数据转化为多维特征向量,得到样本数据。Convert the index data in the initial sample data into a multi-dimensional feature vector to obtain sample data.
  3. 如权利要求1所述的用户分群方法,其中,所述利用所述样本数据对预构建的分群预测模型进行训练,包括:The method for user grouping according to claim 1, wherein said using the sample data to train a pre-built grouping prediction model comprises:
    利用所述分群预测模型对所述样本数据执行分群操作,得到多个分群方案的预测概率值;Perform a grouping operation on the sample data by using the grouping prediction model to obtain prediction probability values of multiple grouping schemes;
    计算所述预测概率值与标准分群结果的交叉熵损失函数,得到损失值;Calculate the cross-entropy loss function of the predicted probability value and the standard grouping result to obtain a loss value;
    根据损失函数对所述分群预测模型的参数进行修改,并利用修改后的分群预测模型重新对所述样本数据执行分群操作,直到预设的停止条件达到。The parameters of the grouping prediction model are modified according to the loss function, and the grouping operation is performed again on the sample data by using the modified grouping prediction model until a preset stopping condition is reached.
  4. 如权利要求1所述的用户分群方法,其中,所述基于所述输出结果对预构建的用户分群模型的损失函数进行调整,包括:The user grouping method according to claim 1, wherein the adjusting the loss function of the pre-built user grouping model based on the output result comprises:
    修改所述损失函数中分群方案的选择方法;Modify the selection method of the grouping scheme in the loss function;
    在所述损失函数中增加预设惩罚项。A preset penalty term is added to the loss function.
  5. 如权利要求4所述的用户分群方法,其中,所述修改所述损失函数中分群方案的选择方法,包括:The method for user grouping according to claim 4, wherein said modifying the method for selecting a grouping scheme in said loss function comprises:
    将所述选择方法修改为如下函数:Modify the selection method to the following function:
    Figure PCTCN2021096532-appb-100001
    Figure PCTCN2021096532-appb-100001
    Figure PCTCN2021096532-appb-100002
    Figure PCTCN2021096532-appb-100002
    其中,a″′是样本数据s′输入所述用户分群模型后,输出的最大Q值对应的分群方案;
    Figure PCTCN2021096532-appb-100003
    是所述用户分群模型在输入为样本数据s′时,输出的对应分群方案
    Figure PCTCN2021096532-appb-100004
    的Q值,A′ DNN是所述分群预测模型输入样本数据s′时输出的预测概率值最高的n种分群方案,n为预设常数。
    Among them, a"' is the grouping scheme corresponding to the maximum Q value of the output after the sample data s' is input into the user grouping model;
    Figure PCTCN2021096532-appb-100003
    is the corresponding grouping scheme output by the user grouping model when the input is sample data s'
    Figure PCTCN2021096532-appb-100004
    The Q value of , A′ DNN is the n clustering schemes with the highest output prediction probability value when the clustering prediction model inputs sample data s′, and n is a preset constant.
  6. 如权利要求5所述的用户分群方法,其中,所述优化损失函数包括:The user grouping method of claim 5, wherein the optimizing loss function comprises:
    L=R+Q(s′,a″′)-Q(s,a)+P(s)L=R+Q(s′,a″′)-Q(s,a)+P(s)
    其中,s是当前样本数据;a是当前分群方案;s′是当前样本数据的下一个样本数据;a″′是样本数据s′输入所述用户分群模型后,输出的最大Q值对应的分群方案;Q(s,a)是所述用户分群模型在输入为样本数据s时,输出的对应分群方案a的Q值;Q(s′,a″′)是所述用户分群模型在输入为样本数据s′时,输出的对应分群方案a″′的Q值;R是样本数据s的奖励;P(s)是惩罚值。Among them, s is the current sample data; a is the current grouping scheme; s' is the next sample data of the current sample data; a"' is the grouping corresponding to the maximum Q value output after the sample data s' is input into the user grouping model scheme; Q(s,a) is the Q value of the corresponding grouping scheme a output by the user grouping model when the input is sample data s; Q(s′,a″′) is the user grouping model when the input is When the sample data is s', the output corresponds to the Q value of the grouping scheme a"'; R is the reward of the sample data s; P(s) is the penalty value.
  7. 如权利要求1至6中任意一项所述的用户分群方法,其中,所述利用所述优化用户分群模型对待分群用户数据进行分群,得到分群方案,包括:The user grouping method according to any one of claims 1 to 6, wherein the grouping of user data to be grouped by using the optimized user grouping model to obtain a grouping scheme, comprising:
    将所述待分群用户数据输入至所述优化用户分群模型中;inputting the user data to be grouped into the optimized user grouping model;
    利用所述优化用户分群模型输出所述待分群用户数据的各个分群方案及各个分群方案对应的预期奖励值;Using the optimized user grouping model to output each grouping scheme of the user data to be grouped and the expected reward value corresponding to each grouping scheme;
    选择预期奖励值最大的分群方案作为所述待分群用户数据的分群结果。The grouping scheme with the largest expected reward value is selected as the grouping result of the user data to be grouped.
  8. 一种用户分群装置,其中,所述装置包括:A user grouping device, wherein the device comprises:
    样本数据获取模块,用于从与电子设备通讯连接的数据库中获取用户的回访数据,并将所述回访数据进行整理,得到样本数据;The sample data acquisition module is used to acquire the user's return visit data from the database communicatively connected with the electronic device, and organize the return visit data to obtain the sample data;
    分群预测模型训练模块,用于利用所述样本数据对预构建的分群预测模型进行训练,并利用训练完成的所述分群预测模型得到所述样本数据的输出结果;a grouping prediction model training module, configured to use the sample data to train a pre-built grouping prediction model, and use the trained grouping prediction model to obtain an output result of the sample data;
    损失函数改进模块,用于基于所述输出结果对预构建的用户分群模型的损失函数进行调整,得到优化损失函数;a loss function improvement module, configured to adjust the loss function of the pre-built user grouping model based on the output result to obtain an optimized loss function;
    用户分群模型训练模块,根据所述优化损失函数,利用所述样本数据对所述用户分群模型进行训练,得到优化用户分群模型;The user grouping model training module, according to the optimization loss function, uses the sample data to train the user grouping model to obtain an optimized user grouping model;
    分群模块,用于利用所述优化用户分群模型对待分群用户数据进行分群,得到分群结果,并将所述分群结果通过所述电子设备的显示屏幕输出。The grouping module is configured to use the optimized user grouping model to group the user data to be grouped, obtain a grouping result, and output the grouping result through the display screen of the electronic device.
  9. 一种电子设备,其中,所述电子设备包括:An electronic device, wherein the electronic device comprises:
    存储器,存储至少一个计算机程序指令;及a memory that stores at least one computer program instruction; and
    处理器,执行所述存储器中存储的计算机程序指令以执行如下步骤:A processor that executes computer program instructions stored in the memory to perform the following steps:
    从与所述电子设备通讯连接的数据库中获取用户的回访数据,并将所述回访数据进行整理,得到样本数据;Obtain the user's return visit data from the database communicatively connected with the electronic device, and organize the return visit data to obtain sample data;
    利用所述样本数据对预构建的分群预测模型进行训练,并利用训练完成的所述分群预测模型得到所述样本数据的输出结果;Use the sample data to train a pre-built grouping prediction model, and use the trained grouping prediction model to obtain an output result of the sample data;
    基于所述输出结果对预构建的用户分群模型的损失函数进行调整,得到优化损失函数;Adjust the loss function of the pre-built user grouping model based on the output result to obtain an optimized loss function;
    根据所述优化损失函数,利用所述样本数据对所述用户分群模型进行训练,得到优化用户分群模型;According to the optimization loss function, use the sample data to train the user grouping model to obtain an optimized user grouping model;
    利用所述优化用户分群模型对待分群用户数据进行分群,得到分群结果,并将所述分群结果通过所述电子设备的显示屏幕输出。The user data to be grouped is grouped by using the optimized user grouping model, a grouping result is obtained, and the grouping result is output through the display screen of the electronic device.
  10. 如权利要求9所述的电子设备,其中,所述将所述回访数据进行整理,得到样本数据,包括:The electronic device as claimed in claim 9, wherein said organizing the return visit data to obtain sample data, comprising:
    将所述回访数据按照时间顺序进行排序,得到初始样本数据;Sorting the return visit data in chronological order to obtain initial sample data;
    将所述初始样本数据中的指标数据转化为多维特征向量,得到样本数据。Convert the index data in the initial sample data into a multi-dimensional feature vector to obtain sample data.
  11. 如权利要求9所述的电子设备,其中,所述利用所述样本数据对预构建的分群预测模型进行训练,包括:The electronic device according to claim 9, wherein said using the sample data to train a pre-built grouping prediction model comprises:
    利用所述分群预测模型对所述样本数据执行分群操作,得到多个分群方案的预测概率值;Perform a grouping operation on the sample data by using the grouping prediction model to obtain prediction probability values of multiple grouping schemes;
    计算所述预测概率值与标准分群结果的交叉熵损失函数,得到损失值;Calculate the cross-entropy loss function of the predicted probability value and the standard grouping result to obtain a loss value;
    根据损失函数对所述分群预测模型的参数进行修改,并利用修改后的分群预测模型重新对所述样本数据执行分群操作,直到预设的停止条件达到。The parameters of the grouping prediction model are modified according to the loss function, and the grouping operation is performed again on the sample data by using the modified grouping prediction model until a preset stopping condition is reached.
  12. 如权利要求9所述的电子设备,其中,所述基于所述输出结果对预构建的用户分群模型的损失函数进行调整,包括:The electronic device according to claim 9, wherein the adjusting the loss function of the pre-built user grouping model based on the output result comprises:
    修改所述损失函数中分群方案的选择方法;Modify the selection method of the grouping scheme in the loss function;
    在所述损失函数中增加预设惩罚项。A preset penalty term is added to the loss function.
  13. 如权利要求12所述的电子设备,其中,所述修改所述损失函数中分群方案的选择方法,包括:The electronic device of claim 12, wherein the method of modifying the selection of the grouping scheme in the loss function comprises:
    将所述选择方法修改为如下函数:Modify the selection method to the following function:
    Figure PCTCN2021096532-appb-100005
    Figure PCTCN2021096532-appb-100005
    Figure PCTCN2021096532-appb-100006
    Figure PCTCN2021096532-appb-100006
    其中,a″′是样本数据s′输入所述用户分群模型后,输出的最大Q值对应的分群方案;
    Figure PCTCN2021096532-appb-100007
    是所述用户分群模型在输入为样本数据s′时,输出的对应分群方案
    Figure PCTCN2021096532-appb-100008
    的Q值,A′ DNN是所述分群预测模型输入样本数据s′时输出的预测概率值最高的n种分群方案,n为预设常数。
    Among them, a"' is the grouping scheme corresponding to the maximum Q value of the output after the sample data s' is input into the user grouping model;
    Figure PCTCN2021096532-appb-100007
    is the corresponding grouping scheme output by the user grouping model when the input is sample data s'
    Figure PCTCN2021096532-appb-100008
    The Q value of , A′ DNN is the n clustering schemes with the highest output prediction probability value when the clustering prediction model inputs sample data s′, and n is a preset constant.
  14. 如权利要求13所述的电子设备,其中,所述优化损失函数包括:The electronic device of claim 13, wherein the optimizing loss function comprises:
    L=R+Q(s′,a″′)-Q(s,a)+P(s)L=R+Q(s′,a″′)-Q(s,a)+P(s)
    其中,s是当前样本数据;a是当前分群方案;s′是当前样本数据的下一个样本数据;a″′是样本数据s′输入所述用户分群模型后,输出的最大Q值对应的分群方案;Q(s,a)是所述用户分群模型在输入为样本数据s时,输出的对应分群方案a的Q值;Q(s′,a″′)是所述用户分群模型在输入为样本数据s′时,输出的对应分群方案a″′的Q值;R是样本数据s的奖励;P(s)是惩罚值。Among them, s is the current sample data; a is the current grouping scheme; s' is the next sample data of the current sample data; a"' is the grouping corresponding to the maximum Q value output after the sample data s' is input into the user grouping model scheme; Q(s,a) is the Q value of the corresponding grouping scheme a output by the user grouping model when the input is sample data s; Q(s′,a″′) is the user grouping model when the input is When the sample data is s', the output corresponds to the Q value of the grouping scheme a"'; R is the reward of the sample data s; P(s) is the penalty value.
  15. 如权利要求9至14中任意一项所述的电子设备,其中,所述利用所述优化用户分群模型对待分群用户数据进行分群,得到分群方案,包括:The electronic device according to any one of claims 9 to 14, wherein the grouping of user data to be grouped by using the optimized user grouping model to obtain a grouping scheme, comprising:
    将所述待分群用户数据输入至所述优化用户分群模型中;inputting the user data to be grouped into the optimized user grouping model;
    利用所述优化用户分群模型输出所述待分群用户数据的各个分群方案及各个分群方案对应的预期奖励值;Using the optimized user grouping model to output each grouping scheme of the user data to be grouped and the expected reward value corresponding to each grouping scheme;
    选择预期奖励值最大的分群方案作为所述待分群用户数据的分群结果。The grouping scheme with the largest expected reward value is selected as the grouping result of the user data to be grouped.
  16. 一种计算机可读存储介质,存储有计算机程序,其中,所述计算机程序被处理器执行时实现如下步骤:A computer-readable storage medium storing a computer program, wherein the computer program implements the following steps when executed by a processor:
    从与所述电子设备通讯连接的数据库中获取用户的回访数据,并将所述回访数据进行整理,得到样本数据;Obtain the user's return visit data from the database communicatively connected with the electronic device, and organize the return visit data to obtain sample data;
    利用所述样本数据对预构建的分群预测模型进行训练,并利用训练完成的所述分群预测模型得到所述样本数据的输出结果;Use the sample data to train a pre-built grouping prediction model, and use the trained grouping prediction model to obtain an output result of the sample data;
    基于所述输出结果对预构建的用户分群模型的损失函数进行调整,得到优化损失函数;Adjust the loss function of the pre-built user grouping model based on the output result to obtain an optimized loss function;
    根据所述优化损失函数,利用所述样本数据对所述用户分群模型进行训练,得到优化用户分群模型;According to the optimization loss function, use the sample data to train the user grouping model to obtain an optimized user grouping model;
    利用所述优化用户分群模型对待分群用户数据进行分群,得到分群结果,并将所述分群结果通过所述电子设备的显示屏幕输出。The user data to be grouped is grouped by using the optimized user grouping model, a grouping result is obtained, and the grouping result is output through the display screen of the electronic device.
  17. 如权利要求16所述的计算机可读存储介质,其中,所述将所述回访数据进行整理,得到样本数据,包括:The computer-readable storage medium according to claim 16, wherein the organizing the return visit data to obtain sample data, comprising:
    将所述回访数据按照时间顺序进行排序,得到初始样本数据;Sorting the return visit data in chronological order to obtain initial sample data;
    将所述初始样本数据中的指标数据转化为多维特征向量,得到样本数据。Convert the index data in the initial sample data into a multi-dimensional feature vector to obtain sample data.
  18. 如权利要求16所述的计算机可读存储介质,其中,所述利用所述样本数据对预构建的分群预测模型进行训练,包括:The computer-readable storage medium of claim 16, wherein the training of a pre-built cluster prediction model using the sample data comprises:
    利用所述分群预测模型对所述样本数据执行分群操作,得到多个分群方案的预测概率值;Perform a grouping operation on the sample data by using the grouping prediction model to obtain prediction probability values of multiple grouping schemes;
    计算所述预测概率值与标准分群结果的交叉熵损失函数,得到损失值;Calculate the cross-entropy loss function of the predicted probability value and the standard grouping result to obtain a loss value;
    根据损失函数对所述分群预测模型的参数进行修改,并利用修改后的分群预测模型重新对所述样本数据执行分群操作,直到预设的停止条件达到。The parameters of the grouping prediction model are modified according to the loss function, and the grouping operation is performed again on the sample data by using the modified grouping prediction model until a preset stopping condition is reached.
  19. 如权利要求16所述的计算机可读存储介质,其中,所述基于所述输出结果对预构建的用户分群模型的损失函数进行调整,包括:The computer-readable storage medium of claim 16, wherein the adjusting the loss function of the pre-built user grouping model based on the output result comprises:
    修改所述损失函数中分群方案的选择方法;Modify the selection method of the grouping scheme in the loss function;
    在所述损失函数中增加预设惩罚项。A preset penalty term is added to the loss function.
  20. 如权利要求19所述的计算机可读存储介质,其中,所述修改所述损失函数中分群方案的选择方法,包括:The computer-readable storage medium of claim 19, wherein the method of modifying the selection of a clustering scheme in the loss function comprises:
    将所述选择方法修改为如下函数:Modify the selection method to the following function:
    Figure PCTCN2021096532-appb-100009
    Figure PCTCN2021096532-appb-100009
    Figure PCTCN2021096532-appb-100010
    Figure PCTCN2021096532-appb-100010
    其中,a″′是样本数据s′输入所述用户分群模型后,输出的最大Q值对应的分群方案;
    Figure PCTCN2021096532-appb-100011
    是所述用户分群模型在输入为样本数据s′时,输出的对应分群方案
    Figure PCTCN2021096532-appb-100012
    的Q值,A′ DNN是所述分群预测模型输入样本数据s′时输出的预测概率值最高的n种分群方案,n为预设常数。
    Among them, a"' is the grouping scheme corresponding to the maximum Q value of the output after the sample data s' is input into the user grouping model;
    Figure PCTCN2021096532-appb-100011
    is the corresponding grouping scheme output by the user grouping model when the input is sample data s'
    Figure PCTCN2021096532-appb-100012
    The Q value of , A′ DNN is the n clustering schemes with the highest output prediction probability value when the clustering prediction model inputs sample data s′, and n is a preset constant.
PCT/CN2021/096532 2020-09-25 2021-05-27 User grouping method and apparatus, and electronic device and storage medium WO2022062449A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011021840.8 2020-09-25
CN202011021840.8A CN112115322B (en) 2020-09-25 2020-09-25 User grouping method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2022062449A1 true WO2022062449A1 (en) 2022-03-31

Family

ID=73796783

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/096532 WO2022062449A1 (en) 2020-09-25 2021-05-27 User grouping method and apparatus, and electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN112115322B (en)
WO (1) WO2022062449A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112115322B (en) * 2020-09-25 2024-05-07 平安科技(深圳)有限公司 User grouping method, device, electronic equipment and storage medium
CN113782192A (en) * 2021-09-30 2021-12-10 平安科技(深圳)有限公司 Grouping model construction method based on causal inference and medical data processing method
CN114742238B (en) * 2022-06-14 2022-09-09 四川省郫县豆瓣股份有限公司 Method, device, equipment and medium for screening raw materials of thick broad-bean sauce

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108364131A (en) * 2018-02-09 2018-08-03 合不合(厦门)网络科技有限公司 The automatic identification of personality type is carried out using neural network and divides the method for group
CN109086787A (en) * 2018-06-06 2018-12-25 平安科技(深圳)有限公司 User's portrait acquisition methods, device, computer equipment and storage medium
CN109447685A (en) * 2018-09-26 2019-03-08 中国平安人寿保险股份有限公司 Product data method for pushing, device and computer equipment based on machine learning
CN109451523A (en) * 2018-11-23 2019-03-08 南京邮电大学 The fast switch over method learnt based on flow identification technology and Q
CN110473147A (en) * 2018-05-09 2019-11-19 腾讯科技(深圳)有限公司 A kind of video deblurring method and device
CN110706303A (en) * 2019-10-15 2020-01-17 西南交通大学 Face image generation method based on GANs
CN111199240A (en) * 2018-11-16 2020-05-26 马上消费金融股份有限公司 Training method of bank card identification model, and bank card identification method and device
CN112115322A (en) * 2020-09-25 2020-12-22 平安科技(深圳)有限公司 User grouping method and device, electronic equipment and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102106684B1 (en) * 2018-02-22 2020-05-04 한국과학기술원 A joint learning framework for active feature acquisition and classification
CN111062491A (en) * 2019-12-13 2020-04-24 周世海 Intelligent agent unknown environment exploration method based on reinforcement learning
CN111091710A (en) * 2019-12-18 2020-05-01 上海天壤智能科技有限公司 Traffic signal control method, system and medium
CN111666494B (en) * 2020-05-13 2022-08-12 平安科技(深圳)有限公司 Clustering decision model generation method, clustering processing method, device, equipment and medium
CN111683010B (en) * 2020-05-26 2022-07-05 广东省电信规划设计院有限公司 Method and device for generating double routes based on optical cable network optical path
CN111651220B (en) * 2020-06-04 2023-08-18 上海电力大学 Spark parameter automatic optimization method and system based on deep reinforcement learning

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108364131A (en) * 2018-02-09 2018-08-03 合不合(厦门)网络科技有限公司 The automatic identification of personality type is carried out using neural network and divides the method for group
CN110473147A (en) * 2018-05-09 2019-11-19 腾讯科技(深圳)有限公司 A kind of video deblurring method and device
CN109086787A (en) * 2018-06-06 2018-12-25 平安科技(深圳)有限公司 User's portrait acquisition methods, device, computer equipment and storage medium
CN109447685A (en) * 2018-09-26 2019-03-08 中国平安人寿保险股份有限公司 Product data method for pushing, device and computer equipment based on machine learning
CN111199240A (en) * 2018-11-16 2020-05-26 马上消费金融股份有限公司 Training method of bank card identification model, and bank card identification method and device
CN109451523A (en) * 2018-11-23 2019-03-08 南京邮电大学 The fast switch over method learnt based on flow identification technology and Q
CN110706303A (en) * 2019-10-15 2020-01-17 西南交通大学 Face image generation method based on GANs
CN112115322A (en) * 2020-09-25 2020-12-22 平安科技(深圳)有限公司 User grouping method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN112115322A (en) 2020-12-22
CN112115322B (en) 2024-05-07

Similar Documents

Publication Publication Date Title
WO2022062449A1 (en) User grouping method and apparatus, and electronic device and storage medium
WO2021151306A1 (en) Method and apparatus for smart analysis of question and answer linguistic material, electronic device, and readable storage medium
WO2022160449A1 (en) Text classification method and apparatus, electronic device, and storage medium
WO2023029512A1 (en) Knowledge graph-based medical question answering method and apparatus, device and medium
WO2021208703A1 (en) Method and apparatus for question parsing, electronic device, and storage medium
WO2021151271A1 (en) Method and apparatus for textual question answering based on named entities, and device and storage medium
WO2022222300A1 (en) Open relationship extraction method and apparatus, electronic device, and storage medium
WO2023029511A1 (en) Intelligent inspection method and apparatus for online medical prescription medication, and device and storage medium
WO2021238563A1 (en) Enterprise operation data analysis method and apparatus based on configuration algorithm, and electronic device and medium
CN113626606B (en) Information classification method, device, electronic equipment and readable storage medium
WO2021114635A1 (en) Patient grouping model constructing method, patient grouping method, and related device
US20240112807A1 (en) Modular data system for processing multimodal data and enabling parallel recommendation system processing
WO2022227171A1 (en) Method and apparatus for extracting key information, electronic device, and medium
WO2022141840A1 (en) Network architecture search method and apparatus, electronic device, and medium
WO2021139223A1 (en) Method and apparatus for interpretation of clustering model, computer device, and storage medium
CN112269875B (en) Text classification method, device, electronic equipment and storage medium
WO2019085464A1 (en) Violation document scoring method and device, and computer readable storage medium
CN116719891A (en) Clustering method, device, equipment and computer storage medium for traditional Chinese medicine information packet
CN116860935A (en) Content management method, device, equipment and medium based on prompt word question-answer interaction
CN116720525A (en) Disease auxiliary analysis method, device, equipment and medium based on inquiry data
WO2023178979A1 (en) Question labeling method and apparatus, electronic device and storage medium
US20220309404A1 (en) Method of and system for identifying and enumerating cross-body degradations
US20230068453A1 (en) Methods and systems for determining and displaying dynamic patient readmission risk and intervention recommendation
CN112259254B (en) Case search method and device based on interactive feedback and readable storage medium
WO2022141838A1 (en) Model confidence analysis method and apparatus, electronic device and computer storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21870836

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21870836

Country of ref document: EP

Kind code of ref document: A1