WO2019041773A1 - Apparatus and method for updating prediction model, and computer-readable storage medium - Google Patents

Apparatus and method for updating prediction model, and computer-readable storage medium Download PDF

Info

Publication number
WO2019041773A1
WO2019041773A1 PCT/CN2018/077645 CN2018077645W WO2019041773A1 WO 2019041773 A1 WO2019041773 A1 WO 2019041773A1 CN 2018077645 W CN2018077645 W CN 2018077645W WO 2019041773 A1 WO2019041773 A1 WO 2019041773A1
Authority
WO
WIPO (PCT)
Prior art keywords
time span
time
prediction model
user
historical data
Prior art date
Application number
PCT/CN2018/077645
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 WO2019041773A1 publication Critical patent/WO2019041773A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting

Definitions

  • the present application relates to the field of terminal technologies, and in particular, to an apparatus, method, and computer readable storage medium for updating a prediction model.
  • predictive models are often used, for example, to predict the percentage of influenza-like cases in a region in the future, and to predict the click-through rate of an ad in the future.
  • the traditional method is to use the historical data to establish a prediction model as a fixed prediction model to predict the performance of the next period of time.
  • the prediction accuracy of the prediction model will gradually decrease.
  • the present application provides an apparatus, method, and computer readable storage medium for predicting a model, the main purpose of which is to improve the prediction accuracy of the prediction model.
  • the present application provides an apparatus for updating a prediction model, the apparatus comprising: a memory, a processor, and an update program of a prediction model stored on the memory and operable on the processor, the prediction
  • the update procedure of the model is implemented by the processor to implement the following steps:
  • the acquired historical data is input as a training sample into a prediction model of the item to be tested for training to determine model parameters of the prediction model, and the prediction model is updated based on the determined model parameters.
  • the present application further provides a method for updating a prediction model, the method comprising:
  • the acquired historical data is input as a training sample into a prediction model of the item to be tested for training to determine model parameters of the prediction model, and the prediction model is updated based on the determined model parameters.
  • the present application further provides a computer readable storage medium, where the update program of a prediction model is stored, and the update program of the prediction model can be executed by at least one processor. To implement the steps of the update method of the predictive model as described above.
  • the updating device, the method and the computer readable storage medium of the prediction model proposed by the present application determine the time unit to which the current time belongs when receiving the update request triggered by the item to be tested, and determine the time span set by the user, and use the time unit as Terminating the time unit, determining the time interval according to the termination time unit and the time span, obtaining historical data matching the time interval from the database corresponding to the item to be tested, and inputting the acquired historical data as a training sample into the prediction model of the item to be tested.
  • the training is performed to determine the model parameters of the prediction model, and the prediction model is updated based on the determined model parameters.
  • the scheme filters the historical data by setting the time span, and obtains the historical data closest to the target time unit as the training sample. Retraining, and then re-determining the model parameters to achieve the update of the model to adapt to the advancement of time, data changes, and improve the prediction accuracy of the prediction model.
  • FIG. 1 is a schematic diagram of a preferred embodiment of an apparatus for updating a prediction model of the present application
  • FIG. 2 is a schematic diagram of functional modules of an update procedure of a prediction model in an embodiment of an update apparatus for a prediction model of the present application;
  • FIG. 3 is a flowchart of a first embodiment of a method for updating a prediction model of the present application.
  • the application provides an update device for a predictive model.
  • FIG. 1 a schematic diagram of a preferred embodiment of an apparatus for updating a prediction model of the present application is shown.
  • the update device of the predictive model may be a PC (Personal Computer), or may be a terminal device such as a smart phone, a tablet computer, or a portable computer.
  • PC Personal Computer
  • the update device of the predictive model may be a PC (Personal Computer), or may be a terminal device such as a smart phone, a tablet computer, or a portable computer.
  • the updating device of the predictive model includes a memory 11, a processor 12, a communication bus 13, and a network interface 14.
  • the memory 11 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (for example, an SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like.
  • the memory 11 may in some embodiments be an internal storage unit of the update device of the predictive model, such as the hard disk of the update device of the predictive model.
  • the memory 11 may also be an external storage device of the update device of the predictive model in other embodiments, such as a plug-in hard disk equipped with an update device of the predictive model, a smart memory card (SMC), and a secure digital (Secure) Digital, SD) cards, flash cards, etc.
  • the memory 11 may also include an internal storage unit of the update device including the prediction model and an external storage device.
  • the memory 11 can be used not only for storing application software of the update device installed in the prediction model and various types of data, such as codes of the update program of the prediction model, but also for temporarily storing data that has been output or is to be output.
  • the processor 12 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor or other data processing chip for running program code or processing stored in the memory 11.
  • Data such as an update program that performs a predictive model, and the like.
  • Communication bus 13 is used to implement connection communication between these components.
  • the network interface 14 can optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), and is typically used to establish a communication connection between the device and other electronic devices.
  • a standard wired interface such as a WI-FI interface
  • Figure 1 shows only the updating means of the predictive model with the components 11-14 and the update program of the predictive model, but it should be understood that not all of the illustrated components are required to be implemented, and that more or less can be implemented instead. Component.
  • the device may further include a user interface
  • the user interface may include a display
  • an input unit such as a keyboard
  • the optional user interface may further include a standard wired interface and 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) touch sensor, or the like.
  • the display may also be suitably referred to as a display screen or display unit for displaying information processed in the update device of the predictive model and a user interface for displaying the visualization.
  • the device may also include a touch sensor.
  • the area provided by the touch sensor for the user to perform a touch operation is referred to as a touch area.
  • the touch sensor described herein may be a resistive touch sensor, a capacitive touch sensor, or the like.
  • the touch sensor includes not only a contact type touch sensor but also a proximity type touch sensor or the like.
  • the touch sensor may be a single sensor or a plurality of sensors arranged, for example, in an array.
  • the area of the display of the device may be the same as or different from the area of the touch sensor.
  • a display is stacked with the touch sensor to form a touch display. The device detects a user-triggered touch operation based on a touch screen display.
  • the device may further include a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, and the like.
  • sensors such as light sensors, motion sensors, and other sensors.
  • the light sensor may include an ambient light sensor and a proximity sensor, wherein if the device is a mobile terminal, the ambient light sensor may adjust the brightness of the display screen according to the brightness of the ambient light, and the proximity sensor may move when the mobile terminal moves to the ear. , turn off the display and / or backlight.
  • the gravity acceleration sensor can detect the magnitude of acceleration in each direction (usually three axes), and can detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of the mobile terminal (such as horizontal and vertical screen switching, Related games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping), etc.; of course, the mobile terminal can also be equipped with other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared sensor, etc. No longer.
  • an update program of a prediction model is stored in the memory 11; when the processor 12 executes an update program of the prediction model stored in the memory 11, the following steps are implemented:
  • the user terminal may send an update request, or trigger an update request based on the interaction interface provided by the device, and the system receives the update request or detects
  • the update request is reached, the above steps are started.
  • the prediction request may be sent by the user terminal, or the prediction request may be triggered based on the interaction interface provided by the device, when the device receives or detects the prediction request. , start the above steps, update the prediction model and adopt the updated prediction model to predict based on the prediction request.
  • the continuous time is divided into a plurality of consecutive time units, that is, a plurality of consecutive time units constitute a time axis corresponding to the historical data.
  • Historical data is updated in units of time units in the time dimension.
  • the scheme is described by taking the week as a time unit.
  • the time period corresponding to other time units may also be used as a time unit, such as day, month, year, and the like.
  • the project to be tested is to predict the percentage of influenza-like cases in a certain area in the next week.
  • the percentage of influenza-like cases in a certain area is the total number of influenza-like cases in the sentinel hospitals in the area.
  • the proportion of people Assuming that the predictive model is a time series model, the database stores historical data as a percentage of the proportion of influenza samples.
  • the prediction model may also be a regression model or a classification model, such as a random forest model.
  • the historical data stored in the database of the project to be tested may be a percentage of the proportion of the influenza sample. Historical data can also be sample data obtained by preprocessing these data.
  • the process of training a model using training samples is a process of obtaining parameters in the function through machine learning, that is, a process of obtaining parameters, and the obtained parameters are the model parameters of the prediction model, and the prediction is determined through training. After the model parameters of the model, the model can be used to predict future conditions.
  • the user in order to realize that the latest historical data can be collected as a training sample during training, the user sets a time span as a screening basis for the historical data, in order to ensure that the model can be performed based on the user's update request at any time.
  • Retraining and when the model is trained, the latest historical data can be obtained from the database, and the data in the database needs to be updated periodically or periodically.
  • the system prompts the user to update the database when the latest time-interval-compliant data is not obtained from the database.
  • the current time unit is determined according to the update request, and the time unit is the target time unit to be predicted, and the last time unit of the time unit is used as the termination time unit.
  • the time span set by the user is then determined, and the above termination time unit is the termination time unit of the time span.
  • the user may carry the time span change information in the sent update request, and the device detects, when the received update request, whether the update request includes the time span change information; if yes, according to the The time span change information modifies the time span of the current setting. If the time span change information is not included in the update request, the current default time span of the system may be obtained; or, in other embodiments, when the time span is not obtained from the update request, the time span setting interface is displayed, manually Settings.
  • the step of determining a time span set by the user includes:
  • the time span modified by the user based on the setting interface is taken as the time span set by the user.
  • the user may trigger a time span change instruction based on the interaction interface provided by the system, and when the device detects the time span change instruction, the device displays a time span setting interface, and uses the modified time span of the user as the interface.
  • the time span set by the user may trigger a time span change instruction based on the interaction interface provided by the system, and when the device detects the time span change instruction, the device displays a time span setting interface, and uses the modified time span of the user as the interface. The time span set by the user.
  • the acquired historical data is input as a training sample into a prediction model of the item to be tested for training to determine model parameters of the prediction model, and the prediction model is updated based on the determined model parameters.
  • the time interval is determined according to the time span and the termination time unit,
  • the time unit at the time of the request is the 20th week of 2017, which means that the percentage of influenza-like cases in the 20th week of 2017 is predicted, and the 19th week of 2017 is the termination time unit.
  • the time interval is determined from the 24th week of 2015 to the 19th week of 2017 based on the time span and the termination time unit.
  • the historical data belonging to the time phase is searched from the database as a training sample input into the prediction model for training to determine the model parameters.
  • the processor 12 is further configured to: perform an update procedure of the prediction model, and after obtaining the historical data matching the time interval from the database corresponding to the to-be-tested item, further implement The following steps:
  • step of acquiring the historical data matching the time interval from the database corresponding to the item to be tested is re-executed based on the updated database.
  • the historical data of some time units may not be obtained.
  • the time interval is from the 24th week of 2015 to the 19th week of 2017, but the database stores historical data of 156 weeks from the first week of 2014 to the 52nd week of 2016. Therefore, the data in the database needs to be updated.
  • the time interval of the missing historical data is from the first week of 2017 to the 19th week of 2017, and the data supplemental prompt information is generated based on the time interval, and the user pairs the information according to the information.
  • the missing historical data in the database is supplemented, and the database is updated based on the supplemental historical data, and the historical data matching the time interval is re-discovered.
  • the prediction model for training such as a time series model, using the data from the first week to the 100th week as the training sample training prediction model, and the incidence of the influenza-like case on the 101st week. Rate to make predictions.
  • the model parameters are learned according to the algorithm corresponding to the model, and the prediction model that determines the model parameters is updated to the latest prediction model.
  • the prediction model is continuously updated over time.
  • the current prediction model pair is used to terminate.
  • the percentage of influenza-like cases in the time unit is predicted, and it is judged whether the difference between the predicted value and the actual observation value is within the allowable error range. If so, the prediction accuracy of the current prediction model is considered to be in compliance with the requirement, and the prediction model is not performed. Update, if the difference exceeds the allowable error range, re-train the prediction model.
  • the updating device of the prediction model proposed by the embodiment determines the target time unit to be predicted according to the received update request triggered by the item to be tested, and determines the time span set by the user, and searches for the matching time from the database corresponding to the item to be tested.
  • the historical data corresponding to the time unit adjacent to the target time unit, the acquired historical data is input as a training sample into the prediction model of the test item to be trained to determine the model parameter of the prediction model, based on the determined model parameter pair
  • the prediction model is updated.
  • the scheme filters the historical data by setting the time span, and obtains the historical data closest to the target time unit as the training sample to retrain the model, and then re-determine the model parameters to realize the update of the model. Adaptation time advancement and data changes improve the prediction accuracy of the prediction model.
  • the update program of the predictive model may also be divided into one or more modules, one or more modules are stored in the memory 11 and executed by one or more processors (this implementation)
  • the processor 12 is executed to complete the application
  • a module referred to herein refers to a series of computer program instructions that are capable of performing a particular function.
  • FIG. 2 it is a functional block diagram of an update procedure of a prediction model in an embodiment of an update apparatus of a prediction model of the present application.
  • an update procedure of the prediction model may be divided into a determination module 10 and acquired.
  • Module 20 and training module 30, by way of example:
  • the determining module 10 is configured to determine a time unit to which the current predicted time belongs, and determine a time span set by the user;
  • the obtaining module 20 is configured to use the last time unit of the time unit as an end time unit, determine a time interval according to the end time unit and the time span, and obtain the time from the database corresponding to the item to be tested. Historical data of interval matching;
  • the training module 30 is configured to input the acquired historical data as a training sample into a prediction model of the item to be tested for training, determine model parameters of the prediction model, and update the prediction model based on the determined model parameters.
  • the present application also provides an update method of a prediction model.
  • FIG. 3 it is a flowchart of the first embodiment of the method for updating the prediction model of the present application.
  • the method can be performed by a device that can be implemented by software and/or hardware.
  • the update method of the prediction model includes:
  • step S10 the time unit to which the current predicted time belongs is determined, and the time span set by the user is determined.
  • the user terminal may send an update request, or trigger an update request based on the interaction interface provided by the device, and the system receives the update request or detects
  • the update request is made, a step of determining the time unit to which the current predicted time belongs is performed.
  • the prediction request may be sent by the user terminal, or the prediction request may be triggered based on the interaction interface provided by the device, when the system receives or detects the prediction request, Begin the above steps, update the prediction model and adopt the updated prediction model to predict based on the prediction request.
  • the continuous time is divided into a plurality of consecutive time units, that is, a plurality of consecutive time units constitute a time axis corresponding to the historical data.
  • Historical data is updated in units of time units in the time dimension.
  • the scheme is described by taking the week as a time unit.
  • the time period corresponding to other time units may also be used as a time unit, such as day, month, year, and the like.
  • the project to be tested is to predict the percentage of influenza-like cases in a certain area in the next week.
  • the percentage of influenza-like cases in a certain area is the total number of influenza-like cases in the sentinel hospitals in the area.
  • the proportion of people Assuming that the predictive model is a time series model, the database stores historical data as a percentage of the proportion of influenza samples.
  • the prediction model may also be a regression model or a classification model, such as a random forest model.
  • the historical data stored in the database of the project to be tested may be a percentage of the proportion of the influenza sample. Historical data can also be sample data obtained by preprocessing these data.
  • the process of training a model using training samples is a process of obtaining parameters in the function through machine learning, that is, a process of obtaining parameters, and the obtained parameters are the model parameters of the prediction model, and the prediction is determined through training. After the model parameters of the model, the model can be used to predict future conditions.
  • step S20 the last time unit of the time unit is used as the termination time unit, and the time interval is determined according to the termination time unit and the time span, and the time interval is matched from the database corresponding to the item to be tested. Historical data.
  • the user in order to be able to collect the latest historical data as a training sample during training, the user sets a time span as a screening basis for historical data, in order to ensure that the model can be performed based on the user's update request at any time. Retraining, and the latest historical data can be obtained from the database during model training, and the data in the database needs to be updated periodically or periodically. Or, when the database update is not timely, the system prompts the user to update the database when the latest time-interval-compliant data is not obtained from the database.
  • the user may carry time span change information in the sent update request, and the method detects, when the received update request, whether the update request includes time span change information; if yes, according to the The time span change information modifies the time span of the current setting. If the time span change information is not included in the update request, the current default time span of the system may be obtained; or, in other embodiments, when the time span is not obtained from the update request, the time span setting interface is displayed, manually Settings.
  • the step of determining a time span set by the user includes:
  • the time span modified by the user based on the setting interface is taken as the time span set by the user.
  • the user may trigger a time span change instruction based on the interaction interface provided by the system, and when the time span change instruction is detected, the method displays a time span setting interface, and uses the modified time span of the user as the interface. The time span set by the user.
  • Step S30 The acquired historical data is input as a training sample into the prediction model of the item to be tested for training to determine model parameters of the prediction model, and the prediction model is updated based on the determined model parameters.
  • the time interval is determined according to the time span and the termination time unit, and historical data matching the time interval is obtained from the database of influenza-like cases, assuming that the database stores the week from the first week of 2014 to the 52nd week of 2016.
  • a total of 156 weeks of historical data the time span is 100 weeks, assuming that the time unit when the user sends the update request is the 20th week of 2017, that is, the forecast of the percentage of influenza-like cases in the 20th week of 2017, 2017
  • the 19th week of the year is the termination time unit.
  • the time interval is determined from the 24th week of 2015 to the 19th week of 2017 based on the time span and the termination time unit.
  • the historical data belonging to the time phase is searched from the database as a training sample input into the prediction model for training to determine the model parameters.
  • step S20 the method further includes the following steps:
  • step of acquiring the historical data matching the time interval from the database corresponding to the item to be tested is re-executed based on the updated database.
  • the historical data of some time units may not be obtained.
  • the time interval is from the 24th week of 2015 to the 19th week of 2017, but the database stores historical data of 156 weeks from the first week of 2014 to the 52nd week of 2016. Therefore, the data in the database needs to be updated.
  • the time interval of the missing historical data is from the first week of 2017 to the 19th week of 2017, and the data supplemental prompt information is generated based on the time interval, and the user pairs the information according to the information.
  • the missing historical data in the database is supplemented, and the database is updated based on the supplemental historical data, and the historical data matching the time interval is re-discovered.
  • the prediction model for training such as a time series model, using the data from the first week to the 100th week as the training sample training prediction model, and the incidence of the influenza-like case on the 101st week. Rate to make predictions.
  • the model parameters are learned according to the algorithm corresponding to the model, and the prediction model that determines the model parameters is updated to the latest prediction model.
  • the prediction model is continuously updated over time.
  • the current prediction model pair is used to terminate.
  • the percentage of influenza-like cases in the time unit is predicted, and it is judged whether the difference between the predicted value and the actual observation value is within the allowable error range. If so, the prediction accuracy of the current prediction model is considered to be in compliance with the requirement, and the prediction model is not performed. Update, if the difference exceeds the allowable error range, re-train the prediction model.
  • the method for updating the prediction model proposed in this embodiment determines the target time unit to be predicted according to the received update request triggered by the item to be tested, and determines the time span set by the user, and searches for the matching time from the database corresponding to the item to be tested.
  • the historical data corresponding to the time unit adjacent to the target time unit, the acquired historical data is input as a training sample into the prediction model of the test item to be trained to determine the model parameter of the prediction model, based on the determined model parameter pair
  • the prediction model is updated.
  • the scheme filters the historical data by setting the time span, and obtains the historical data closest to the target time unit as the training sample to retrain the model, and then re-determine the model parameters to realize the update of the model. Adaptation time advancement and data changes improve the prediction accuracy of the prediction model.
  • the embodiment of the present application further provides a computer readable storage medium, where the update program of the prediction model is stored, and the update program of the prediction model may be executed by at least one processor to implement the following operating:
  • the acquired historical data is input as a training sample into a prediction model of the item to be tested for training to determine model parameters of the prediction model, and the prediction model is updated based on the determined model parameters.
  • step of acquiring the historical data matching the time interval from the database corresponding to the item to be tested is re-executed based on the updated database.
  • the time span modified by the user based on the setting interface is taken as the time span set by the user.
  • the technical solution of the present application which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM as described above). , a disk, an optical disk, including a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the methods described in the various embodiments of the present application.
  • a terminal device which may be a mobile phone, a computer, a server, or a network device, etc.

Abstract

Disclosed is an apparatus for updating a prediction model, the apparatus comprising: a memory and a processor, wherein the memory stores a program for updating a prediction model and capable of running on the processor. The following steps are implemented when the program is executed by the processor: determining a time unit to which a current prediction time belongs, and determining a time span set by a user; taking a previous time unit of the time unit as a termination time unit, determining a time interval according to the termination time unit and the time span, and acquiring, from a database, historical data matching the time interval; and inputting the acquired historical data, which acts as a training sample, into a prediction model of an item to be tested for training so as to determine a model parameter of the prediction model, and updating the prediction model on the basis of the determined model parameter. The present application also puts forward a method for updating a prediction model, and a computer-readable storage medium. The present application improves the prediction accuracy of the prediction model.

Description

预测模型的更新装置、方法及计算机可读存储介质Update device, method and computer readable storage medium for predictive model
本申请基于巴黎公约申明享有2017年8月29日递交的申请号为201710754335.6、名称为“预测模型的更新装置、方法及计算机可读存储介质”的中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。The present application is based on the priority of the Chinese Patent Application entitled "Update Device, Method and Computer-Readable Storage Medium for Predictive Model", filed on August 29, 2017, with the application number of 201710754335.6, which is filed on August 29, 2017. The entire content is incorporated herein by reference.
技术领域Technical field
本申请涉及终端技术领域,尤其涉及一种预测模型的更新装置、方法及计算机可读存储介质。The present application relates to the field of terminal technologies, and in particular, to an apparatus, method, and computer readable storage medium for updating a prediction model.
背景技术Background technique
在现有的数据统计应用领域,常常会用到预测模型,例如,对于某个地区未来一段时间内流感样病例百分比进行预测、对某个广告未来一段时间内的点击率的预测等等,目前传统的方法是用历史一段时间的数据建立预测模型作为固定的预测模型,对下一段时间的表现进行预测,然而,随着时间的推进,预测模型的预测精准度会逐步降低。In existing data statistics applications, predictive models are often used, for example, to predict the percentage of influenza-like cases in a region in the future, and to predict the click-through rate of an ad in the future. The traditional method is to use the historical data to establish a prediction model as a fixed prediction model to predict the performance of the next period of time. However, as time progresses, the prediction accuracy of the prediction model will gradually decrease.
发明内容Summary of the invention
本申请提供一种预测模型的更新装置、方法及计算机可读存储介质,其主要目的在于提高预测模型的预测精准度。The present application provides an apparatus, method, and computer readable storage medium for predicting a model, the main purpose of which is to improve the prediction accuracy of the prediction model.
为实现上述目的,本申请提供一种预测模型的更新装置,该装置包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的预测模型的更新程序,所述预测模型的更新程序被所述处理器执行时实现如下步骤:To achieve the above object, the present application provides an apparatus for updating a prediction model, the apparatus comprising: a memory, a processor, and an update program of a prediction model stored on the memory and operable on the processor, the prediction The update procedure of the model is implemented by the processor to implement the following steps:
确定当前的预测时间所属的时间单元,并确定用户设置的时间跨度;Determining the time unit to which the current predicted time belongs, and determining the time span set by the user;
将所述时间单元的上一个时间单元作为终止时间单元,根据所述终止时间单元和所述时间跨度确定时间区间,从所述待测项目对应的数据库中获取与所述时间区间匹配的历史数据;Taking a previous time unit of the time unit as an end time unit, determining a time interval according to the end time unit and the time span, and acquiring historical data matching the time interval from a database corresponding to the item to be tested ;
将获取到的历史数据作为训练样本输入到所述待测项目的预测模型中进行训练,以确定所述预测模型的模型参数,基于确定的模型参数更新所述预 测模型。The acquired historical data is input as a training sample into a prediction model of the item to be tested for training to determine model parameters of the prediction model, and the prediction model is updated based on the determined model parameters.
此外,为实现上述目的,本申请还提供一种预测模型的更新方法,该方法包括:In addition, to achieve the above object, the present application further provides a method for updating a prediction model, the method comprising:
确定当前的预测时间所属的时间单元,并确定用户设置的时间跨度;Determining the time unit to which the current predicted time belongs, and determining the time span set by the user;
将所述时间单元的上一个时间单元作为终止时间单元,根据所述终止时间单元和所述时间跨度确定时间区间,从所述待测项目对应的数据库中获取与所述时间区间匹配的历史数据;Taking a previous time unit of the time unit as an end time unit, determining a time interval according to the end time unit and the time span, and acquiring historical data matching the time interval from a database corresponding to the item to be tested ;
将获取到的历史数据作为训练样本输入到所述待测项目的预测模型中进行训练,以确定所述预测模型的模型参数,基于确定的模型参数更新所述预测模型。The acquired historical data is input as a training sample into a prediction model of the item to be tested for training to determine model parameters of the prediction model, and the prediction model is updated based on the determined model parameters.
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有预测模型的更新程序,所述预测模型的更新程序可被至少一个处理器执行,以实现如上所述的预测模型的更新方法的步骤。In addition, in order to achieve the above object, the present application further provides a computer readable storage medium, where the update program of a prediction model is stored, and the update program of the prediction model can be executed by at least one processor. To implement the steps of the update method of the predictive model as described above.
本申请提出的预测模型的更新装置、方法及计算机可读存储介质,接收到基于待测项目触发的更新请求时,确定当前时间所属的时间单元,并确定用户设置的时间跨度,将时间单元作为终止时间单元,根据终止时间单元和时间跨度确定时间区间,从待测项目对应的数据库中获取与时间区间匹配的历史数据,将获取到的历史数据作为训练样本输入到待测项目的预测模型中进行训练以确定预测模型的模型参数,基于确定的模型参数对预测模型进行更新,本方案通过设置时间跨度的方式对历史数据进行筛选,得到距离目标时间单元最近的历史数据作为训练样本对模型进行重新训练,进而重新确定模型参数以实现对模型的更新,以适应时间的推进、数据的变化,提高了预测模型的预测精准度。The updating device, the method and the computer readable storage medium of the prediction model proposed by the present application determine the time unit to which the current time belongs when receiving the update request triggered by the item to be tested, and determine the time span set by the user, and use the time unit as Terminating the time unit, determining the time interval according to the termination time unit and the time span, obtaining historical data matching the time interval from the database corresponding to the item to be tested, and inputting the acquired historical data as a training sample into the prediction model of the item to be tested. The training is performed to determine the model parameters of the prediction model, and the prediction model is updated based on the determined model parameters. The scheme filters the historical data by setting the time span, and obtains the historical data closest to the target time unit as the training sample. Retraining, and then re-determining the model parameters to achieve the update of the model to adapt to the advancement of time, data changes, and improve the prediction accuracy of the prediction model.
附图说明DRAWINGS
图1为本申请预测模型的更新装置较佳实施例的示意图;1 is a schematic diagram of a preferred embodiment of an apparatus for updating a prediction model of the present application;
图2为本申请预测模型的更新装置一实施例中预测模型的更新程序的功能模块示意图;2 is a schematic diagram of functional modules of an update procedure of a prediction model in an embodiment of an update apparatus for a prediction model of the present application;
图3为本申请预测模型的更新方法第一实施例的流程图。FIG. 3 is a flowchart of a first embodiment of a method for updating a prediction model of the present application.
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步 说明。The implementation, functional features, and advantages of the present application will be further described with reference to the accompanying drawings.
具体实施方式Detailed ways
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。It is understood that the specific embodiments described herein are merely illustrative of the application and are not intended to be limiting.
本申请提供一种预测模型的更新装置。参照图1所示,为本申请预测模型的更新装置较佳实施例的示意图。The application provides an update device for a predictive model. Referring to FIG. 1, a schematic diagram of a preferred embodiment of an apparatus for updating a prediction model of the present application is shown.
在本实施例中,预测模型的更新装置可以是PC(Personal Computer,个人电脑),也可以是智能手机、平板电脑、便携计算机等终端设备。In this embodiment, the update device of the predictive model may be a PC (Personal Computer), or may be a terminal device such as a smart phone, a tablet computer, or a portable computer.
该预测模型的更新装置包括存储器11、处理器12,通信总线13,以及网络接口14。The updating device of the predictive model includes a memory 11, a processor 12, a communication bus 13, and a network interface 14.
其中,存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、磁性存储器、磁盘、光盘等。存储器11在一些实施例中可以是预测模型的更新装置的内部存储单元,例如该预测模型的更新装置的硬盘。存储器11在另一些实施例中也可以是预测模型的更新装置的外部存储设备,例如预测模型的更新装置上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器11还可以既包括预测模型的更新装置的内部存储单元也包括外部存储设备。存储器11不仅可以用于存储安装于预测模型的更新装置的应用软件及各类数据,例如预测模型的更新程序的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。The memory 11 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (for example, an SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like. The memory 11 may in some embodiments be an internal storage unit of the update device of the predictive model, such as the hard disk of the update device of the predictive model. The memory 11 may also be an external storage device of the update device of the predictive model in other embodiments, such as a plug-in hard disk equipped with an update device of the predictive model, a smart memory card (SMC), and a secure digital (Secure) Digital, SD) cards, flash cards, etc. Further, the memory 11 may also include an internal storage unit of the update device including the prediction model and an external storage device. The memory 11 can be used not only for storing application software of the update device installed in the prediction model and various types of data, such as codes of the update program of the prediction model, but also for temporarily storing data that has been output or is to be output.
处理器12在一些实施例中可以是一中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器或其他数据处理芯片,用于运行存储器11中存储的程序代码或处理数据,例如执行预测模型的更新程序等。The processor 12, in some embodiments, may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor or other data processing chip for running program code or processing stored in the memory 11. Data, such as an update program that performs a predictive model, and the like.
通信总线13用于实现这些组件之间的连接通信。 Communication bus 13 is used to implement connection communication between these components.
网络接口14可选的可以包括标准的有线接口、无线接口(如WI-FI接口),通常用于在该装置与其他电子设备之间建立通信连接。The network interface 14 can optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), and is typically used to establish a communication connection between the device and other electronic devices.
图1仅示出了具有组件11-14以及预测模型的更新程序的预测模型的更新装置,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更 多或者更少的组件。Figure 1 shows only the updating means of the predictive model with the components 11-14 and the update program of the predictive model, but it should be understood that not all of the illustrated components are required to be implemented, and that more or less can be implemented instead. Component.
可选地,该装置还可以包括用户接口,用户接口可以包括显示器(Display)、输入单元比如键盘(Keyboard),可选的用户接口还可以包括标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在预测模型的更新装置中处理的信息以及用于显示可视化的用户界面。Optionally, the device may further include a user interface, the user interface may include a display, an input unit such as a keyboard, and the optional user interface may further include a standard wired interface and 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) touch sensor, or the like. The display may also be suitably referred to as a display screen or display unit for displaying information processed in the update device of the predictive model and a user interface for displaying the visualization.
可选地,该装置还可以包括触摸传感器。所述触摸传感器所提供的供用户进行触摸操作的区域称为触控区域。此外,这里所述的触摸传感器可以为电阻式触摸传感器、电容式触摸传感器等。而且,所述触摸传感器不仅包括接触式的触摸传感器,也可包括接近式的触摸传感器等。此外,所述触摸传感器可以为单个传感器,也可以为例如阵列布置的多个传感器。该装置的显示器的面积可以与所述触摸传感器的面积相同,也可以不同。可选地,将显示器与所述触摸传感器层叠设置,以形成触摸显示屏。该装置基于触摸显示屏侦测用户触发的触控操作。Optionally, the device may also include a touch sensor. The area provided by the touch sensor for the user to perform a touch operation is referred to as a touch area. Further, the touch sensor described herein may be a resistive touch sensor, a capacitive touch sensor, or the like. Moreover, the touch sensor includes not only a contact type touch sensor but also a proximity type touch sensor or the like. Furthermore, the touch sensor may be a single sensor or a plurality of sensors arranged, for example, in an array. The area of the display of the device may be the same as or different from the area of the touch sensor. Optionally, a display is stacked with the touch sensor to form a touch display. The device detects a user-triggered touch operation based on a touch screen display.
可选地,该装置还可以包括摄像头、RF(Radio Frequency,射频)电路,传感器、音频电路、WiFi模块等。其中,传感器比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,若该装置为移动终端,环境光传感器可根据环境光线的明暗来调节显示屏的亮度,接近传感器可在移动终端移动到耳边时,关闭显示屏和/或背光。作为运动传感器的一种,重力加速度传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别移动终端姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;当然,移动终端还可配置陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。Optionally, the device may further include a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, and the like. Among them, sensors such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein if the device is a mobile terminal, the ambient light sensor may adjust the brightness of the display screen according to the brightness of the ambient light, and the proximity sensor may move when the mobile terminal moves to the ear. , turn off the display and / or backlight. As a kind of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (usually three axes), and can detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of the mobile terminal (such as horizontal and vertical screen switching, Related games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping), etc.; of course, the mobile terminal can also be equipped with other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared sensor, etc. No longer.
在图1所示的装置实施例中,存储器11中存储有预测模型的更新程序;处理器12执行存储器11中存储的预测模型的更新程序时实现如下步骤:In the apparatus embodiment shown in FIG. 1, an update program of a prediction model is stored in the memory 11; when the processor 12 executes an update program of the prediction model stored in the memory 11, the following steps are implemented:
确定当前的预测时间所属的时间单元,并确定用户设置的时间跨度。Determine the time unit to which the current forecast time belongs and determine the time span set by the user.
该实施例提出的方案中,用户需要对待测项目的预测模型进行更新时,可以通过用户终端发送更新请求,或者基于该装置提供的交互界面触发更新 请求,系统在接收到更新请求或者在侦测到更新请求时,开始执行上述步骤。或者用户需要使用预测模型对未来某时间单元的情况进行预测时,可以通过用户终端发送预测请求,或基于该装置提供的交互界面触发预测请求,该装置在接收到或者在侦测到预测请求时,开始执行上述步骤,对预测模型进行更新并采用更新后的预测模型,根据预测请求进行预测。该实施例中,将连续的时间划分为连续的多个时间单元,即多个连续的时间单元构成历史数据对应的时间轴。在时间维度上,以时间单元为单位对历史数据进行更新。下文中以周作为一个时间单元为例对该方案进行说明,在其他的实施例中,也可以采用其他的时间单位对应的时间段作为一个时间单元,例如天、月、年等。In the solution proposed by the embodiment, when the user needs to update the prediction model of the item to be tested, the user terminal may send an update request, or trigger an update request based on the interaction interface provided by the device, and the system receives the update request or detects When the update request is reached, the above steps are started. Or when the user needs to use the prediction model to predict the situation of a certain time unit in the future, the prediction request may be sent by the user terminal, or the prediction request may be triggered based on the interaction interface provided by the device, when the device receives or detects the prediction request. , start the above steps, update the prediction model and adopt the updated prediction model to predict based on the prediction request. In this embodiment, the continuous time is divided into a plurality of consecutive time units, that is, a plurality of consecutive time units constitute a time axis corresponding to the historical data. Historical data is updated in units of time units in the time dimension. In the following, the scheme is described by taking the week as a time unit. In other embodiments, the time period corresponding to other time units may also be used as a time unit, such as day, month, year, and the like.
例如,待测项目为对某地区的下一周的流感样病例百分比进行预测,其中,某地区的流感样病例百分比为该地区各哨点医院流感样病例总数在该地区各哨点医院门诊总就诊人次中占的比例。假设预测模型为时间序列模型,则数据库中存储有流感样比例的百分比的历史数据。在其他实施例中,预测模型也可以是回归模型或者分类模型,例如随机森林模型,对于回归模型或者分类模型来说,该待测项目的数据库中存储的历史数据可以是流感样比例的百分比的历史数据,也可以是对这些数据进行预处理得到的样本数据。For example, the project to be tested is to predict the percentage of influenza-like cases in a certain area in the next week. The percentage of influenza-like cases in a certain area is the total number of influenza-like cases in the sentinel hospitals in the area. The proportion of people. Assuming that the predictive model is a time series model, the database stores historical data as a percentage of the proportion of influenza samples. In other embodiments, the prediction model may also be a regression model or a classification model, such as a random forest model. For a regression model or a classification model, the historical data stored in the database of the project to be tested may be a percentage of the proportion of the influenza sample. Historical data can also be sample data obtained by preprocessing these data.
简单地说,一个预测模型可以理解为一个函数y=f(x 1、x 2、x 3……x n),该函数反映输出结果y与输入特征(x 1、x 2、x 3……x n)之间的关系。使用训练样本对模型进行训练的过程就是一个通过机器学习获取该函数中的参数的过程,即一个求参的过程,获取到的参数即为该预测模型的模型参数,当通过训练确定了该预测模型的模型参数后,则可以使用该模型对未来的情况进行预测。 Simply put, a prediction model can be understood as a function y = f (x 1 , x 2 , x 3 ... x n ), which reflects the output y and the input characteristics (x 1 , x 2 , x 3 ... The relationship between x n ). The process of training a model using training samples is a process of obtaining parameters in the function through machine learning, that is, a process of obtaining parameters, and the obtained parameters are the model parameters of the prediction model, and the prediction is determined through training. After the model parameters of the model, the model can be used to predict future conditions.
将所述时间单元的上一个时间单元作为终止时间单元,根据所述终止时间单元和所述时间跨度确定时间区间,从所述待测项目对应的数据库中获取与所述时间区间匹配的历史数据。Taking a previous time unit of the time unit as an end time unit, determining a time interval according to the end time unit and the time span, and acquiring historical data matching the time interval from a database corresponding to the item to be tested .
在本实施例中,为了实现在训练时能够采集最新的历史数据作为训练样本,用户设定一个时间跨度,将其作为历史数据的筛选依据,为了保证能够随时地基于用户的更新请求对模型进行重新训练,并且在模型训练时,能够从数据库中获取到最新的历史数据,需要定时地或者周期性地对数据库中的 数据进行更新。或者,在数据库更新不及时的情况下,导致从数据库中获取不到最新的符合时间区间的数据时,系统提示用户对数据库进行更新。In this embodiment, in order to realize that the latest historical data can be collected as a training sample during training, the user sets a time span as a screening basis for the historical data, in order to ensure that the model can be performed based on the user's update request at any time. Retraining, and when the model is trained, the latest historical data can be obtained from the database, and the data in the database needs to be updated periodically or periodically. Or, when the database update is not timely, the system prompts the user to update the database when the latest time-interval-compliant data is not obtained from the database.
根据更新请求确定当前的时间单元,该时间单元即为待预测的目标时间单元,将该时间单元的上一个时间单元作为终止时间单元。然后确定用户设置的时间跨度,上述终止时间单元为该时间跨度的终止时间单元。关于时间跨度的设置方式可以有多种,以下列举其中的两种方式进行说明。在一实施例中,用户可以在发送的更新请求中携带时间跨度变更信息,该装置在接收到的更新请求时,检测所述更新请求中是否包含有时间跨度变更信息;若有,则按照所述时间跨度变更信息修改当前设置的时间跨度。如果更新请求中没有包含时间跨度变更信息,可以获取系统当前默认的时间跨度;或者,在其他实施例中,在从更新请求中获取不到时间跨度时,显示时间跨度的设置界面,由用户手动设置。The current time unit is determined according to the update request, and the time unit is the target time unit to be predicted, and the last time unit of the time unit is used as the termination time unit. The time span set by the user is then determined, and the above termination time unit is the termination time unit of the time span. There are various ways to set the time span, and two of them are described below. In an embodiment, the user may carry the time span change information in the sent update request, and the device detects, when the received update request, whether the update request includes the time span change information; if yes, according to the The time span change information modifies the time span of the current setting. If the time span change information is not included in the update request, the current default time span of the system may be obtained; or, in other embodiments, when the time span is not obtained from the update request, the time span setting interface is displayed, manually Settings.
作为另一种实施方式,确定用户设置的时间跨度的步骤包括:As another implementation manner, the step of determining a time span set by the user includes:
在检测到时间跨度变更指令时,显示时间跨度的设置界面,以供用户基于所述设置界面修改当前设置的时间跨度;When the time span change instruction is detected, displaying a time span setting interface for the user to modify the currently set time span based on the setting interface;
将用户基于所述设置界面修改后的时间跨度作为用户设置的时间跨度。The time span modified by the user based on the setting interface is taken as the time span set by the user.
在该实施例中,用户可以基于系统提供的交互界面触发时间跨度变更指令,该装置在检测到时间跨度变更指令时,显示时间跨度的设置界面,并将用户基于该界面修改后的时间跨度作为用户设置的时间跨度。In this embodiment, the user may trigger a time span change instruction based on the interaction interface provided by the system, and when the device detects the time span change instruction, the device displays a time span setting interface, and uses the modified time span of the user as the interface. The time span set by the user.
将获取到的历史数据作为训练样本输入到所述待测项目的预测模型中进行训练,以确定所述预测模型的模型参数,基于确定的模型参数更新所述预测模型。The acquired historical data is input as a training sample into a prediction model of the item to be tested for training to determine model parameters of the prediction model, and the prediction model is updated based on the determined model parameters.
在确定时间跨度之后,根据时间跨度以及终止时间单元确定时间区间,After determining the time span, the time interval is determined according to the time span and the termination time unit,
从流感样病例将的数据库中获取与时间区间匹配的历史数据,假设数据库中存储的是2014年第1周至2016年第52周共156周的历史数据,时间跨度为100周,假设用户发送更新请求时的时间单元为2017年的第20周,也就说要对2017年第20周的流感样病例百分比进行预测,则2017年的第19周即为终止时间单元。根据时间跨度以及终止时间单元确定时间区间为2015年的第24周至2017年的第19周。从数据库中查找属于该时间阶段的历史数据作为训练样本输入到预测模型中进行训练以确定模型参数。Obtain historical data matching the time interval from the database of influenza-like cases, assuming that the database stores 156 weeks of historical data from week 1 of 2014 to week 52 of 2016, with a time span of 100 weeks, assuming users send updates. The time unit at the time of the request is the 20th week of 2017, which means that the percentage of influenza-like cases in the 20th week of 2017 is predicted, and the 19th week of 2017 is the termination time unit. The time interval is determined from the 24th week of 2015 to the 19th week of 2017 based on the time span and the termination time unit. The historical data belonging to the time phase is searched from the database as a training sample input into the prediction model for training to determine the model parameters.
可选地,作为一种实施方式,处理器12还用于执行预测模型的更新程序,在从所述待测项目对应的数据库中获取与所述时间区间匹配的历史数据的步骤之后,还实现如下步骤:Optionally, as an implementation manner, the processor 12 is further configured to: perform an update procedure of the prediction model, and after obtaining the historical data matching the time interval from the database corresponding to the to-be-tested item, further implement The following steps:
当从所述数据库中获取不到符合所述时间跨度、且与所述目标时间单元相邻的时间单元对应的历史数据时,确定缺失历史数据的时间区间;Determining a time interval of missing historical data when no historical data corresponding to the time span corresponding to the time span and adjacent to the target time unit is acquired from the database;
基于确定的时间区间生成数据补充提示信息,以供用户基于所述提示信息更新数据库以补充缺失的历史数据;Generating data supplemental prompt information based on the determined time interval for the user to update the database based on the prompt information to supplement the missing historical data;
基于更新后的数据库重新执行所述从所述待测项目对应的数据库中获取与所述时间区间匹配的历史数据的步骤。And the step of acquiring the historical data matching the time interval from the database corresponding to the item to be tested is re-executed based on the updated database.
在上述历史数据获取过程中,当数据库中的流感样病例数据没有及时更新时,会有部分时间单元的历史数据获取不到。例如,上述例子中时间区间是为2015年的第24周至2017年的第19周,但是数据库中存储的是2014年第1周至2016年第52周共156周的历史数据。因此,需要对数据库中的数据进行更新,此时确定缺失历史数据的时间区间为2017年的第1周至2017年的第19周,则基于该时间区间生成数据补充提示信息,用户根据该信息对数据库中缺失的历史数据进行补充,并根据补充的历史数据对数据库进行更新,并重新查找时间区间匹配的历史数据。In the above historical data acquisition process, when the influenza-like case data in the database is not updated in time, the historical data of some time units may not be obtained. For example, in the above example, the time interval is from the 24th week of 2015 to the 19th week of 2017, but the database stores historical data of 156 weeks from the first week of 2014 to the 52nd week of 2016. Therefore, the data in the database needs to be updated. At this time, it is determined that the time interval of the missing historical data is from the first week of 2017 to the 19th week of 2017, and the data supplemental prompt information is generated based on the time interval, and the user pairs the information according to the information. The missing historical data in the database is supplemented, and the database is updated based on the supplemental historical data, and the historical data matching the time interval is re-discovered.
在查找到历史数据后,将其作为训练样本输入到预测模型中进行训练,例如时间序列模型,使用第1周至第100周的数据作为训练样本训练预测模型,对第101周的流感样病例发病率进行预测。在训练时,按照模型对应的算法进行学习获取模型参数,将确定了模型参数的预测模型更新为最新的预测模型。按照上述方案,在对第102周的流感样病例发病率进行预测时,使用第2周至第101周的数据作为训练样本训练预测模型,以此类推,随着时间的迁移,预测模型不断更新。After finding the historical data, it is input as a training sample into the prediction model for training, such as a time series model, using the data from the first week to the 100th week as the training sample training prediction model, and the incidence of the influenza-like case on the 101st week. Rate to make predictions. During training, the model parameters are learned according to the algorithm corresponding to the model, and the prediction model that determines the model parameters is updated to the latest prediction model. According to the above scheme, when the incidence of influenza-like cases in the 102nd week is predicted, the data from the 2nd week to the 101st week is used as the training sample training prediction model, and so on, the prediction model is continuously updated over time.
进一步地,在一些实施例中,为了提高建模效率,在将获取到的历史数据作为训练样本输入到所述待测项目的预测模型中进行训练的步骤之前,先使用当前的预测模型对终止时间单元的流感样病例百分比进行预测,并判断预测值与实际观测值之间的差值是否位于允许的误差范围内,若是,则认为当前的预测模型的预测精准度符合要求,不对预测模型进行更新,若差值超出允许的误差范围,则重新对预测模型进行训练。Further, in some embodiments, in order to improve the modeling efficiency, before the step of training the acquired historical data as a training sample into the prediction model of the test item, the current prediction model pair is used to terminate. The percentage of influenza-like cases in the time unit is predicted, and it is judged whether the difference between the predicted value and the actual observation value is within the allowable error range. If so, the prediction accuracy of the current prediction model is considered to be in compliance with the requirement, and the prediction model is not performed. Update, if the difference exceeds the allowable error range, re-train the prediction model.
本实施例提出的预测模型的更新装置,根据接收到的基于待测项目触发的更新请求确定待预测的目标时间单元,并确定用户设置的时间跨度,从待测项目对应的数据库中查找符合时间跨度且与目标时间单元相邻的时间单元对应的历史数据,将获取到的历史数据作为训练样本输入到待测项目的预测模型中进行训练以确定预测模型的模型参数,基于确定的模型参数对预测模型进行更新,本方案通过设置时间跨度的方式对历史数据进行筛选,得到距离目标时间单元最近的历史数据作为训练样本对模型进行重新训练,进而重新确定模型参数以实现对模型的更新,以适应时间的推进、数据的变化,提高了预测模型的预测精准度。The updating device of the prediction model proposed by the embodiment determines the target time unit to be predicted according to the received update request triggered by the item to be tested, and determines the time span set by the user, and searches for the matching time from the database corresponding to the item to be tested. The historical data corresponding to the time unit adjacent to the target time unit, the acquired historical data is input as a training sample into the prediction model of the test item to be trained to determine the model parameter of the prediction model, based on the determined model parameter pair The prediction model is updated. The scheme filters the historical data by setting the time span, and obtains the historical data closest to the target time unit as the training sample to retrain the model, and then re-determine the model parameters to realize the update of the model. Adaptation time advancement and data changes improve the prediction accuracy of the prediction model.
可选地,在其他的实施例中,预测模型的更新程序还可以被分割为一个或者多个模块,一个或者多个模块被存储于存储器11中,并由一个或多个处理器(本实施例为处理器12)所执行,以完成本申请,本申请所称的模块是指能够完成特定功能的一系列计算机程序指令段。例如,参照图2所示,为本申请预测模型的更新装置一实施例中的预测模型的更新程序的功能模块示意图,该实施例中,预测模型的更新程序可以被分割为确定模块10、获取模块20以及训练模块30,示例性地:Optionally, in other embodiments, the update program of the predictive model may also be divided into one or more modules, one or more modules are stored in the memory 11 and executed by one or more processors (this implementation) For example, the processor 12) is executed to complete the application, and a module referred to herein refers to a series of computer program instructions that are capable of performing a particular function. For example, referring to FIG. 2, it is a functional block diagram of an update procedure of a prediction model in an embodiment of an update apparatus of a prediction model of the present application. In this embodiment, an update procedure of the prediction model may be divided into a determination module 10 and acquired. Module 20 and training module 30, by way of example:
确定模块10用于确定当前的预测时间所属的时间单元,并确定用户设置的时间跨度;The determining module 10 is configured to determine a time unit to which the current predicted time belongs, and determine a time span set by the user;
获取模块20用于将所述时间单元的上一个时间单元作为终止时间单元,根据所述终止时间单元和所述时间跨度确定时间区间,从所述待测项目对应的数据库中获取与所述时间区间匹配的历史数据;The obtaining module 20 is configured to use the last time unit of the time unit as an end time unit, determine a time interval according to the end time unit and the time span, and obtain the time from the database corresponding to the item to be tested. Historical data of interval matching;
训练模块30用于将获取到的历史数据作为训练样本输入到所述待测项目的预测模型中进行训练,以确定所述预测模型的模型参数,基于确定的模型参数更新所述预测模型。The training module 30 is configured to input the acquired historical data as a training sample into a prediction model of the item to be tested for training, determine model parameters of the prediction model, and update the prediction model based on the determined model parameters.
上述确定模块10、获取模块20以及训练模块30被执行所实现的功能或操作步骤与上述实施例大体相同,在此不再赘述。The functions or operation steps performed by the above-mentioned determination module 10, the acquisition module 20, and the training module 30 are substantially the same as those of the foregoing embodiment, and are not described herein again.
此外,本申请还提供一种预测模型的更新方法。参照图3所示,为本申请预测模型的更新方法第一实施例的流程图。该方法可以由一个装置执行,该装置可以由软件和/或硬件实现。In addition, the present application also provides an update method of a prediction model. Referring to FIG. 3, it is a flowchart of the first embodiment of the method for updating the prediction model of the present application. The method can be performed by a device that can be implemented by software and/or hardware.
在本实施例中,预测模型的更新方法包括:In this embodiment, the update method of the prediction model includes:
步骤S10,确定当前的预测时间所属的时间单元,并确定用户设置的时间跨度。In step S10, the time unit to which the current predicted time belongs is determined, and the time span set by the user is determined.
该实施例提出的方案中,用户需要对待测项目的预测模型进行更新时,可以通过用户终端发送更新请求,或者基于该装置提供的交互界面触发更新请求,系统在接收到更新请求或者在侦测到更新请求时,执行确定当前的预测时间所属的时间单元的步骤。或者用户需要使用预测模型对未来某时间单元的情况进行预测时,可以通过用户终端发送预测请求,或基于该装置提供的交互界面触发预测请求,系统在接收到或者在侦测到预测请求时,开始执行上述步骤,对预测模型进行更新并采用更新后的预测模型,根据预测请求进行预测。该实施例中,将连续的时间划分为连续的多个时间单元,即多个连续的时间单元构成历史数据对应的时间轴。在时间维度上,以时间单元为单位对历史数据进行更新。下文中以周作为一个时间单元为例对该方案进行说明,在其他的实施例中,也可以采用其他的时间单位对应的时间段作为一个时间单元,例如天、月、年等。In the solution proposed by the embodiment, when the user needs to update the prediction model of the item to be tested, the user terminal may send an update request, or trigger an update request based on the interaction interface provided by the device, and the system receives the update request or detects When the update request is made, a step of determining the time unit to which the current predicted time belongs is performed. Or when the user needs to use the prediction model to predict the situation of a certain time unit in the future, the prediction request may be sent by the user terminal, or the prediction request may be triggered based on the interaction interface provided by the device, when the system receives or detects the prediction request, Begin the above steps, update the prediction model and adopt the updated prediction model to predict based on the prediction request. In this embodiment, the continuous time is divided into a plurality of consecutive time units, that is, a plurality of consecutive time units constitute a time axis corresponding to the historical data. Historical data is updated in units of time units in the time dimension. In the following, the scheme is described by taking the week as a time unit. In other embodiments, the time period corresponding to other time units may also be used as a time unit, such as day, month, year, and the like.
例如,待测项目为对某地区的下一周流感样病例百分比为进行预测,其中,某地区的流感样病例百分比为该地区各哨点医院流感样病例总数在该地区各哨点医院门诊总就诊人次中占的比例。假设预测模型为时间序列模型,则数据库中存储有流感样比例的百分比的历史数据。在其他实施例中,预测模型也可以是回归模型或者分类模型,例如随机森林模型,对于回归模型或者分类模型来说,该待测项目的数据库中存储的历史数据可以是流感样比例的百分比的历史数据,也可以是对这些数据进行预处理得到的样本数据。For example, the project to be tested is to predict the percentage of influenza-like cases in a certain area in the next week. The percentage of influenza-like cases in a certain area is the total number of influenza-like cases in the sentinel hospitals in the area. The proportion of people. Assuming that the predictive model is a time series model, the database stores historical data as a percentage of the proportion of influenza samples. In other embodiments, the prediction model may also be a regression model or a classification model, such as a random forest model. For a regression model or a classification model, the historical data stored in the database of the project to be tested may be a percentage of the proportion of the influenza sample. Historical data can also be sample data obtained by preprocessing these data.
简单地说,一个预测模型可以理解为一个函数y=f(x 1、x 2、x 3……x n),该函数反映输出结果y与输入特征(x 1、x 2、x 3……x n)之间的关系。使用训练样本对模型进行训练的过程就是一个通过机器学习获取该函数中的参数的过程,即一个求参的过程,获取到的参数即为该预测模型的模型参数,当通过训练确定了该预测模型的模型参数后,则可以使用该模型对未来的情况进行预测。 Simply put, a prediction model can be understood as a function y = f (x 1 , x 2 , x 3 ... x n ), which reflects the output y and the input characteristics (x 1 , x 2 , x 3 ... The relationship between x n ). The process of training a model using training samples is a process of obtaining parameters in the function through machine learning, that is, a process of obtaining parameters, and the obtained parameters are the model parameters of the prediction model, and the prediction is determined through training. After the model parameters of the model, the model can be used to predict future conditions.
步骤S20,将所述时间单元的上一个时间单元作为终止时间单元,根据所述终止时间单元和所述时间跨度确定时间区间,从所述待测项目对应的数据库中获取与所述时间区间匹配的历史数据。In step S20, the last time unit of the time unit is used as the termination time unit, and the time interval is determined according to the termination time unit and the time span, and the time interval is matched from the database corresponding to the item to be tested. Historical data.
在本实施例中,为了能够在训练时能够采集最新的历史数据作为训练样本,用户设定一个时间跨度,将其作为历史数据的筛选依据,为了保证能够随时地基于用户的更新请求对模型进行重新训练,并且在模型训练时能够从数据库中获取到最新的历史数据,需要定时地或者周期性地对数据库中的数据进行更新。或者,在数据库更新不及时的情况下,导致从数据库中获取不到最新的符合时间区间的数据时,系统提示用户对数据库进行更新。In this embodiment, in order to be able to collect the latest historical data as a training sample during training, the user sets a time span as a screening basis for historical data, in order to ensure that the model can be performed based on the user's update request at any time. Retraining, and the latest historical data can be obtained from the database during model training, and the data in the database needs to be updated periodically or periodically. Or, when the database update is not timely, the system prompts the user to update the database when the latest time-interval-compliant data is not obtained from the database.
根据更新请求确定当前的时间单元,该时间单元即为待预测的目标时间单元,将该时间单元的上一个时间单元作为终止时间单元,然后确定用户设置的时间跨度,上述终止时间单元为该时间跨度的终止时间单元。关于时间跨度的设置方式可以有多种,以下列举其中的两种方式进行说明。在一实施例中,用户可以在发送的更新请求中携带时间跨度变更信息,该方法在接收到的更新请求时,检测所述更新请求中是否包含有时间跨度变更信息;若有,则按照所述时间跨度变更信息修改当前设置的时间跨度。如果更新请求中没有包含时间跨度变更信息,可以获取系统当前默认的时间跨度;或者,在其他实施例中,在从更新请求中获取不到时间跨度时,显示时间跨度的设置界面,由用户手动设置。Determining a current time unit according to the update request, the time unit being the target time unit to be predicted, using the last time unit of the time unit as the termination time unit, and then determining the time span set by the user, where the termination time unit is the time The termination time unit of the span. There are various ways to set the time span, and two of them are described below. In an embodiment, the user may carry time span change information in the sent update request, and the method detects, when the received update request, whether the update request includes time span change information; if yes, according to the The time span change information modifies the time span of the current setting. If the time span change information is not included in the update request, the current default time span of the system may be obtained; or, in other embodiments, when the time span is not obtained from the update request, the time span setting interface is displayed, manually Settings.
作为另一种实施方式,确定用户设置的时间跨度的步骤包括:As another implementation manner, the step of determining a time span set by the user includes:
在检测到时间跨度变更指令时,显示时间跨度的设置界面,以供用户基于所述设置界面修改当前设置的时间跨度;When the time span change instruction is detected, displaying a time span setting interface for the user to modify the currently set time span based on the setting interface;
将用户基于所述设置界面修改后的时间跨度作为用户设置的时间跨度。The time span modified by the user based on the setting interface is taken as the time span set by the user.
在该实施例中,用户可以基于系统提供的交互界面触发时间跨度变更指令,该方法在检测到时间跨度变更指令时,显示时间跨度的设置界面,并将用户基于该界面修改后的时间跨度作为用户设置的时间跨度。In this embodiment, the user may trigger a time span change instruction based on the interaction interface provided by the system, and when the time span change instruction is detected, the method displays a time span setting interface, and uses the modified time span of the user as the interface. The time span set by the user.
步骤S30,将获取到的历史数据作为训练样本输入到所述待测项目的预测模型中进行训练,以确定所述预测模型的模型参数,基于确定的模型参数更新所述预测模型。Step S30: The acquired historical data is input as a training sample into the prediction model of the item to be tested for training to determine model parameters of the prediction model, and the prediction model is updated based on the determined model parameters.
在确定时间跨度之后,根据时间跨度以及终止时间单元确定时间区间,从流感样病例将的数据库中获取与时间区间匹配的历史数据,假设数据库中存储的是2014年第1周至2016年第52周共156周的历史数据,时间跨度为100周,假设用户发送更新请求时的时间单元为2017年的第20周,也就说要对2017年 第20周的流感样病例百分比进行预测,则2017年的第19周即为终止时间单元。根据时间跨度以及终止时间单元确定时间区间为2015年的第24周至2017年的第19周。从数据库中查找属于该时间阶段的历史数据作为训练样本输入到预测模型中进行训练以确定模型参数。After determining the time span, the time interval is determined according to the time span and the termination time unit, and historical data matching the time interval is obtained from the database of influenza-like cases, assuming that the database stores the week from the first week of 2014 to the 52nd week of 2016. A total of 156 weeks of historical data, the time span is 100 weeks, assuming that the time unit when the user sends the update request is the 20th week of 2017, that is, the forecast of the percentage of influenza-like cases in the 20th week of 2017, 2017 The 19th week of the year is the termination time unit. The time interval is determined from the 24th week of 2015 to the 19th week of 2017 based on the time span and the termination time unit. The historical data belonging to the time phase is searched from the database as a training sample input into the prediction model for training to determine the model parameters.
可选地,作为一种实施方式,步骤S20之后,该方法还包括如下步骤:Optionally, as an implementation manner, after step S20, the method further includes the following steps:
当从所述数据库中获取不到符合所述时间跨度、且与所述目标时间单元相邻的时间单元对应的历史数据时,确定缺失历史数据的时间区间;Determining a time interval of missing historical data when no historical data corresponding to the time span corresponding to the time span and adjacent to the target time unit is acquired from the database;
基于确定的时间区间生成数据补充提示信息,以供用户基于所述提示信息更新数据库以补充缺失的历史数据;Generating data supplemental prompt information based on the determined time interval for the user to update the database based on the prompt information to supplement the missing historical data;
基于更新后的数据库重新执行所述从所述待测项目对应的数据库中获取与所述时间区间匹配的历史数据的步骤。And the step of acquiring the historical data matching the time interval from the database corresponding to the item to be tested is re-executed based on the updated database.
在上述历史数据获取过程中,当数据库中的流感样病例数据没有及时更新时,会有部分时间单元的历史数据获取不到。例如,上述例子中时间区间是为2015年的第24周至2017年的第19周,但是数据库中存储的是2014年第1周至2016年第52周共156周的历史数据。因此,需要对数据库中的数据进行更新,此时确定缺失历史数据的时间区间为2017年的第1周至2017年的第19周,则基于该时间区间生成数据补充提示信息,用户根据该信息对数据库中缺失的历史数据进行补充,并根据补充的历史数据对数据库进行更新,并重新查找时间区间匹配的历史数据。In the above historical data acquisition process, when the influenza-like case data in the database is not updated in time, the historical data of some time units may not be obtained. For example, in the above example, the time interval is from the 24th week of 2015 to the 19th week of 2017, but the database stores historical data of 156 weeks from the first week of 2014 to the 52nd week of 2016. Therefore, the data in the database needs to be updated. At this time, it is determined that the time interval of the missing historical data is from the first week of 2017 to the 19th week of 2017, and the data supplemental prompt information is generated based on the time interval, and the user pairs the information according to the information. The missing historical data in the database is supplemented, and the database is updated based on the supplemental historical data, and the historical data matching the time interval is re-discovered.
在查找到历史数据后,将其作为训练样本输入到预测模型中进行训练,例如时间序列模型,使用第1周至第100周的数据作为训练样本训练预测模型,对第101周的流感样病例发病率进行预测。在训练时,按照模型对应的算法进行学习获取模型参数,将确定了模型参数的预测模型更新为最新的预测模型。按照上述方案,在对第102周的流感样病例发病率进行预测时,使用第2周至第101周的数据作为训练样本训练预测模型,以此类推,随着时间的迁移,预测模型不断更新。After finding the historical data, it is input as a training sample into the prediction model for training, such as a time series model, using the data from the first week to the 100th week as the training sample training prediction model, and the incidence of the influenza-like case on the 101st week. Rate to make predictions. During training, the model parameters are learned according to the algorithm corresponding to the model, and the prediction model that determines the model parameters is updated to the latest prediction model. According to the above scheme, when the incidence of influenza-like cases in the 102nd week is predicted, the data from the 2nd week to the 101st week is used as the training sample training prediction model, and so on, the prediction model is continuously updated over time.
进一步地,在一些实施例中,为了提高建模效率,在将获取到的历史数据作为训练样本输入到所述待测项目的预测模型中进行训练的步骤之前,先使用当前的预测模型对终止时间单元的流感样病例百分比进行预测,并判断预测值与实际观测值之间的差值是否位于允许的误差范围内,若是,则认为 当前的预测模型的预测精准度符合要求,不对预测模型进行更新,若差值超出允许的误差范围,则重新对预测模型进行训练。Further, in some embodiments, in order to improve the modeling efficiency, before the step of training the acquired historical data as a training sample into the prediction model of the test item, the current prediction model pair is used to terminate. The percentage of influenza-like cases in the time unit is predicted, and it is judged whether the difference between the predicted value and the actual observation value is within the allowable error range. If so, the prediction accuracy of the current prediction model is considered to be in compliance with the requirement, and the prediction model is not performed. Update, if the difference exceeds the allowable error range, re-train the prediction model.
本实施例提出的预测模型的更新方法,根据接收到的基于待测项目触发的更新请求确定待预测的目标时间单元,并确定用户设置的时间跨度,从待测项目对应的数据库中查找符合时间跨度且与目标时间单元相邻的时间单元对应的历史数据,将获取到的历史数据作为训练样本输入到待测项目的预测模型中进行训练以确定预测模型的模型参数,基于确定的模型参数对预测模型进行更新,本方案通过设置时间跨度的方式对历史数据进行筛选,得到距离目标时间单元最近的历史数据作为训练样本对模型进行重新训练,进而重新确定模型参数以实现对模型的更新,以适应时间的推进、数据的变化,提高了预测模型的预测精准度。The method for updating the prediction model proposed in this embodiment determines the target time unit to be predicted according to the received update request triggered by the item to be tested, and determines the time span set by the user, and searches for the matching time from the database corresponding to the item to be tested. The historical data corresponding to the time unit adjacent to the target time unit, the acquired historical data is input as a training sample into the prediction model of the test item to be trained to determine the model parameter of the prediction model, based on the determined model parameter pair The prediction model is updated. The scheme filters the historical data by setting the time span, and obtains the historical data closest to the target time unit as the training sample to retrain the model, and then re-determine the model parameters to realize the update of the model. Adaptation time advancement and data changes improve the prediction accuracy of the prediction model.
此外,本申请实施例还提出一种计算机可读存储介质,所述计算机可读存储介质上存储有预测模型的更新程序,所述预测模型的更新程序可被至少一个处理器执行,以实现如下操作:In addition, the embodiment of the present application further provides a computer readable storage medium, where the update program of the prediction model is stored, and the update program of the prediction model may be executed by at least one processor to implement the following operating:
确定当前的预测时间所属的时间单元,并确定用户设置的时间跨度;Determining the time unit to which the current predicted time belongs, and determining the time span set by the user;
将所述时间单元的上一个时间单元作为终止时间单元,根据所述终止时间单元和所述时间跨度确定时间区间,从所述待测项目对应的数据库中获取与所述时间区间匹配的历史数据;Taking a previous time unit of the time unit as an end time unit, determining a time interval according to the end time unit and the time span, and acquiring historical data matching the time interval from a database corresponding to the item to be tested ;
将获取到的历史数据作为训练样本输入到所述待测项目的预测模型中进行训练,以确定所述预测模型的模型参数,基于确定的模型参数更新所述预测模型。The acquired historical data is input as a training sample into a prediction model of the item to be tested for training to determine model parameters of the prediction model, and the prediction model is updated based on the determined model parameters.
进一步地,所述预测模型的更新程序被处理器执行时还实现如下操作:Further, when the update program of the prediction model is executed by the processor, the following operations are also implemented:
当从所述数据库中获取不到符合所述时间跨度、且与所述目标时间单元相邻的时间单元对应的历史数据时,确定缺失历史数据的时间区间;Determining a time interval of missing historical data when no historical data corresponding to the time span corresponding to the time span and adjacent to the target time unit is acquired from the database;
基于确定的时间区间生成数据补充提示信息,以供用户基于所述提示信息更新数据库以补充缺失的历史数据;Generating data supplemental prompt information based on the determined time interval for the user to update the database based on the prompt information to supplement the missing historical data;
基于更新后的数据库重新执行所述从所述待测项目对应的数据库中获取与所述时间区间匹配的历史数据的步骤。And the step of acquiring the historical data matching the time interval from the database corresponding to the item to be tested is re-executed based on the updated database.
进一步地,所述预测模型的更新程序被处理器执行时还实现如下操作:Further, when the update program of the prediction model is executed by the processor, the following operations are also implemented:
检测所述更新请求中是否包含有时间跨度变更信息;Detecting whether the update request includes time span change information;
若有,则按照所述时间跨度变更信息修改当前设置的时间跨度。If yes, modify the time span of the current setting according to the time span change information.
进一步地,所述预测模型的更新程序被处理器执行时还实现如下操作:Further, when the update program of the prediction model is executed by the processor, the following operations are also implemented:
在检测到时间跨度变更指令时,显示时间跨度的设置界面,以供用户基于所述设置界面修改当前设置的时间跨度;When the time span change instruction is detected, displaying a time span setting interface for the user to modify the currently set time span based on the setting interface;
将用户基于所述设置界面修改后的时间跨度作为用户设置的时间跨度。The time span modified by the user based on the setting interface is taken as the time span set by the user.
本发明本申请计算机可读存储介质具体实施方式与上述预测模型的更新装置和方法各实施例基本相同,在此不作累述。The specific embodiment of the computer readable storage medium of the present application is substantially the same as the embodiment of the foregoing apparatus and method for updating the prediction model, and is not described herein.
需要说明的是,上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。并且本文中的术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、装置、物品或者方法不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、装置、物品或者方法所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、装置、物品或者方法中还存在另外的相同要素。It should be noted that the foregoing serial numbers of the embodiments of the present application are merely for the description, and do not represent the advantages and disadvantages of the embodiments. And the terms "including", "comprising", or any other variations thereof are intended to encompass a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a plurality of elements includes not only those elements but also Other elements listed, or elements that are inherent to such a process, device, item, or method. An element that is defined by the phrase "comprising a ..." does not exclude the presence of additional equivalent elements in the process, the device, the item, or the method that comprises the element.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is better. Implementation. Based on such understanding, the technical solution of the present application, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM as described above). , a disk, an optical disk, including a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the methods described in the various embodiments of the present application.
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above is only a preferred embodiment of the present application, and is not intended to limit the scope of the patent application, and the equivalent structure or equivalent process transformations made by the specification and the drawings of the present application, or directly or indirectly applied to other related technical fields. The same is included in the scope of patent protection of this application.

Claims (20)

  1. 一种预测模型的更新装置,其特征在于,所述装置包括:存储器、处理器,所述存储器上存储有可在所述处理器上运行的预测模型的更新程序,所述预测模型的更新程序被所述处理器执行时实现如下步骤:An apparatus for updating a prediction model, the apparatus comprising: a memory, a processor, an update program of a prediction model executable on the processor, and an update program of the prediction model The following steps are implemented when executed by the processor:
    确定当前的预测时间所属的时间单元,并确定用户设置的时间跨度;Determining the time unit to which the current predicted time belongs, and determining the time span set by the user;
    将所述时间单元的上一个时间单元作为终止时间单元,根据所述终止时间单元和所述时间跨度确定时间区间,从所述待测项目对应的数据库中获取与所述时间区间匹配的历史数据;Taking a previous time unit of the time unit as an end time unit, determining a time interval according to the end time unit and the time span, and acquiring historical data matching the time interval from a database corresponding to the item to be tested ;
    将获取到的历史数据作为训练样本输入到所述待测项目的预测模型中进行训练,以确定所述预测模型的模型参数,基于确定的模型参数更新所述预测模型。The acquired historical data is input as a training sample into a prediction model of the item to be tested for training to determine model parameters of the prediction model, and the prediction model is updated based on the determined model parameters.
  2. 根据权利要求1所述的预测模型的更新装置,其特征在于,所述处理器还用于执行所述预测模型的更新程序,以在从所述待测项目对应的数据库中获取与所述时间区间匹配的历史数据的步骤之后,还实现如下步骤:The apparatus for updating a prediction model according to claim 1, wherein the processor is further configured to execute an update program of the prediction model to acquire the time from a database corresponding to the item to be tested After the step of matching the historical data of the interval, the following steps are also implemented:
    当从所述数据库中获取不到符合所述时间跨度、且与所述目标时间单元相邻的时间单元对应的历史数据时,确定缺失历史数据的时间区间;Determining a time interval of missing historical data when no historical data corresponding to the time span corresponding to the time span and adjacent to the target time unit is acquired from the database;
    基于确定的时间区间生成数据补充提示信息,以供用户基于所述提示信息更新数据库以补充缺失的历史数据;Generating data supplemental prompt information based on the determined time interval for the user to update the database based on the prompt information to supplement the missing historical data;
    基于更新后的数据库重新执行所述从所述待测项目对应的数据库中获取与所述时间区间匹配的历史数据的步骤。And the step of acquiring the historical data matching the time interval from the database corresponding to the item to be tested is re-executed based on the updated database.
  3. 根据权利要求1所述的预测模型的更新装置,其特征在于,所述确定用户设置的时间跨度的步骤包括:The apparatus for updating a prediction model according to claim 1, wherein the step of determining a time span set by the user comprises:
    检测所述更新请求中是否包含有时间跨度变更信息;Detecting whether the update request includes time span change information;
    若有,则按照所述时间跨度变更信息修改当前设置的时间跨度。If yes, modify the time span of the current setting according to the time span change information.
  4. 根据权利要求2所述的预测模型的更新装置,其特征在于,所述确定用户设置的时间跨度的步骤包括:The apparatus for updating a prediction model according to claim 2, wherein the step of determining a time span set by the user comprises:
    检测所述更新请求中是否包含有时间跨度变更信息;Detecting whether the update request includes time span change information;
    若有,则按照所述时间跨度变更信息修改当前设置的时间跨度。If yes, modify the time span of the current setting according to the time span change information.
  5. 根据权利要求1所述的预测模型的更新装置,其特征在于,所述确定用户设置的时间跨度的步骤包括:The apparatus for updating a prediction model according to claim 1, wherein the step of determining a time span set by the user comprises:
    在检测到时间跨度变更指令时,显示时间跨度的设置界面,以供用户基于所述设置界面修改当前设置的时间跨度;When the time span change instruction is detected, displaying a time span setting interface for the user to modify the currently set time span based on the setting interface;
    将用户基于所述设置界面修改后的时间跨度作为用户设置的时间跨度。The time span modified by the user based on the setting interface is taken as the time span set by the user.
  6. 根据权利要求2所述的预测模型的更新装置,其特征在于,所述确定用户设置的时间跨度的步骤包括:The apparatus for updating a prediction model according to claim 2, wherein the step of determining a time span set by the user comprises:
    在检测到时间跨度变更指令时,显示时间跨度的设置界面,以供用户基于所述设置界面修改当前设置的时间跨度;When the time span change instruction is detected, displaying a time span setting interface for the user to modify the currently set time span based on the setting interface;
    将用户基于所述设置界面修改后的时间跨度作为用户设置的时间跨度。The time span modified by the user based on the setting interface is taken as the time span set by the user.
  7. 根据权利要求3所述的预测模型的更新装置,其特征在于,所述预测模型为时间序列模型、分类模型或者回归模型。The apparatus for updating a prediction model according to claim 3, wherein the prediction model is a time series model, a classification model, or a regression model.
  8. 一种预测模型的更新方法,其特征在于,所述方法包括:A method for updating a prediction model, the method comprising:
    确定当前的预测时间所属的时间单元,并确定用户设置的时间跨度;Determining the time unit to which the current predicted time belongs, and determining the time span set by the user;
    将所述时间单元的上一个时间单元作为终止时间单元,根据所述终止时间单元和所述时间跨度确定时间区间,从所述待测项目对应的数据库中获取与所述时间区间匹配的历史数据;Taking a previous time unit of the time unit as an end time unit, determining a time interval according to the end time unit and the time span, and acquiring historical data matching the time interval from a database corresponding to the item to be tested ;
    将获取到的历史数据作为训练样本输入到所述待测项目的预测模型中进行训练,以确定所述预测模型的模型参数,基于确定的模型参数更新所述预测模型。The acquired historical data is input as a training sample into a prediction model of the item to be tested for training to determine model parameters of the prediction model, and the prediction model is updated based on the determined model parameters.
  9. 根据权利要求8所述的预测模型的更新方法,其特征在于,从所述待测项目对应的数据库中获取与所述时间区间匹配的历史数据的步骤之后,所述方法还包括步骤:The method for updating a prediction model according to claim 8, wherein after the step of acquiring historical data matching the time interval from the database corresponding to the item to be tested, the method further comprises the steps of:
    当从所述数据库中获取不到符合所述时间跨度、且与所述目标时间单元相邻的时间单元对应的历史数据时,确定缺失历史数据的时间区间;Determining a time interval of missing historical data when no historical data corresponding to the time span corresponding to the time span and adjacent to the target time unit is acquired from the database;
    基于确定的时间区间生成数据补充提示信息,以供用户基于所述提示信息更新数据库以补充缺失的历史数据;Generating data supplemental prompt information based on the determined time interval for the user to update the database based on the prompt information to supplement the missing historical data;
    基于更新后的数据库重新执行所述从所述待测项目对应的数据库中获取与所述时间区间匹配的历史数据的步骤。And the step of acquiring the historical data matching the time interval from the database corresponding to the item to be tested is re-executed based on the updated database.
  10. 根据权利要求8所述的预测模型的更新方法,其特征在于,所述确定用户设置的时间跨度的步骤包括:The method for updating a prediction model according to claim 8, wherein the step of determining a time span set by the user comprises:
    检测所述更新请求中是否包含有时间跨度变更信息;Detecting whether the update request includes time span change information;
    若有,则按照所述时间跨度变更信息修改当前设置的时间跨度。If yes, modify the time span of the current setting according to the time span change information.
  11. 根据权利要求9所述的预测模型的更新方法,其特征在于,所述确定用户设置的时间跨度的步骤包括:The method for updating a prediction model according to claim 9, wherein the step of determining a time span set by the user comprises:
    检测所述更新请求中是否包含有时间跨度变更信息;Detecting whether the update request includes time span change information;
    若有,则按照所述时间跨度变更信息修改当前设置的时间跨度。If yes, modify the time span of the current setting according to the time span change information.
  12. 根据权利要求8所述的预测模型的更新方法,其特征在于,所述确定用户设置的时间跨度的步骤包括:The method for updating a prediction model according to claim 8, wherein the step of determining a time span set by the user comprises:
    在检测到时间跨度变更指令时,显示时间跨度的设置界面,以供用户基于所述设置界面修改当前设置的时间跨度;When the time span change instruction is detected, displaying a time span setting interface for the user to modify the currently set time span based on the setting interface;
    将用户基于所述设置界面修改后的时间跨度作为用户设置的时间跨度。The time span modified by the user based on the setting interface is taken as the time span set by the user.
  13. 根据权利要求9所述的预测模型的更新方法,其特征在于,所述确定用户设置的时间跨度的步骤包括:The method for updating a prediction model according to claim 9, wherein the step of determining a time span set by the user comprises:
    在检测到时间跨度变更指令时,显示时间跨度的设置界面,以供用户基于所述设置界面修改当前设置的时间跨度;When the time span change instruction is detected, displaying a time span setting interface for the user to modify the currently set time span based on the setting interface;
    将用户基于所述设置界面修改后的时间跨度作为用户设置的时间跨度。The time span modified by the user based on the setting interface is taken as the time span set by the user.
  14. 根据权利要求10所述的预测模型的更新方法,其特征在于,所述预测模型为时间序列模型、分类模型或者回归模型。The method for updating a prediction model according to claim 10, wherein the prediction model is a time series model, a classification model, or a regression model.
  15. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有预测模型的更新程序,所述预测模型的更新程序可被至少一个处理器执行,以实现如下的步骤:A computer readable storage medium, wherein the computer readable storage medium stores an update program of a predictive model, and the update program of the predictive model is executable by at least one processor to implement the following steps:
    确定当前的预测时间所属的时间单元,并确定用户设置的时间跨度;Determining the time unit to which the current predicted time belongs, and determining the time span set by the user;
    将所述时间单元的上一个时间单元作为终止时间单元,根据所述终止时间单元和所述时间跨度确定时间区间,从所述待测项目对应的数据库中获取与所述时间区间匹配的历史数据;Taking a previous time unit of the time unit as an end time unit, determining a time interval according to the end time unit and the time span, and acquiring historical data matching the time interval from a database corresponding to the item to be tested ;
    将获取到的历史数据作为训练样本输入到所述待测项目的预测模型中进行训练,以确定所述预测模型的模型参数,基于确定的模型参数更新所述预测模型。The acquired historical data is input as a training sample into a prediction model of the item to be tested for training to determine model parameters of the prediction model, and the prediction model is updated based on the determined model parameters.
  16. 根据权利要求15所述的计算机可读存储介质,其特征在于,所述预测模型的更新程序可被至少一个处理器执行,以在从所述待测项目对应的数据库中获取与所述时间区间匹配的历史数据的步骤之后,还实现如下步骤:The computer readable storage medium according to claim 15, wherein the update program of the prediction model is executable by at least one processor to acquire the time interval from a database corresponding to the item to be tested After the steps of matching historical data, the following steps are also implemented:
    当从所述数据库中获取不到符合所述时间跨度、且与所述目标时间单元相邻的时间单元对应的历史数据时,确定缺失历史数据的时间区间;Determining a time interval of missing historical data when no historical data corresponding to the time span corresponding to the time span and adjacent to the target time unit is acquired from the database;
    基于确定的时间区间生成数据补充提示信息,以供用户基于所述提示信息更新数据库以补充缺失的历史数据;Generating data supplemental prompt information based on the determined time interval for the user to update the database based on the prompt information to supplement the missing historical data;
    基于更新后的数据库重新执行所述从所述待测项目对应的数据库中获取与所述时间区间匹配的历史数据的步骤。And the step of acquiring the historical data matching the time interval from the database corresponding to the item to be tested is re-executed based on the updated database.
  17. 根据权利要求15所述的计算机可读存储介质,其特征在于,所述确定用户设置的时间跨度的步骤包括:The computer readable storage medium of claim 15, wherein the step of determining a time span set by a user comprises:
    检测所述更新请求中是否包含有时间跨度变更信息;Detecting whether the update request includes time span change information;
    若有,则按照所述时间跨度变更信息修改当前设置的时间跨度。If yes, modify the time span of the current setting according to the time span change information.
  18. 根据权利要求16所述的计算机可读存储介质,其特征在于,所述确定用户设置的时间跨度的步骤包括:The computer readable storage medium of claim 16, wherein the step of determining a time span set by a user comprises:
    检测所述更新请求中是否包含有时间跨度变更信息;Detecting whether the update request includes time span change information;
    若有,则按照所述时间跨度变更信息修改当前设置的时间跨度。If yes, modify the time span of the current setting according to the time span change information.
  19. 根据权利要求15所述的计算机可读存储介质,其特征在于,所述确定用户设置的时间跨度的步骤包括:The computer readable storage medium of claim 15, wherein the step of determining a time span set by a user comprises:
    在检测到时间跨度变更指令时,显示时间跨度的设置界面,以供用户基于所述设置界面修改当前设置的时间跨度;When the time span change instruction is detected, displaying a time span setting interface for the user to modify the currently set time span based on the setting interface;
    将用户基于所述设置界面修改后的时间跨度作为用户设置的时间跨度。The time span modified by the user based on the setting interface is taken as the time span set by the user.
  20. 根据权利要求16所述的计算机可读存储介质,其特征在于,所述确定用户设置的时间跨度的步骤包括:The computer readable storage medium of claim 16, wherein the step of determining a time span set by a user comprises:
    在检测到时间跨度变更指令时,显示时间跨度的设置界面,以供用户基于所述设置界面修改当前设置的时间跨度;When the time span change instruction is detected, displaying a time span setting interface for the user to modify the currently set time span based on the setting interface;
    将用户基于所述设置界面修改后的时间跨度作为用户设置的时间跨度。The time span modified by the user based on the setting interface is taken as the time span set by the user.
PCT/CN2018/077645 2017-08-29 2018-02-28 Apparatus and method for updating prediction model, and computer-readable storage medium WO2019041773A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710754335.6A CN108427698A (en) 2017-08-29 2017-08-29 Updating device, method and the computer readable storage medium of prediction model
CN201710754335.6 2017-08-29

Publications (1)

Publication Number Publication Date
WO2019041773A1 true WO2019041773A1 (en) 2019-03-07

Family

ID=63155582

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/077645 WO2019041773A1 (en) 2017-08-29 2018-02-28 Apparatus and method for updating prediction model, and computer-readable storage medium

Country Status (2)

Country Link
CN (1) CN108427698A (en)
WO (1) WO2019041773A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112036579A (en) * 2020-09-04 2020-12-04 平安科技(深圳)有限公司 Self-learning online updating method, system and device for multi-classification model
CN112328450A (en) * 2020-11-03 2021-02-05 平安信托有限责任公司 Data monitoring method and device, computer equipment and storage medium
CN113140325A (en) * 2020-01-20 2021-07-20 柳州市人民医院 Method for establishing prediction model of incidence probability of Marneffei pannieri disease of HIV patient
CN113692177A (en) * 2021-07-09 2021-11-23 厦门科灿信息技术有限公司 Control method and device for power consumption of refrigeration system of data center and terminal
CN112036579B (en) * 2020-09-04 2024-05-03 平安科技(深圳)有限公司 Multi-classification model self-learning online updating method, system and device

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109933503A (en) * 2019-02-13 2019-06-25 平安科技(深圳)有限公司 User's operation risk factor determines method, apparatus and storage medium, server
CN111629319B (en) * 2019-02-28 2022-05-31 中国移动通信有限公司研究院 Position prediction method and device
CN110502336A (en) * 2019-07-05 2019-11-26 深圳壹账通智能科技有限公司 A kind of starting method, apparatus, equipment and the readable storage medium storing program for executing of server
JP7224265B2 (en) * 2019-09-18 2023-02-17 株式会社荏原製作所 machine learning device, substrate processing device, trained model, machine learning method, machine learning program
CN110572577B (en) * 2019-09-24 2021-04-16 浙江大华技术股份有限公司 Method, device, equipment and medium for tracking and focusing
CN112711615A (en) * 2019-10-24 2021-04-27 富士通株式会社 Information processing apparatus, information processing method, and computer-readable storage medium
CN111062004A (en) * 2019-12-20 2020-04-24 北京软通智慧城市科技有限公司 Prediction model adjusting method and device, prediction simulator and storage medium
CN111696682A (en) * 2020-05-26 2020-09-22 平安科技(深圳)有限公司 Data processing method and device, electronic equipment and readable storage medium
CN111652655A (en) * 2020-06-10 2020-09-11 创新奇智(上海)科技有限公司 Commodity sales prediction method and device, electronic equipment and readable storage medium
WO2023090510A1 (en) * 2021-11-18 2023-05-25 한국전자기술연구원 Electronic device for performing data selection based on data supplementation condition, and executing method thereof

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102056182A (en) * 2010-12-13 2011-05-11 哈尔滨工业大学 Method for predicting mobile traffic based on LS-SVM
CN103792845A (en) * 2014-01-26 2014-05-14 浦城正大生化有限公司 Method and system for carbohydrate supplementation speed optimal control in fermentation process of aureomycin
CN104156422A (en) * 2014-08-06 2014-11-19 辽宁工程技术大学 Gas concentration real-time prediction method based on dynamic neural network
CN104732298A (en) * 2015-04-02 2015-06-24 南京天溯自动化控制系统有限公司 Method for achieving EMS load prediction based on decision tree and linear regression
CN105718490A (en) * 2014-12-04 2016-06-29 阿里巴巴集团控股有限公司 Method and device for updating classifying model

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102056182A (en) * 2010-12-13 2011-05-11 哈尔滨工业大学 Method for predicting mobile traffic based on LS-SVM
CN103792845A (en) * 2014-01-26 2014-05-14 浦城正大生化有限公司 Method and system for carbohydrate supplementation speed optimal control in fermentation process of aureomycin
CN104156422A (en) * 2014-08-06 2014-11-19 辽宁工程技术大学 Gas concentration real-time prediction method based on dynamic neural network
CN105718490A (en) * 2014-12-04 2016-06-29 阿里巴巴集团控股有限公司 Method and device for updating classifying model
CN104732298A (en) * 2015-04-02 2015-06-24 南京天溯自动化控制系统有限公司 Method for achieving EMS load prediction based on decision tree and linear regression

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113140325A (en) * 2020-01-20 2021-07-20 柳州市人民医院 Method for establishing prediction model of incidence probability of Marneffei pannieri disease of HIV patient
CN112036579A (en) * 2020-09-04 2020-12-04 平安科技(深圳)有限公司 Self-learning online updating method, system and device for multi-classification model
CN112036579B (en) * 2020-09-04 2024-05-03 平安科技(深圳)有限公司 Multi-classification model self-learning online updating method, system and device
CN112328450A (en) * 2020-11-03 2021-02-05 平安信托有限责任公司 Data monitoring method and device, computer equipment and storage medium
CN113692177A (en) * 2021-07-09 2021-11-23 厦门科灿信息技术有限公司 Control method and device for power consumption of refrigeration system of data center and terminal
CN113692177B (en) * 2021-07-09 2023-08-18 厦门科灿信息技术有限公司 Control method, device and terminal for power consumption of refrigeration system of data center

Also Published As

Publication number Publication date
CN108427698A (en) 2018-08-21

Similar Documents

Publication Publication Date Title
WO2019041773A1 (en) Apparatus and method for updating prediction model, and computer-readable storage medium
US11907851B2 (en) Image description generation method, model training method, device and storage medium
US11561763B2 (en) Electronic device for processing multi-modal input, method for processing multi-modal input and server for processing multi-modal input
WO2019037260A1 (en) Predictive model establishment method and device, and computer-readable storage medium
CN108768875B (en) Application gray level publishing method and device and computer readable storage medium
US11169827B2 (en) Resource loading at application startup using attributes of historical data groups
US20180253586A1 (en) Fingerprint information processing method and electronic device supporting the same
CN108012389B (en) Light adjusting method, terminal device and computer readable storage medium
WO2019056793A1 (en) Device, method, and computer readable storage medium for identifying resume
US9922260B2 (en) Scrapped information providing method and apparatus
WO2019041519A1 (en) Target tracking device and method, and computer-readable storage medium
US11086290B2 (en) Electronic apparatus for monitoring state of machine tool and control method thereof
US8712931B1 (en) Adaptive input interface
WO2019062182A1 (en) Data synchronization device and method, and computer readable storage medium
US20160306491A1 (en) Touch input processing method and electronic device for supporting the same
US11644938B2 (en) Standardizing user interface elements
US20220180621A1 (en) Article identification method and device, and computer readable storage medium
CN107818492B (en) Product recommendation apparatus, method and computer-readable storage medium
CN109471857B (en) SQL statement-based data modification method, device and storage medium
WO2019019635A1 (en) Device and method for generating dynamic image, and computer readable storage medium
US10445485B2 (en) Lock screen output controlling method and electronic device for supporting the same
CN107395871B (en) Method and device for opening application, storage medium and terminal
US20180157682A1 (en) Image information processing system
US10621259B2 (en) URL error-correcting method, server, terminal and system
KR102222711B1 (en) Electronic device for providing website related to shopping mall and method for operation thereof

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

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

Ref document number: 18851017

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 29/09/2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18851017

Country of ref document: EP

Kind code of ref document: A1