CN116662815B - Training method of time prediction model and related equipment - Google Patents

Training method of time prediction model and related equipment Download PDF

Info

Publication number
CN116662815B
CN116662815B CN202310936520.2A CN202310936520A CN116662815B CN 116662815 B CN116662815 B CN 116662815B CN 202310936520 A CN202310936520 A CN 202310936520A CN 116662815 B CN116662815 B CN 116662815B
Authority
CN
China
Prior art keywords
model
time
target
prediction
predictor
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310936520.2A
Other languages
Chinese (zh)
Other versions
CN116662815A (en
Inventor
姜正申
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202310936520.2A priority Critical patent/CN116662815B/en
Publication of CN116662815A publication Critical patent/CN116662815A/en
Application granted granted Critical
Publication of CN116662815B publication Critical patent/CN116662815B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/243Classification techniques relating to the number of classes
    • G06F18/24323Tree-organised classifiers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/01Dynamic search techniques; Heuristics; Dynamic trees; Branch-and-bound
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Computational Linguistics (AREA)
  • Medical Informatics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Traffic Control Systems (AREA)

Abstract

The application discloses a training method of a time prediction model and related equipment, which can be applied to maps, automatic driving and intelligent traffic; selecting a predictor model in the time prediction model; inputting each passing characteristic of the sample route into the selected reference prediction sub-model to perform time prediction, so as to obtain predicted passing time of the sample route; determining time residual information based on expected passing time of the sample route and predicted passing time corresponding to each reference predictor model; constructing a target predictor model according to the time residual information; and adding the target prediction sub-model into the time prediction model to obtain a target time prediction model. According to the method, under the condition that the updated time prediction model is applicable to the change of the historical data law, the change of the data law in the incremental sample is captured through the newly added target prediction sub model, and the accuracy of time prediction is improved; and the model updating cost is low, so that the timely adaptation of time estimation to travel rule change can be realized.

Description

Training method of time prediction model and related equipment
Technical Field
The application relates to the technical field of artificial intelligence, in particular to a training method of a time prediction model and related equipment.
Background
With the rapid development of internet technology, artificial intelligence technology has been widely used in various fields such as medical treatment, education, finance, transportation, etc. In the traffic field, such as intelligent navigation, the arrival time can be estimated (Estimated Time of Arrival, ETA) by using artificial intelligence technology. The estimated arrival time is specifically a route and departure time on a given map, and the time required for completing the route is estimated.
At present, a depth model-based arrival time estimation method is generally adopted in the related art. The method comprises the steps of inputting the characteristics of the whole route into a depth neural network based on the arrival time estimation method of the depth model, training the depth model end to end through a back propagation algorithm, and then predicting ETA by using the trained depth model. However, the model updating method generally solves the ETA estimation problem under the conventional condition, and when the seasonal and regular travel rule change scene is dealt with, the whole depth model needs to be updated when the model is updated each time, the updating cost is high, the model updating frequency is low, so that the travel rule change cannot be captured in time, and the accuracy of time estimation is not improved; in addition, when the deep neural network model is updated, the parameters of the original neural network are generally updated directly, so that the model is easy to be forgotten in disastrous manner, namely, after the model is trained by adopting the latest data, the learned rule before the model is difficult to be maintained, and the prediction effect of the model on old data is reduced; specifically, for example, only the data of the last month is used to update the model, so that the updated model cannot learn the travel rule of the last year and the change of the travel rule in a period of time in the future is not predicted enough, and the estimated effect of the arrival time is poor.
Disclosure of Invention
The embodiment of the application provides a training method of a time prediction model and related equipment, wherein the related equipment can comprise a training device of the time prediction model, electronic equipment, a computer readable storage medium and a computer program product, and can capture the change of a data rule in an incremental sample through a newly added target prediction sub-model under the condition that the updated time prediction model is applicable to the change of a historical data rule, so that the accuracy of time prediction is improved; and the model updating cost is low, so that the timely adaptation of time estimation to travel rule change can be realized.
The embodiment of the application provides a training method of a time prediction model, which comprises the following steps:
acquiring a time prediction model trained by using historical traffic data and incremental traffic data, wherein the time prediction model comprises a plurality of predictor models, the incremental traffic data comprises at least one sample route, at least one traffic feature corresponding to the sample route and expected traffic time, and the incremental traffic data is traffic data for incremental learning;
selecting a predictor model in the time prediction model to obtain at least one selected reference predictor model;
Inputting each traffic characteristic of a sample route in the incremental traffic data into the reference predictor model to perform time prediction processing of the sample route, so as to obtain predicted traffic time of the sample route output by the reference predictor model;
determining, for each sample route, time residual information to be fitted to the sample route based on the expected transit time of the sample route and the predicted transit time of the sample route output by the respective reference predictor model;
constructing a target predictor model according to the time residual information required to be fitted by each sample route;
and adding the target prediction sub-model into the time prediction model to obtain a target time prediction model, wherein the target time prediction model is used for carrying out transit time prediction processing on a target route to obtain a transit time prediction result.
Correspondingly, the embodiment of the application provides a training device of a time prediction model, which comprises the following components:
the acquisition unit is used for acquiring a time prediction model trained by using historical traffic data and incremental traffic data, wherein the time prediction model comprises a plurality of predictor models, the incremental traffic data comprises at least one sample route, at least one traffic feature corresponding to the sample route and expected traffic time, and the incremental traffic data is traffic data for incremental learning;
The selecting unit is used for selecting the predictor model in the time prediction model to obtain at least one selected reference predictor model;
the prediction unit is used for inputting each traffic characteristic of the sample route in the incremental traffic data into the reference prediction sub-model to perform time prediction processing of the sample route, so as to obtain the predicted traffic time of the sample route output by the reference prediction sub-model;
a determining unit, configured to determine, for each sample route, time residual information to be fitted to the sample route based on expected transit time of the sample route and predicted transit time of the sample route output by each reference predictor model;
the construction unit is used for constructing a target predictor model according to the time residual information required to be fitted by each sample route;
the adding unit is used for adding the target prediction sub-model into the time prediction model to obtain a target time prediction model, and the target time prediction model is used for carrying out transit time prediction processing on a target route to obtain a transit time prediction result.
Optionally, in some embodiments of the present application, the selecting unit may include a deleting subunit and a selecting subunit as follows:
The deleting subunit is configured to select a to-be-deleted prediction sub-model from the time prediction models, delete the to-be-deleted prediction sub-model from the time prediction models, and obtain a time prediction model after deletion processing;
a selecting subunit, configured to select a predictor model in the deleted time prediction model, and determine at least one selected reference predictor model;
the adding unit may specifically be configured to add the target predictor model to the post-deletion time prediction model, to obtain a target time prediction model.
Optionally, in some embodiments of the present application, the adding unit may include an adding subunit, a determining subunit, and a returning subunit, as follows:
the adding subunit is configured to add the target prediction sub-model to the post-deletion time prediction model to obtain a target time prediction model;
a determining subunit, configured to take the target time prediction model as a new time prediction model;
and the returning subunit is used for returning to execute the step of selecting the to-be-deleted prediction sub-model from the time prediction models, deleting the to-be-deleted prediction sub-model from the time prediction models, and obtaining the time prediction models after deletion until obtaining the target time prediction model meeting the preset conditions.
Alternatively, in some embodiments of the present application, the adding unit may include a weight determining subunit and a model adding subunit, as follows:
the weight determining subunit is configured to determine weight information of the target prediction sub-model according to the number of reference prediction sub-models and the number of prediction sub-models in the time prediction model;
and the model adding subunit is used for adding the target prediction sub model into the time prediction model based on the weight information to obtain a target time prediction model.
Alternatively, in some embodiments of the present application, the construction unit may include a gradient determination subunit, a gain determination subunit, a feature selection subunit, and a construction subunit, as follows:
the gradient determining subunit is used for determining gradient information corresponding to the sample route according to the time residual information required to be fitted by the sample route;
a gain determination subunit, configured to determine target gain information of each traffic feature for a traffic time based on the gradient information and a feature value of the sample route on each traffic feature;
the characteristic selecting subunit is used for selecting target passing characteristics from the passing characteristics according to the target gain information of the passing characteristics on the passing time;
And the construction subunit is used for generating a time prediction strategy according to the target traffic characteristics and constructing a target prediction sub-model based on the time prediction strategy.
Optionally, in some embodiments of the present application, the gain determining subunit may be specifically configured to divide, for each traffic feature, a preset feature value interval corresponding to the traffic feature based on a preset feature value dividing point of the traffic feature, to obtain at least two sub-feature value intervals corresponding to the traffic feature; determining a sample route of the increment traffic data, in which the characteristic value of the traffic characteristic falls in the sub-characteristic value interval, aiming at each sub-characteristic value interval, so as to obtain a target sample route corresponding to the sub-characteristic value interval; determining the information entropy corresponding to the sub-characteristic value interval according to the gradient information of the target sample route corresponding to the sub-characteristic value interval; calculating gain information of the passing feature on passing time under the preset feature value dividing points according to the information entropy corresponding to each sub-feature value interval; and determining target gain information of the passing characteristics on the passing time according to the gain information of the passing characteristics on the passing time at preset characteristic value dividing points.
Optionally, in some embodiments of the present application, the building subunit may specifically be configured to perform decision tree generation based on the temporal prediction policy to obtain a decision tree model structure, where the decision tree model structure includes at least one leaf node; determining leaf nodes in which the sample route falls based on the traffic characteristics of the sample route and the time prediction strategy; determining, for each leaf node, a node value for the leaf node based on gradient information of a sample route falling on the leaf node; and determining a target predictor model according to the decision tree model structure and the node value of each leaf node, wherein the target predictor model is a tree model.
Optionally, in some embodiments of the present application, the predictor model is a tree model including at least one leaf node; the training device of the time prediction model may further include a node determining unit, a time determining unit, and an aggregation unit, as follows:
the node determining unit is used for determining target leaf nodes of the target route falling into each predictor model in the target time prediction model according to the time prediction strategy corresponding to the predictor model and each passing characteristic of the target route;
The time determining unit is used for determining the predicted passing time of the target route output by the predictor model according to the node value of the target leaf node;
and the aggregation unit is used for aggregating the predicted passing time output by each predictor model based on the weight information of each predictor model to obtain the target passing time required by the target route.
Optionally, in some embodiments of the present application, the historical traffic data includes at least one historical sample route, at least one traffic feature corresponding to the historical sample route, and a desired traffic time;
the training device of the time prediction model may further include a time prediction model training unit, as follows:
the time prediction model training unit is used for acquiring an initial time prediction model, and the initial time prediction model comprises at least three predictor models; selecting a predictor model in the initial time prediction model to obtain at least one selected initial reference predictor model; performing time prediction processing on the historical sample route based on each passing characteristic of the historical sample route through the initial reference predictor model to obtain the predicted passing time of the historical sample route output by the initial reference predictor model; determining, for each historical sample route, time residual information to be fitted to the historical sample route based on expected transit times of the historical sample route and predicted transit times of the historical sample route output by the respective initial reference predictor model; constructing an initial target predictor model according to the time residual information required to be fitted by each historical sample route; and adding the initial target predictor model into the initial time prediction model to obtain a time prediction model.
Optionally, in some embodiments of the present application, the historical traffic data includes at least one historical sample route, at least one traffic feature corresponding to the historical sample route, and a desired traffic time;
the training device of the time prediction model may further include a time prediction model generation unit that may be used to generate a time prediction model; the temporal prediction model generation unit may include a residual determination subunit, a model construction subunit, and a return execution subunit and a model acquisition subunit, as follows:
the residual determination subunit is used for determining time residual information which is needed to be fitted currently by the historical sample route based on expected passing time of the historical sample route;
the model construction subunit is used for constructing a prediction sub-model according to the time residual information which needs to be fitted currently by the historical sample route and the passing characteristics of the historical sample route;
the return execution subunit is used for returning to execute the step of determining the time residual information which is needed to be fitted currently for the historical sample route according to the constructed prediction sub-model and the expected passing time based on the historical sample route so as to construct and obtain a new prediction sub-model;
And the model acquisition subunit is used for acquiring the time prediction model based on each constructed prediction sub-model.
Optionally, in some embodiments of the present application, the residual determining subunit may be specifically configured to obtain a preset fitting value when there is no constructed prediction sub-model, and determine the preset fitting value as time residual information that needs to be fitted currently by the historical sample route; when the constructed prediction sub-model exists, performing time prediction processing on the historical sample route based on each passing characteristic of the historical sample route through the constructed prediction sub-model to obtain the predicted passing time of the historical sample route output by the constructed prediction sub-model; for each historical sample route, determining time residual information which is needed to be fitted currently by the historical sample route based on expected passing time of the historical sample route and predicted passing time of the historical sample route output by each constructed predictor model.
Optionally, in some embodiments of the present application, the model building subunit may be specifically configured to determine gradient information corresponding to the historical sample route according to time residual information currently required to be fitted to the historical sample route; determining target gain information of each passing feature on passing time based on the gradient information and the feature value of the history sample route on each passing feature; selecting a target passing feature from the passing features according to the target gain information of the passing features on the passing time; and generating a time prediction strategy according to the target traffic characteristics, and constructing a predictor model based on the time prediction strategy.
The electronic device provided by the embodiment of the application comprises a processor and a memory, wherein the memory stores a plurality of instructions, and the processor loads the instructions to execute the steps in the training method of the time prediction model provided by the embodiment of the application.
The embodiment of the application also provides a computer readable storage medium, on which a computer program is stored, wherein the computer program, when being executed by a processor, implements the steps in the training method of the time prediction model provided by the embodiment of the application.
In addition, the embodiment of the application also provides a computer program product, which comprises a computer program or instructions, and the computer program or instructions realize the steps in the training method of the time prediction model provided by the embodiment of the application when being executed by a processor.
The embodiment of the application provides a training method of a time prediction model and related equipment, wherein the time prediction model and incremental traffic data which are trained by adopting historical traffic data can be obtained, the time prediction model comprises a plurality of prediction sub-models, the incremental traffic data comprises at least one sample route, at least one traffic feature corresponding to the sample route and expected traffic time, and the incremental traffic data is traffic data for incremental learning; selecting a predictor model in the time prediction model to obtain at least one selected reference predictor model; inputting each traffic characteristic of a sample route in the incremental traffic data into the reference predictor model to perform time prediction processing of the sample route, so as to obtain predicted traffic time of the sample route output by the reference predictor model; determining, for each sample route, time residual information to be fitted to the sample route based on the expected transit time of the sample route and the predicted transit time of the sample route output by the respective reference predictor model; constructing a target predictor model according to the time residual information required to be fitted by each sample route; and adding the target prediction sub-model into the time prediction model to obtain a target time prediction model, wherein the target time prediction model is used for carrying out transit time prediction processing on a target route to obtain a transit time prediction result.
The application can select part of the predictor models in the time predictor model, and determine the time residual information which needs to be fitted for the increment sample based on the selected predictor models, thereby generating the target predictor model based on the time residual information, and capturing the change of the data rule in the new increment sample through the newly added target predictor model; in addition, the time residual information fitted by the newly added target predictive sub-model corresponds to the unselected predictive sub-model, so that the importance of the target predictive sub-model can be improved. Because if some predictor models are not selected, all predictor models are directly used for determining the time residual information, the time residual information required to be fitted may be smaller, which may result in lower importance of the target predictor model after learning. Moreover, the time prediction model can be updated in an increment mode, the whole time prediction model does not need to be updated every time, a new prediction sub model is only generated based on an increment sample, other prediction sub models are not needed to be changed, the prediction effect of the model on old data is not obviously reduced, and the accuracy of time prediction can be improved under the condition that the updated time prediction model is applicable to the change of data rules in historical data; and the model updating cost is low, so that the model can continuously learn, the response speed of the model to the change of the traffic rule is improved, and the timely adaptation of the traffic time estimation to the change of the travel rule is realized.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1a is a schematic view of a training method of a time prediction model according to an embodiment of the present application;
FIG. 1b is a flowchart of a method for training a temporal prediction model provided by an embodiment of the present application;
FIG. 1c is an explanatory diagram of a training method of a time prediction model provided by an embodiment of the present application;
FIG. 1d is another flow chart of a training method of a time prediction model according to an embodiment of the present application;
FIG. 2 is another flow chart of a training method of a time prediction model according to an embodiment of the present application;
FIG. 3 is a schematic structural diagram of a training device for a time prediction model according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to fall within the scope of the application.
Embodiments of the present application provide a training method for a time prediction model and related devices, which may include a training apparatus for a time prediction model, an electronic device, a computer-readable storage medium, and a computer program product. The training device of the time prediction model can be integrated in an electronic device, and the electronic device can be a terminal, a server or the like.
It can be appreciated that the training method of the time prediction model of the present embodiment may be performed on the terminal, or may be performed on the server, or may be performed jointly by the terminal and the server. The above examples should not be construed as limiting the application.
As shown in fig. 1a, an example is a training method in which a terminal and a server execute a time prediction model together. The training system of the time prediction model provided by the embodiment of the application comprises a terminal 10, a server 11 and the like; the terminal 10 and the server 11 are connected via a network, for example, a wired or wireless network, wherein the training means of the time prediction model may be integrated in the server.
Wherein, the server 11 can be used for: acquiring a time prediction model trained by using historical traffic data and incremental traffic data, wherein the time prediction model comprises a plurality of predictor models, and the incremental traffic data comprises at least one sample route, at least one traffic feature corresponding to the sample route and expected traffic time; selecting a predictor model in the time prediction model to obtain at least one selected reference predictor model; performing time prediction processing on the sample route based on each passing characteristic of the sample route through the reference predictor model to obtain the predicted passing time of the sample route output by the reference predictor model; determining, for each sample route, time residual information to be fitted to the sample route based on the expected transit time of the sample route and the predicted transit time of the sample route output by the respective reference predictor model; constructing a target predictor model according to the time residual information required to be fitted by each sample route; and adding the target prediction sub-model into the time prediction model to obtain a target time prediction model. The server 11 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud computing services.
Wherein, terminal 10 can be used for: and receiving an updated target time prediction model sent by the server 11, wherein the target time prediction model is used for performing transit time prediction processing on the target route to obtain a transit time prediction result. The terminal 10 may include, among other things, a cell phone, a smart voice interaction device, a smart home appliance, a vehicle-mounted terminal, an aircraft, a tablet computer, a notebook computer, or a personal computer (PC, personal Computer), etc. A client may also be provided on the terminal 10, which may be an application client or a browser client, etc.
The embodiment of the application provides a training method of a time prediction model, which relates to machine learning in the field of artificial intelligence.
Among these, artificial intelligence (Artificial Intelligence, AI) is the theory, method, technique and application system that uses a digital computer or a digital computer-controlled machine to simulate, extend and extend human intelligence, sense the environment, acquire knowledge and use knowledge to obtain optimal results. In other words, artificial intelligence is an integrated technology of computer science that attempts to understand the essence of intelligence and to produce a new intelligent machine that can react in a similar way to human intelligence. Artificial intelligence, i.e. research on design principles and implementation methods of various intelligent machines, enables the machines to have functions of sensing, reasoning and decision. The artificial intelligence technology is a comprehensive subject, and relates to the technology with wide fields, namely the technology with a hardware level and the technology with a software level. Artificial intelligence infrastructure technologies generally include, for example, sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, pre-training model technologies, operation/interaction systems, mechatronics, and the like. The pre-training model is also called a large model and a basic model, and can be widely applied to all large-direction downstream tasks of artificial intelligence after fine adjustment. The artificial intelligence software technology mainly comprises a computer vision technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and other directions.
Among them, machine Learning (ML) is a multi-domain interdisciplinary, and involves multiple disciplines such as probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory, etc. It is specially studied how a computer simulates or implements learning behavior of a human to acquire new knowledge or skills, and reorganizes existing knowledge structures to continuously improve own performance. Machine learning is the core of artificial intelligence, a fundamental approach to letting computers have intelligence, which is applied throughout various areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, induction learning, teaching learning, and the like.
The embodiment of the application provides a training method of a time prediction model, which relates to the fields of map, automatic driving and intelligent traffic.
The following will describe in detail. The following description of the embodiments is not intended to limit the preferred embodiments.
The present embodiment will be described from the perspective of a training apparatus for a time prediction model, which may be specifically integrated in an electronic device, which may be a device such as a server or a terminal.
It will be appreciated that in the specific embodiments of the present application, related data such as user information is involved, and when the above embodiments of the present application are applied to specific products or technologies, user permissions or consents need to be obtained, and the collection, use and processing of related data need to comply with related laws and regulations and standards of related countries and regions.
As shown in fig. 1b, the specific flow of the training method of the time prediction model may be as follows:
101. and acquiring a time prediction model trained by using historical traffic data and incremental traffic data, wherein the time prediction model comprises a plurality of predictor models, the incremental traffic data comprises at least one sample route, at least one traffic feature corresponding to the sample route and expected traffic time, and the incremental traffic data is traffic data for incremental learning.
The time prediction model can be a tree model constructed based on a decision tree algorithm or a neural network model constructed based on a neural network algorithm, and the like. The tree model may be a GBDT model, an Xgboost model, a LightGBM model, or the like.
The time prediction model comprises a plurality of prediction sub-models, and particularly can comprise at least three prediction sub-models, when the time prediction model is a tree model, the time prediction model can be composed of a plurality of decision trees, and each prediction sub-model can be a decision tree.
GBDT (Gradient Boosting Decision Tree) is a gradient lifting decision tree model, which can obtain a final predicted value by training a decision tree in each round and finally aggregating the results of all decision trees. Wherein, each tree is trained with the goal of fitting the residual of the previous results. This process corresponds to each tree fitting a gradient and is therefore referred to as a gradient lifting decision tree. The gradient lifting decision tree can be subdivided into a gradient lifting decision tree and a gradient lifting regression tree, which are respectively aimed at classification problems and regression problems.
Xgboost (eXtreme Gradient Boosting), an extreme gradient lifting tree model, is an optimized distributed gradient enhancement library, derived from the gradient lifting framework, but is more efficient because the Xgboost algorithm can compute in parallel, build trees approximately, handle sparse data efficiently, and optimize memory usage.
LightGBM (Light Gradient Boosting Machine) lightweight gradient hoist algorithm is a tree-based integrated learning method, and adopts gradient hoist technology, so that a plurality of weak learners (usually decision trees) can be combined into a model.
The traffic characteristics corresponding to the sample route may include road information such as total length of the whole journey, average speed limit of the whole journey, number of traffic lights of the whole journey, occupancy rate of congestion mileage, average free flow speed of the whole journey, average speed of the whole journey at a departure time calculated according to GPS (Global Positioning System ) data collected in real time, average speed of the whole journey about 5 minutes (10 minutes, 15 minutes, etc.) before and after the same time mined according to historical GPS data collected in the past several months, and the like. The whole-course average speed may refer to a speed obtained by averaging real-time speeds or historical speeds of all road sections of the whole course of the sample route.
The average vehicle speed of the whole course of the departure time is specifically calculated according to track points reported by other vehicles, and the real-time average vehicle speed of the other vehicles on the route at the departure time is calculated. The "same time" may be in units of weeks, for example for three afternoons of the week, the same time may be the average of three afternoons of the week for the first four weeks.
The route may include one road segment or may include a plurality of road segments, which is not limited in this embodiment. In map applications, a route is a complete line connecting the start and end points, and in practical situations, the length of a route is typically in the range of one kilometer to several tens of kilometers. Specifically, in map applications, a route is expressed in a sequence of road segments (links). In map data, a road is divided into segments of several tens of meters to several kilometers, each of which is called a link and is assigned a globally unique id (identity). Thus, a route in a map is a sequence of all segments in the route.
The desired transit time is the actual transit time (which may also be referred to as the actual arrival time) of the sample route, specifically the time required to actually finish the sample route. In the historical data of the map service, the actual arrival time (Actual Time of Arrival, ATA) of a route can be extracted, so this data can be used as a true value to train a machine learning algorithm model to use the model to estimate the arrival time.
The training method of the time prediction model can be used for estimating the arrival time (or pass time). The estimate of time of arrival (Estimated Time of Arrival, ETA) is a basic function in map software, which performs the following functions: for a given one of the routes, the time it takes to reach the end of the route from the start of the route is estimated. This function has a fundamental role, playing a vital role in many scenarios.
For example, in a navigation application, after a user selects a start point and an end point, the map software needs to plan an optimal travel route for the user, and specifically may provide a path with the shortest time consumption, and finding the path requires that the arrival time of all candidate routes can be estimated by combining the start point and the end point of the user, so as to provide a basis for providing the route with the shortest time consumption or selecting the route for the user; after the user initiates the navigation, there is also a need to continuously report the time required for the remaining travel to the user, both at the beginning and during the navigation.
For another example, in the take-out platform application, an order needs to be reasonably distributed for the courier, and the distribution order needs to calculate the total consumption time from taking to delivering of the meal according to the client position, the store position and the rider position corresponding to the take-out delivery order;
Also for example, in taxi taking applications, it is desirable to reasonably match users with taxis so that the time to empty a taxi is minimized, while planning a route requires accurate time estimation for each possible route.
Referring to fig. 1c, in order to show a possible scenario of estimated arrival time (ETA), in fig. 1c, the estimated arrival time of three candidate routes is shown, where the first route is 38 km in the whole course and 7 traffic lights are provided, and the estimated traffic time is 1 hour and 9 minutes, and compared with the other two schemes, the traffic distance is short; the whole course of the route in the second scheme is 40 km, 7 traffic lights are provided, and the estimated passing time is 1 hour and 9 minutes; the third scheme has the route of 40 km in the whole course and 18 traffic lights, the estimated passing time is 1 hour and 17 minutes, and compared with the other two schemes, the route has less congestion but long passing time. The user may select one of the schemes to begin navigation. It should be noted that the actual product may have different presentation forms.
In the travel field, the travel rule has obvious seasonal changes, for example, the travel rule changes from winter to spring and summer to autumn. These changes include more outages in the suburbs, different traffic conditions due to the change in the duty ratio of different vehicles, etc. This change in travel law often occurs gradually, which is also known in the field of machine learning as concept drift. When the concept drift occurs, the machine learning system needs to deal with the concept drift, and perform incremental learning periodically to adapt to the regular change, so as to ensure the predicted quality.
The incremental learning, namely continuous learning, is a machine learning method, and when new data is obtained, the method does not need to use past data, and only uses the new data to update the model in an incremental way, so that the model can adapt to the new data. The method can update the model rapidly with small calculation cost, and the effect of the model on old data is not obviously reduced. Typically, the data in incremental learning is generated batch by batch, with model updates being performed batch by batch, with each batch of data being updated once.
In this embodiment, the incremental traffic data is specifically traffic data for incremental learning. It is newly acquired traffic data and the sample route in the incremental traffic data may also be referred to as an incremental sample.
Specifically, in some embodiments, the growth construction of the model can be directly completed by using xgboost, lightGBM and other methods, and the model after the growth construction is a time prediction model; in other embodiments, the method of xgboost, lightGBM may be used to complete the growth and construction of the model, and then the historical traffic data is used to train and update the initial time prediction model obtained by the growth and construction, so as to obtain the time prediction model, where the training and updating process may be: selecting a part of the predictor models (marked as initial reference predictor models) in the initial time prediction model to construct a new predictor model, obtaining an initial target predictor model, and adding the initial target predictor model into the initial time prediction model; and repeating the training and updating process for N times to obtain a final time prediction model.
Optionally, in this embodiment, the historical traffic data includes at least one historical sample route, at least one traffic feature corresponding to the historical sample route, and a desired traffic time;
before the step of acquiring the time prediction model trained by using the historical traffic data and the incremental traffic data, the training method of the time prediction model may further include:
acquiring an initial time prediction model, wherein the initial time prediction model comprises at least three predictor models;
selecting a predictor model in the initial time prediction model to obtain at least one selected initial reference predictor model;
performing time prediction processing on the historical sample route based on each passing characteristic of the historical sample route through the initial reference predictor model to obtain the predicted passing time of the historical sample route output by the initial reference predictor model;
determining, for each historical sample route, time residual information to be fitted to the historical sample route based on expected transit times of the historical sample route and predicted transit times of the historical sample route output by the respective initial reference predictor model;
Constructing an initial target predictor model according to the time residual information required to be fitted by each historical sample route;
and adding the initial target predictor model into the initial time prediction model to obtain a time prediction model.
The historical traffic data may be a historical travel track collected by a map service.
The step of selecting the predictor model in the initial time prediction model to obtain the selected at least one initial reference predictor model may include:
selecting a predictor model from the initial time prediction models to delete, so as to obtain initial time prediction models after deletion;
selecting a predictor model in the initial time prediction model after the deletion processing, and determining at least one initial reference predictor model which is selected;
the step of adding the initial target predictor model to the initial temporal prediction model to obtain a temporal prediction model may include:
and adding the initial target predictor model into the initial time prediction model after the deletion processing to obtain a time prediction model.
Before determining the time residual information required to be fitted by the historical sample route, selecting a predictor model in the initial time predictor model after deletion, and only selecting part of predictor models to determine the time residual information required to be fitted by the initial target predictor model to be newly added instead of directly determining the time residual information by using all predictor models, thereby avoiding the situation that the importance of the initial target predictor model to be newly added is lower due to the fact that the time residual information required to be fitted is smaller.
Selecting a predictor model in the initial time prediction model after the deletion processing, specifically, for each predictor model in the initial time prediction model after the deletion processing, based on preset probability, conducting dropout processing on the predictor models, determining a dropout-out predictor model and a dropout-out predictor model, wherein the dropout-out predictor model is a selected initial reference predictor model, the dropout-out predictor model is another part of the non-selected predictor models, the dropout-out predictor model can be regarded as a temporarily hidden predictor model in the initial time prediction model after the deletion processing in the training of the round, and after the initial target predictor model is constructed, activating and reducing the hidden predictor model in the initial time prediction model after the deletion processing, and forming a new time prediction model by activating and reducing the original non-hidden predictor model and the newly added initial target predictor model.
The preset probability may be empirically set, for example, may be set to about 0.1.
The dropout processing specifically performs suppression processing on the predictor model, and may also be understood as hiding processing on the predictor model, where when the predictor model is a decision tree, the dropout processing may be to set the weight of all leaf nodes of the tree to 0, so that when calculating the time residual information of the fitting required by the historical sample route, the dropout-out predictor model does not function.
Wherein the initial temporal prediction model may include N predictor models. Each predictor model may correspond to at least one temporal prediction strategy; the time prediction strategy corresponding to the initial reference predictor model can be utilized to perform time prediction processing on the historical sample route based on the characteristic value of the traffic characteristic of the historical sample route, so as to obtain the predicted traffic time of the historical sample route output by the initial reference predictor model.
In this embodiment, the step of determining the time residual information to be fitted to the historical sample route based on the expected transit time of the historical sample route and the predicted transit time of the historical sample route output by each initial reference predictor model may include:
based on weight information corresponding to each initial reference predictor model, carrying out fusion processing on the predicted passing time of the historical sample route output by each initial reference predictor model to obtain fused predicted passing time;
and performing subtraction processing on the expected passing time of the historical sample route and the fused predicted passing time to obtain the time residual information required to be fitted by the historical sample route.
Wherein the fusion process may be a weighting operation or the like.
In this embodiment, the step of "constructing an initial target predictor model according to the time residual information required to be fitted by each historical sample route" may include:
determining gradient information corresponding to the historical sample route according to the time residual information required to be fitted by the historical sample route;
determining target gain information of each passing feature on passing time based on the gradient information and the feature value of the history sample route on each passing feature;
selecting a target passing feature from the passing features according to the target gain information of the passing features on the passing time;
and generating a time prediction strategy according to the target traffic characteristics, and constructing an initial target prediction sub-model based on the time prediction strategy.
The gradient information corresponding to the historical sample route may include a first-order gradient and a second-order gradient corresponding to the historical sample route.
Wherein, the traffic characteristic with the maximum target gain information for the traffic time can be determined as the target traffic characteristic.
In this embodiment, the step of determining the target gain information of each traffic feature to the traffic time based on the gradient information and the feature value of the history sample route on each traffic feature may include:
Dividing a preset characteristic value interval corresponding to the passing feature based on a preset characteristic value dividing point of the passing feature aiming at each passing feature to obtain at least two sub-characteristic value intervals corresponding to the passing feature;
for each sub-characteristic value interval, determining a history sample route of the history passing data, in which the characteristic value of the passing characteristic falls in the sub-characteristic value interval, so as to obtain a target history sample route corresponding to the sub-characteristic value interval;
determining the information entropy corresponding to the sub-characteristic value interval according to the gradient information of the target historical sample route corresponding to the sub-characteristic value interval;
calculating gain information of the passing feature on passing time under the preset feature value dividing points according to the information entropy corresponding to each sub-feature value interval; and determining target gain information of the passing characteristics on the passing time according to the gain information of the passing characteristics on the passing time at preset characteristic value dividing points.
Optionally, in this embodiment, the step of "constructing an initial target predictor model based on the temporal prediction strategy" may include:
generating a decision tree based on the time prediction strategy to obtain a decision tree model structure, wherein the decision tree model structure comprises at least one leaf node;
Determining leaf nodes in which the historical sample route falls based on the traffic characteristics of the historical sample route and the time prediction strategy;
determining, for each leaf node, a node value for the leaf node based on gradient information of a historical sample route falling on the leaf node;
and determining an initial target predictor model according to the decision tree model structure and the node value of each leaf node, wherein the initial target predictor model is a tree model.
In this embodiment, the step of adding the initial target predictor model to the initial time prediction model after the deletion process to obtain a time prediction model may include:
adding the initial target predictor model into the initial time prediction model after the deletion processing to obtain a time prediction model;
taking the time prediction model as a new initial time prediction model;
and returning to the step of executing the selection of the predictive sub-model from the initial time predictive models to perform deletion processing to obtain the initial time predictive models after the deletion processing until the time predictive models meeting the preset conditions are obtained.
Specifically, the present embodiment may generate a tree (i.e., a predictor model) using the method xgboost, lightGBM until the growth of the nth tree is iteratively completed, resulting in a tree model (i.e., an initial time prediction model) containing the N trees. On the basis of the N trees, deleting 1 tree, dropout is carried out on the rest trees, a new 1 tree is built by utilizing the tree which is not dropout, the newly built tree is added to the initial time prediction model with the 1 tree deleted, and the process is repeated for N times, so that the time prediction model is obtained. Since one new tree is retrained after each pruning, the new tree is added to the deleted tree model, and after repeating for N times, the tree model is still N trees.
Optionally, in this embodiment, the historical traffic data includes at least one historical sample route, at least one traffic feature corresponding to the historical sample route, and a desired traffic time;
before the step of acquiring the time prediction model trained by using the historical traffic data and the incremental traffic data, the method may further include:
determining time residual information to be fitted currently by the historical sample route based on expected passing time of the historical sample route;
constructing a predictor model according to the time residual information to be fitted currently of the historical sample route and each passing characteristic of the historical sample route;
returning to execute the step of determining the time residual information which needs to be fitted currently for the historical sample route according to the constructed prediction sub-model so as to construct and obtain a new prediction sub-model;
and obtaining a time prediction model based on each constructed predictor model.
Wherein, each predictor model is generated in an iterative mode, and the newly generated predictor model is continuously fitted with the residual error of the model (namely, the difference between the actual value and the predicted value), so that the prediction capability of the model is gradually improved. Specifically, when the number of generated predictor models reaches a preset number or the current time residual information to be fitted is smaller than a preset time residual, the construction of a new predictor model can be stopped, and each constructed predictor model is formed into a time predictor model.
In this embodiment, each tree learns the deficiency of the previous tree, and iterates for many times to generate many trees.
Optionally, in this embodiment, the step of determining, based on the expected transit time of the historical sample route, time residual information that the historical sample route needs to be fitted currently may include:
when the constructed predictor model does not exist, acquiring a preset fitting value, and determining the preset fitting value as time residual information which needs to be fitted currently for the historical sample route;
when the constructed prediction sub-model exists, performing time prediction processing on the historical sample route based on each passing characteristic of the historical sample route through the constructed prediction sub-model to obtain the predicted passing time of the historical sample route output by the constructed prediction sub-model;
for each historical sample route, determining time residual information which is needed to be fitted currently by the historical sample route based on expected passing time of the historical sample route and predicted passing time of the historical sample route output by each constructed predictor model.
The fact that the constructed predictor model does not exist indicates that the first predictor model is currently constructed, the preset fitting value may be set based on the expected passing time of the historical sample route, for example, the expected passing time is 1 hour, the preset fitting value may be set to 0.5 hour, and the method is not limited to this according to practical situations.
When the constructed prediction sub-model exists, a time prediction strategy corresponding to the constructed prediction sub-model can be utilized for each constructed prediction sub-model, and based on each passing feature of the historical sample route, time prediction processing can be carried out on the historical sample route, so that the predicted passing time of the historical sample route is obtained.
After obtaining the predicted passing time of the historical sample route output by each constructed and completed predictor model, carrying out fusion processing on the predicted passing time of the historical sample route output by each constructed and completed predictor model, wherein the fusion processing mode can be weighted summation, so as to obtain the predicted passing time after fusion; and subtracting the predicted passing time after fusion from the expected passing time of the historical sample route to obtain the time residual information which needs to be fitted currently for the historical sample route.
Optionally, in this embodiment, the step of "constructing a predictor model according to the time residual information that the historical sample route needs to be fitted currently and each traffic feature of the historical sample route" may include:
determining gradient information corresponding to the historical sample route according to the time residual information of the current fitting required by the historical sample route;
determining target gain information of each passing feature on passing time based on the gradient information and the feature value of the history sample route on each passing feature;
selecting a target passing feature from the passing features according to the target gain information of the passing features on the passing time;
and generating a time prediction strategy according to the target traffic characteristics, and constructing a predictor model based on the time prediction strategy.
The gradient information corresponding to the historical sample route can comprise a first-order gradient and a second-order gradient. The process of determining the target gain information of each traffic feature with respect to the traffic time may refer to the above embodiment, and will not be described herein. After the target gain information of each traffic characteristic on the traffic time is obtained, the traffic characteristic with the maximum target gain information on the traffic time can be determined as the target traffic characteristic.
The time prediction policy may be a policy for predicting a traffic time corresponding to the historical sample route, for example, the time prediction policy may be the number of traffic lights in the whole course of the route, or may be a situation of traffic jam in the whole course, or may be an average vehicle speed in the whole course, which is not limited in this embodiment.
Optionally, in this embodiment, the step of "constructing a predictor model based on the temporal prediction strategy" may include:
generating a decision tree based on the time prediction strategy to obtain a decision tree model structure, wherein the decision tree model structure comprises at least one leaf node;
determining leaf nodes in which the historical sample route falls based on the traffic characteristics of the historical sample route and the time prediction strategy;
determining, for each leaf node, a node value for the leaf node based on gradient information of a historical sample route falling on the leaf node;
and determining a predictor model according to the decision tree model structure and the node value of each leaf node, wherein the predictor model is a tree model.
In this embodiment, a tree can be grown by continuously performing feature splitting, and each round of learning a tree is actually to fit the residual between the predicted value and the actual value of the previous round of model. When training is completed to obtain N trees, the passing time of one sample route is predicted, namely the passing time of the sample route is predicted by only adding the corresponding predicted values of each tree according to the passing characteristics of the sample route and falling to the corresponding leaf node in each bare tree, wherein each leaf node corresponds to one predicted value.
102. And selecting the predictor model in the time prediction model to obtain at least one selected reference predictor model.
Optionally, in this embodiment, the step of "selecting a predictor model in the temporal prediction model to obtain the selected at least one reference predictor model" may include:
selecting a to-be-deleted prediction sub-model from the time prediction models, and deleting the to-be-deleted prediction sub-model from the time prediction models to obtain deleted time prediction models;
and selecting the predictor model in the deleted time predictor model, and determining at least one selected reference predictor model.
The number of the to-be-deleted predictor models may be 1, or may be set in another way according to actual situations, which is not particularly limited in this embodiment.
Selecting a predictor model in the time prediction model after the deletion processing, specifically, performing dropout processing on the predictor model based on a preset probability for each predictor model in the time prediction model after the deletion processing, determining a dropout-out predictor model and a dropout-out predictor model, wherein the dropout-out predictor model is a selected reference predictor model, the dropout-out predictor model is another part of the non-selected predictor models, and the dropout-out predictor model can be regarded as a temporarily hidden predictor model in the time prediction model after the deletion processing in the training of the round.
The preset probability may be empirically set, for example, may be set to about 0.1.
The dropout processing specifically performs suppression processing on the predictor model, and may also be understood as hiding processing on the predictor model, where when the predictor model is a decision tree, the dropout processing may be to set the weight of all leaf nodes of the tree to 0, so that when calculating time residual information of fitting required by the sample route, the dropout-removed predictor model does not function.
The dropout process is a regularization method in the neural network to prevent model overfitting. By randomly zeroing some neurons, only part of the neurons are activated at a time, so that the robustness of the model is improved.
In a specific embodiment, the number of predictor models in the temporal prediction model may be denoted as N, the number of deleted predictor models is 1, and the number of dropouts-out predictor models is k, and the number of selected reference predictor models is N-1-k.
103. And inputting each traffic characteristic of the sample route in the incremental traffic data into the reference predictor model to perform time prediction processing of the sample route, so as to obtain the predicted traffic time of the sample route output by the reference predictor model.
Wherein each reference predictor model may correspond to at least one temporal prediction strategy, and the reference predictor model may be a decision tree comprising at least one leaf node. The time prediction policy may be a policy for predicting a passage time corresponding to the historic sample route, and in particular, the time prediction policy may be a judgment rule related to a passage feature.
For example, a certain time prediction strategy may be x1 < 6, or x1 > 10 and x2 < 40, which may be specifically set according to practical situations. Wherein x1 and x2 are traffic characteristics, for example, x1 may be the number of traffic lights in the whole course, and x2 may be the whole-course average vehicle speed.
In this embodiment, for each reference predictor model, based on the corresponding time prediction policy and each traffic feature of the sample route, the time prediction processing may be performed on the sample route to obtain the predicted traffic time of the sample route output by the reference predictor model.
In a specific embodiment, the time prediction processing is performed on the sample route, which may specifically be that a target leaf node of the sample route falling into the reference prediction sub-model is determined according to a time prediction strategy corresponding to the reference prediction sub-model and feature values of each traffic feature of the sample route; and determining the predicted transit time of the sample route output by the reference prediction sub-model according to the node value of the target leaf node. Wherein the node value of the target leaf node may be determined as the predicted transit time of the sample route output by the reference predictor model.
104. For each sample route, determining time residual information of a required fit of the sample route based on the expected transit time of the sample route and the predicted transit time of the sample route output by each reference predictor model.
Specifically, in this embodiment, the step of determining time residual information to be fitted to the sample route based on the expected transit time of the sample route and the predicted transit time of the sample route output by each reference predictor model may include:
based on weight information corresponding to each reference prediction sub-model, carrying out fusion processing on the predicted passing time of the sample route output by each reference prediction sub-model to obtain fused predicted passing time;
and determining time residual information required to be fitted by the sample route based on the expected transit time of the sample route and the fused predicted transit time.
The fusion processing method of the predicted passing time of the sample route output by each reference predictor model is various, for example, the fusion processing method can be weighted summation or the like, so as to obtain the fused predicted passing time. After the fused predicted traffic time is obtained, the expected traffic time of the sample route can be subtracted from the fused predicted traffic time to obtain time residual information of the sample route required to be fitted.
105. And constructing a target predictor model according to the time residual information required to be fitted by each sample route.
Optionally, in this embodiment, the step of "constructing the target predictor model according to the time residual information to be fitted to each sample route" may include:
determining gradient information corresponding to the sample route according to the time residual information required to be fitted by the sample route;
determining target gain information of each passing feature on passing time based on the gradient information and the feature value of the sample route on each passing feature;
selecting a target passing feature from the passing features according to the target gain information of the passing features on the passing time;
and generating a time prediction strategy according to the target traffic characteristics, and constructing a target prediction sub-model based on the time prediction strategy.
The time residual information of the sample route to be fitted may be specifically the expected transit time of the sample route under the newly added target predictor model. The present embodiment needs to make the transit time prediction result of the sample route output by the constructed target predictor model approach to the time residual information of the fitting required by the sample route.
Wherein, in order to enable the newly added predictor model to reduce the time residual information to the greatest extent, the gradient information of the sample route can be determined based on the time residual information to be fitted. A gradient is a vector (vector) that shows that the directional derivative of a function at that point takes a maximum along that direction, i.e. the function changes the fastest along that direction at that point with the greatest rate of change; thus, the gradient information can be utilized to construct a new predictor model.
For a sample route, there are a plurality of traffic features, which do not necessarily help to fit time residual information, and in this embodiment, data mining may be performed on the traffic features, and target traffic features that have an obvious effect on fit time residual information (or predicted traffic time) may be screened from the traffic features. Then, a target predictor model for fitting the time residual information is constructed based on the mined target traffic characteristics.
Alternatively, in some embodiments, a traffic feature with the target gain information greater than the preset gain information may be selected as the target traffic feature. The preset gain information may be set according to actual situations, which is not limited in this embodiment. For example, the number of the target traffic characteristics can be set according to the requirement.
Alternatively, in other embodiments, the traffic features may be ranked according to the target gain information, and the target traffic feature may be selected from the ranked traffic features. Specifically, if the traffic characteristics are ranked from large to small based on the target gain information, the first n traffic characteristics in the ranked interactive characteristics may be used as the target traffic characteristics.
In particular, the target gain information of the traffic feature for the traffic time may be used to identify the contribution of the traffic feature to the fitting time residual information. In particular, the higher the target gain information, the more effectively the traffic feature can fit the time residual information.
Optionally, in this embodiment, the step of determining the target gain information of each traffic feature versus the traffic time based on the gradient information and the feature value of the sample route on each traffic feature may include:
dividing a preset characteristic value interval corresponding to the passing feature based on a preset characteristic value dividing point of the passing feature aiming at each passing feature to obtain at least two sub-characteristic value intervals corresponding to the passing feature;
determining a sample route of the increment traffic data, in which the characteristic value of the traffic characteristic falls in the sub-characteristic value interval, aiming at each sub-characteristic value interval, so as to obtain a target sample route corresponding to the sub-characteristic value interval;
Determining the information entropy corresponding to the sub-characteristic value interval according to the gradient information of the target sample route corresponding to the sub-characteristic value interval;
calculating gain information of the passing feature on passing time under the preset feature value dividing points according to the information entropy corresponding to each sub-feature value interval; and determining target gain information of the passing characteristics on the passing time according to the gain information of the passing characteristics on the passing time at preset characteristic value dividing points.
The preset characteristic value dividing point is one characteristic value in a preset characteristic value interval corresponding to the passing characteristic, and can be used for dividing the preset characteristic value interval. The preset feature value interval may be set according to actual situations, which is not limited in this embodiment. The preset feature value dividing point divides the preset feature value interval into at least two sub-feature value intervals.
In some embodiments, the preset feature value division point may be a division point in a division point set of the traffic feature, and the division point set may include a plurality of division points. Specifically, each feature value in the preset feature value interval may be traversed, and each feature value in the preset feature value interval is added to the division point set of the passing feature. Specifically, the preset feature value interval may be a continuous interval; discrete points in the preset characteristic value interval can be taken as preset characteristic value dividing points.
For example, the traffic characteristic is the number of traffic lights in the whole course, the preset characteristic value interval can be set to 0 to 20, and the preset characteristic value division point can be set to 1, 2, 3, …, 18 or 19. If the preset feature value dividing point is 10, the two sub-feature value intervals obtained by dividing are respectively 0 to 10 and 10 to 20. In other embodiments, the division point set of the traffic feature may include 1, 2, 3, …, 18 and 19 nineteen preset feature value division points, and for each preset feature value division point, the preset feature value interval corresponding to the traffic feature is divided based on the preset feature value division point, so as to obtain two sub-feature value intervals.
In other embodiments, for a certain traffic feature, the feature value of each sample route under the traffic feature may be added to the division point set of the traffic feature, each feature value in the division point set is taken as a division point,
for another example, the traffic feature is the number of traffic lights in the whole course, and there are 5 sample routes, and the number of traffic lights in the whole course is 1, 5, 3, 8, 4, respectively, so that 1, 5, 3, 8, 4 can be added into the division point set of the traffic feature.
Specifically, in this embodiment, a preset feature value dividing point includes at least one feature value, that is, a preset feature value dividing point may include one feature value or may include a plurality of feature values, which is not limited in this embodiment. If one preset feature value division point only contains one feature value, the preset feature value interval can be divided into two sub-feature value intervals, and if one preset feature value division point contains a plurality of (e.g. n) feature values, the preset feature value interval can be divided into n+1 sub-feature value intervals. It can be understood that the number of sub-feature value intervals may be the number of feature values in the preset feature value dividing point plus one.
In this embodiment, the target sample route corresponding to the sub-feature value interval is specifically a sample route in which the feature value of the passing feature in the incremental passing data falls in the sub-feature value interval. For example, the preset feature value dividing point of a certain traffic feature divides the feature value interval into two sub-feature value intervals greater than 10 and less than 10, and for the sub-feature value interval greater than 10, the corresponding target sample route can be the sample route with the feature value greater than 10 of the traffic feature; for sub-feature value intervals less than 10, the corresponding target sample route may be a sample route with a feature value of the pass feature less than 10.
In particular, the gradient information of the sample route may include a first order gradient and a second order gradient. Sample routeThe first order gradient can be noted +.>The second order gradient can be noted +.>. If the preset characteristic value dividing point divides the preset characteristic value interval into two sub-characteristic value intervals, namely a first sub-characteristic value interval and a second sub-characteristic value interval. For the first sub-feature value interval, fusing (e.g. adding) one step of the target sample route corresponding to the first sub-feature value interval to obtain +.>Fusing (e.g. adding) the second order gradients of the target sample route corresponding to the first sub-feature value interval to obtain +. >Thereby according to->And->The information entropy corresponding to the first sub-characteristic value interval is determined (may be +.>). For the second sub-feature value interval, fusing (e.g. adding) one step of the target sample route corresponding to the second sub-feature value interval to obtain +.>Fusing (e.g. adding) the second order gradients of the target sample routes corresponding to the second sub-feature value interval to obtain +.>Thereby according to->And->The information entropy corresponding to the second sub-characteristic value interval is determined (may be +.>)。
Optionally, in this embodiment, step "calculating gain information of the passing feature on passing time under the preset feature value dividing point according to information entropy corresponding to each sub-feature value interval; and determining target gain information "of the passing feature on the passing time according to the gain information of the passing feature on the passing time under the preset feature value dividing point, which may include:
carrying out logic operation on the information entropy corresponding to each sub-characteristic value interval to obtain gain information of the passing characteristic on passing time under the preset characteristic value dividing point;
selecting a target characteristic value dividing point from all preset characteristic value dividing points based on gain information of the passing characteristic on passing time under all preset characteristic value dividing points;
And determining the target gain information of the passing feature on the passing time based on the gain information of the passing feature on the passing time under the target feature value dividing point.
Wherein the logical operation may be addition and subtraction.
Wherein, different preset characteristic value dividing points correspond to different sub-characteristic value intervals, and the information entropy corresponding to different sub-characteristic value intervals is different. The larger the gain information of the passing feature to the passing time under the preset feature value dividing point is, the more the preset feature value dividing point can be used for effectively fitting the time residual information.
Specifically, a preset characteristic value dividing point with the maximum gain information of the passing characteristic to the passing time can be used as a target characteristic value dividing point; and determining the gain information of the passing feature to the passing time under the target feature value dividing point as the target gain information of the passing feature to the passing time.
For a traffic feature, the present embodiment may determine its optimal preset feature value division point (i.e., the target feature value division point). Specifically, for each preset feature value dividing point of the passing feature, gain information of the passing feature on passing time under the preset feature value dividing point can be calculated. In some embodiments, the preset feature value division point with the maximum gain information, that is, the target gain information of the passing feature versus the passing time, may be used as the optimal target feature value division point. After the target gain information of each passing feature for the passing time is obtained, the passing feature with the target gain information larger than the preset gain information can be selected as the target passing feature.
The method and the device can judge which traffic characteristics can more accurately predict the time residual information to be fitted by the sample route, thereby selecting the target traffic characteristics with higher relevance with the time residual information and improving the accuracy of traffic characteristic selection.
Optionally, in this embodiment, the step of "generating a time prediction policy according to the target traffic feature" may include:
determining a target characteristic value dividing point corresponding to the target passing characteristic according to the gain information of the target passing characteristic on the passing time under each preset characteristic value dividing point;
and generating and outputting a time prediction strategy corresponding to the target traffic feature according to the target traffic feature and the target feature value segmentation point corresponding to the target traffic feature.
The time prediction strategy is a rule for predicting the passing time, and represents the judgment and execution logic of the corresponding predictor model.
Optionally, in this embodiment, the contribution degree of each traffic feature to the time residual information to be fitted may be ordered according to the feature selection means of the gain information, specifically, the target traffic feature with the largest target gain information may be used as the root node of the decision tree, then the traffic feature with the largest contribution degree to the time residual information to be fitted in the remaining target traffic features is sequentially selected from the root node, and is used as the time prediction policy of the current node, so that the leaf node is further constructed, and then the process is recursively repeated from top to bottom until the traffic feature runs out or meets the preset requirement, thereby completing the growth construction of the decision tree.
Optionally, in this embodiment, the step of "constructing the target predictor model based on the temporal prediction strategy" may include:
generating a decision tree based on the time prediction strategy to obtain a decision tree model structure, wherein the decision tree model structure comprises at least one leaf node;
determining leaf nodes in which the sample route falls based on the traffic characteristics of the sample route and the time prediction strategy;
determining, for each leaf node, a node value for the leaf node based on gradient information of a sample route falling on the leaf node;
and determining a target predictor model according to the decision tree model structure and the node value of each leaf node, wherein the target predictor model is a tree model.
For a certain leaf node, marking a sample route falling on the leaf node as a target sample route, and fusing (such as adding) one step of each target sample route to obtain a fused first-order gradient; and (3) fusing (e.g. adding) the second-order gradients of each target sample route to obtain fused second-order gradients, so as to determine the node value of the leaf node according to the fused first-order gradients and the fused second-order gradients.
106. And adding the target prediction sub-model into the time prediction model to obtain a target time prediction model, wherein the target time prediction model is used for carrying out transit time prediction processing on a target route to obtain a transit time prediction result.
Specifically, in each iteration, the application uses the increment sample to generate a new target predictor model, and the structure and parameters of other existing predictor models are not adjusted, so that the model can be prevented from excessively learning the new sample, so that the old sample is forgotten.
Optionally, in this embodiment, the step of "selecting a predictor model in the temporal prediction model to obtain the selected at least one reference predictor model" may include:
selecting a to-be-deleted prediction sub-model from the time prediction models, and deleting the to-be-deleted prediction sub-model from the time prediction models to obtain deleted time prediction models;
selecting a predictor model in the deleted time prediction model, and determining at least one selected reference predictor model;
the step of adding the target predictor model to the temporal prediction model to obtain a target temporal prediction model may include:
And adding the target prediction sub-model into the deleted time prediction model to obtain a target time prediction model.
Before determining the time residual information to be fitted of the sample route, selecting the predictor models in the time predictor models after deletion processing, and only selecting part of the predictor models to determine the time residual information to be fitted of the target predictor model to be newly added instead of directly determining the time residual information by using all the predictor models, so that the situation that the importance of the newly added target predictor model is lower due to the fact that the time residual information to be fitted is smaller is avoided.
Selecting a predictor model in the post-deletion time prediction model, specifically, performing dropout processing on each predictor model in the post-deletion time prediction model based on a preset probability, determining a dropout-removed predictor model and a non-dropout predictor model, wherein the non-dropout predictor model is a selected reference predictor model, the dropout-removed predictor model is another non-selected part of the predictor models, the dropout-removed predictor model can be regarded as a temporarily hidden predictor model in the post-deletion time prediction model in the training of the round, and after a target predictor model is obtained by constructing, activating and reducing the hidden predictor model in the post-deletion time prediction model, and forming a new target time prediction model by activating and reducing the restored predictor model, the original non-hidden reference predictor model and a newly added target predictor model.
The dropout processing specifically performs suppression processing on the predictor model, and may also be understood as hiding processing on the predictor model, where when the predictor model is a decision tree, the dropout processing may be to set the weight of all leaf nodes of the tree to 0, so that when calculating time residual information of fitting required by the sample route, the dropout-removed predictor model does not function.
In this embodiment, a change in the data rule of new data can be captured by adding a new tree. To avoid unlimited growth of the predictor model in the temporal prediction model with incremental training, resulting in model incremental training that is not sustainable; in this embodiment, the number of the predictor models in the temporal prediction model may be maintained within a certain range by deleting the predictor model and adding the target predictor model trained using the new incremental data.
Optionally, in this embodiment, the step of adding the target predictor model to the post-deletion time prediction model to obtain a target time prediction model may include:
adding the target predictor model into the deleted time prediction model to obtain a target time prediction model;
Taking the target time prediction model as a new time prediction model;
and returning to the step of executing the to-be-deleted prediction sub-model selected from the time prediction models, deleting the to-be-deleted prediction sub-model from the time prediction models to obtain the time prediction models after deletion processing until the target time prediction models meeting preset conditions are obtained.
The preset condition can be set according to actual conditions. For example, the preset condition may be that the number of iterations reaches a preset number T.
Wherein, T can be determined according to the size of the sample size in the incremental traffic data, and if the sample size is more, some original trees can be replaced more, and T can be set larger; if the sample size is small, some original trees can be replaced less, and T can be set smaller.
Optionally, in this embodiment, the step of adding the target predictor model to the temporal prediction model to obtain a target temporal prediction model may include:
determining weight information of the target predictor model according to the number of reference predictors and the number of predictors in the time predictor model;
And adding the target prediction sub-model into the time prediction model based on the weight information to obtain a target time prediction model.
Specifically, the number of the predictor models in the time prediction model can be recorded as N, the number of the predictor models deleted in the round of training can be recorded as s, and the number of the predictor models in the time prediction model after deleting is N-s; if the number of dropouts of the temporal prediction model after the deletion process is k, the number of reference prediction sub-models is N-s-k, and the weight information of the newly added target prediction sub-model may be
Optionally, in this embodiment, the predictor model is a tree model including at least one leaf node; after the step of adding the target predictor model to the time prediction model to obtain a target time prediction model, the training method of the time prediction model may further include:
aiming at each predictor model in the target time prediction model, determining a target leaf node of the target route falling into the predictor model according to a time prediction strategy corresponding to the predictor model and each passing characteristic of the target route;
Determining the predicted transit time of the target route output by the predictor model according to the node value of the target leaf node;
and based on the weight information of each prediction sub-model, carrying out aggregation processing on the predicted passing time output by each prediction sub-model to obtain the target passing time required by the target route.
The aggregation processing mode of the predicted passing time output by each prediction sub-model can be weighted summation or the like.
Each predictor model is equivalent to a decision tree, and each predictor model corresponds to a time prediction strategy of at least one target traffic feature under a target feature value segmentation point. The decision tree represents the business rule by one or more tree results, and mainly comprises a root node, a judging node, a leaf node, judging conditions and the like.
In this embodiment, the time prediction processing is performed on the target route by using the predictor model based on the feature values corresponding to the traffic features of the target route, which may specifically be that at least one time prediction policy corresponding to the predictor model is utilized, the target leaf node where the target route falls in the predictor model is determined based on the feature values of the traffic features of the target route, and then the predicted traffic time of the target route output by the predictor model is determined according to the node value of the target leaf node.
According to the application, a random Dropout method can be introduced into the gradient lifting decision tree to perform incremental learning of arrival time estimation, so that not only can the accuracy of estimation be improved and the optimization capability be better, but also the model can be updated in an incremental manner, so that the model can be continuously learned, and the response speed of the model to traffic law change is improved. Specifically, the model update of the application mainly comprises four parts, wherein the first part is the construction of an initial gradient lifting decision tree; the second part is the collection and construction of incremental samples; the third part is to use Dropout technology, train gradient of increment to raise decision tree, and guarantee the tree is unchanged; the fourth part is the continuous integration and reasoning of the online model.
The construction process of the initial gradient lifting decision tree (specifically, the time prediction model in the above embodiment) may specifically be: the number of the trees in the initial gradient lifting decision tree is recorded as N, the initial gradient lifting decision tree can be obtained by training directly by using methods such as xgboost, lightgbm, the method from the (2) step to the (5) step in the following embodiment can be used, the initial gradient lifting decision tree can be obtained repeatedly for N times, and in this way, compared with the advantages of xgboost and lightgbm, the importance of each trained tree is not greatly different, and the situation that the importance of the later tree is lower in the xgboost, lightgbm method is avoided. Thus, the robustness is better when dropout is carried out subsequently.
For the second part, there are two ways of collection and construction of incremental samples. The map traffic collects new traffic trajectories each day, which can be processed in two ways, real-time processing and batch processing, respectively.
The real-time processing means that the user returns the track in real time, and after the background judges that one section of travel is finished, the track of the whole section of travel is spliced to obtain a complete track, and the complete track is accumulated in the database. In this way of real-time processing, there can be two incremental sample construction methods:
a) Intercepting according to time: taking the track of each hour/day as an incremental sample, and training a model;
b) Intercepting according to the quantity: the model was trained with every hundred thousand/million tracks as one incremental sample.
The batch processing refers to unified processing of the tracks every day/week after the real-time tracks fall on the disc, so as to obtain a complete training sample. This sample was used as an incremental sample to train the model.
After the incremental samples are obtained, a third part, namely, using Dropout technology, incrementally training a gradient lifting decision tree (i.e., a real-time predictive model), wherein the gradient lifting decision tree can comprise N trees (each tree corresponds to a predictive sub-model); referring to fig. 1d, the updating process of the gradient boosting decision tree is specifically as follows:
(1) Selection of the number of decision trees for incremental training: the number of decision trees to be trained can be marked as T, and the T can be a fixed number of 1 or 10, etc.; the selection may also be based on the sample size, for example 1 tree for every 10 ten thousand samples, where T is 4 if there are 40 ten thousand samples. It will be appreciated that it is necessary to ensure that T is less than or equal to N;
(2) Randomly selecting any 1 tree from the original N trees, deleting the tree to obtain a time prediction model after deletion processing in the embodiment;
(3) Determining whether to dropout the rest of N-1 trees according to a certain probability (p), wherein the number of the dropout trees is k, and k can be an integer between 0 and N-1, including 0 and N-1;
(4) Training a new tree through N-1-k trees which are not dropout (namely a reference predictor model in the embodiment), fitting residual errors of the N-k-1 trees which are not dropout, restoring the k trees which are dropout, adding the new tree into the rest N-1 trees (namely adding the new tree into the time prediction model after deletion treatment), and forming a new N trees which are new target time prediction models;
(5) Setting the weight of the new tree asI.e. multiply its predicted value by +. >
(6) Iterating the steps (2) to (5) for T times.
The reason for weighting in the step (5) is as follows: the k trees of dropout and the trees deleted in the step (2) are also residuals of the N-k-1 numbers, the final model can accumulate the N-k-1 numbers without dropout, the k numbers of dropout and the results of the new training trees, and if the new trees are not weighted, the accumulated results are overlarge. Thus, the present embodiment considers the newly trained tree and k numbers of dropouts as a whole, fits the residuals of N-k-1 numbers, thus totaling k+1 numbers, each tree weighted asTherefore, the newly trained tree weight is +.>
In addition, the reason that Dropout does not require re-weighting of the k numbers is: the deleted tree of step (2) can be considered as a whole with the k numbers of dropout, fitting the residuals of N-k-1 numbers. The newly trained tree fills the blank of deleting the tree in the step (2), so that the weight of the original k numbers is unchanged and re-weighting is not needed.
Wherein T is the number of iterative loops (3) - (5) that go through this process.
After the model is updated, the model can be pushed to online for model reasoning after passing a certain quality verification. The whole process is connected in series, and continuous integration of the heaven level or the week level can be achieved.
The dropout technology introduced by the training method of the time prediction model improves the importance of each tree, so that the accuracy of the gradient lifting decision tree can be improved, the on-line reasoning performance is not influenced, the incremental updating of the gradient lifting decision tree is realized, and the time prediction can be timely adapted to seasonal and regular travel rule changes.
As can be seen from the foregoing, the present embodiment may acquire a time prediction model trained with historical traffic data and incremental traffic data, where the time prediction model includes a plurality of predictor models, the incremental traffic data includes at least one sample route, at least one traffic feature corresponding to the sample route, and an expected traffic time, and the incremental traffic data is traffic data for incremental learning; selecting a predictor model in the time prediction model to obtain at least one selected reference predictor model; inputting each traffic characteristic of a sample route in the incremental traffic data into the reference predictor model to perform time prediction processing of the sample route, so as to obtain predicted traffic time of the sample route output by the reference predictor model; determining, for each sample route, time residual information to be fitted to the sample route based on the expected transit time of the sample route and the predicted transit time of the sample route output by the respective reference predictor model; constructing a target predictor model according to the time residual information required to be fitted by each sample route; and adding the target prediction sub-model into the time prediction model to obtain a target time prediction model, wherein the target time prediction model is used for carrying out transit time prediction processing on a target route to obtain a transit time prediction result.
The application can select part of the predictor models in the time predictor model, and determine the time residual information which needs to be fitted for the increment sample based on the selected predictor models, thereby generating the target predictor model based on the time residual information, and capturing the change of the data rule in the new increment sample through the newly added target predictor model; in addition, the time residual information fitted by the newly added target predictive sub-model corresponds to the unselected predictive sub-model, so that the importance of the target predictive sub-model can be improved. Because if some predictor models are not selected, all predictor models are directly used for determining the time residual information, the time residual information required to be fitted may be smaller, which may result in lower importance of the target predictor model after learning. Moreover, the time prediction model can be updated in an increment mode, the whole time prediction model does not need to be updated every time, a new prediction sub model is only generated based on an increment sample, other prediction sub models are not needed to be changed, the prediction effect of the model on old data is not obviously reduced, and the accuracy of time prediction can be improved under the condition that the updated time prediction model is applicable to the change of data rules in historical data; and the model updating cost is low, so that the model can continuously learn, the response speed of the model to the change of the traffic rule is improved, and the timely adaptation of the traffic time estimation to the change of the travel rule is realized.
The method according to the previous embodiment, the training device of the time prediction model is specifically integrated in the server for example, which will be described in further detail below.
The embodiment of the application provides a training method of a time prediction model, as shown in fig. 2, the specific flow of the training method of the time prediction model can be as follows:
201. the method comprises the steps that a server obtains a time prediction model trained by historical traffic data and incremental traffic data, wherein the time prediction model comprises a plurality of predictor models, and the incremental traffic data comprises at least one sample route, at least one traffic feature corresponding to the sample route and expected traffic time.
The time prediction model can be a tree model constructed based on a decision tree algorithm, and the like. The tree model may be a GBDT model, an Xgboost model, a LightGBM model, or the like. The temporal prediction model comprises a plurality of predictor models, and particularly can comprise at least three predictor models, when the temporal prediction model is a tree model, the temporal prediction model can be composed of a plurality of decision trees, and each predictor model can be a decision tree.
In this embodiment, the incremental traffic data is specifically traffic data for incremental learning. It is newly acquired traffic data and the sample route in the incremental traffic data may also be referred to as an incremental sample.
The incremental learning, namely continuous learning, is a machine learning method, and when new data is obtained, the method does not need to use past data, and only uses the new data to update the model in an incremental way, so that the model can adapt to the new data. The method can update the model rapidly with small calculation cost, and the effect of the model on old data is not obviously reduced. Typically, the data in incremental learning is generated batch by batch, with model updates being performed batch by batch, with each batch of data being updated once.
Specifically, in some embodiments, the growth construction of the model can be directly completed by using xgboost, lightGBM and other methods, and the model after the growth construction is a time prediction model; in other embodiments, the method of xgboost, lightGBM may be used to complete the growth and construction of the model, and then the historical traffic data is used to train and update the initial time prediction model obtained by the growth and construction, so as to obtain the time prediction model, where the training and updating process may be: selecting a part of the predictor models (marked as initial reference predictor models) in the initial time prediction model to construct a new predictor model, obtaining an initial target predictor model, and adding the initial target predictor model into the initial time prediction model; and repeating the training and updating process for N times to obtain a final time prediction model.
202. And selecting a to-be-deleted prediction sub-model from the time prediction models by the server, and deleting the to-be-deleted prediction sub-model from the time prediction models to obtain the time prediction models after deletion processing.
The number of the to-be-deleted predictor models may be 1, or may be set in another way according to actual situations, which is not particularly limited in this embodiment.
In this embodiment, a change in the data rule of new data can be captured by adding a new tree. To avoid unlimited growth of the predictor model in the temporal prediction model with incremental training, resulting in model incremental training that is not sustainable; in this embodiment, the number of the predictor models in the temporal prediction model may be maintained within a certain range by deleting the predictor model and adding the target predictor model trained using the new incremental data.
203. And the server performs selection processing on the predictor models in the deleted time prediction models, and determines at least one selected reference predictor model.
Selecting a predictor model in the time prediction model after the deletion processing, specifically, performing dropout processing on the predictor model based on a preset probability for each predictor model in the time prediction model after the deletion processing, determining a dropout-out predictor model and a dropout-out predictor model, wherein the dropout-out predictor model is a selected reference predictor model, the dropout-out predictor model is another part of the non-selected predictor models, and the dropout-out predictor model can be regarded as a temporarily hidden predictor model in the time prediction model after the deletion processing in the training of the round.
The preset probability may be empirically set, for example, may be set to about 0.1.
The dropout processing specifically performs suppression processing on the predictor model, and may also be understood as hiding processing on the predictor model, where when the predictor model is a decision tree, the dropout processing may be to set the weight of all leaf nodes of the tree to 0, so that when calculating time residual information of fitting required by the sample route, the dropout-removed predictor model does not function.
The dropout process is a regularization method in the neural network to prevent model overfitting. By randomly zeroing some neurons, only part of the neurons are activated at a time, so that the robustness of the model is improved.
204. And the server performs time prediction processing on the sample route based on each passing characteristic of the sample route through the reference prediction sub-model to obtain the predicted passing time of the sample route output by the reference prediction sub-model.
Wherein each reference predictor model may correspond to at least one temporal prediction strategy, and the reference predictor model may be a decision tree comprising at least one leaf node. The time prediction policy may be a policy for predicting a passage time corresponding to the historic sample route, and in particular, the time prediction policy may be a judgment rule related to a passage feature.
In this embodiment, for each reference predictor model, based on the corresponding time prediction policy and each traffic feature of the sample route, the time prediction processing may be performed on the sample route to obtain the predicted traffic time of the sample route output by the reference predictor model.
In a specific embodiment, the time prediction processing is performed on the sample route, which may specifically be that a target leaf node of the sample route falling into the reference prediction sub-model is determined according to a time prediction strategy corresponding to the reference prediction sub-model and feature values of each traffic feature of the sample route; and determining the predicted transit time of the sample route output by the reference prediction sub-model according to the node value of the target leaf node. Wherein the node value of the target leaf node may be determined as the predicted transit time of the sample route output by the reference predictor model.
205. The server determines, for each sample route, time residual information to be fitted to the sample route based on the expected transit time of the sample route and the predicted transit time of the sample route output by the respective reference predictor model.
Specifically, in this embodiment, the step of determining time residual information to be fitted to the sample route based on the expected transit time of the sample route and the predicted transit time of the sample route output by each reference predictor model may include:
Based on weight information corresponding to each reference prediction sub-model, carrying out fusion processing on the predicted passing time of the sample route output by each reference prediction sub-model to obtain fused predicted passing time;
and determining time residual information required to be fitted by the sample route based on the expected transit time of the sample route and the fused predicted transit time.
206. And the server constructs a target predictor model according to the time residual information required to be fitted by each sample route.
Optionally, in this embodiment, the step of "constructing the target predictor model according to the time residual information to be fitted to each sample route" may include:
determining gradient information corresponding to the sample route according to the time residual information required to be fitted by the sample route;
determining target gain information of each passing feature on passing time based on the gradient information and the feature value of the sample route on each passing feature;
selecting a target passing feature from the passing features according to the target gain information of the passing features on the passing time;
and generating a time prediction strategy according to the target traffic characteristics, and constructing a target prediction sub-model based on the time prediction strategy.
207. And the server adds the target prediction sub-model into the time prediction model after the deletion processing to obtain a target time prediction model.
Optionally, in this embodiment, the step of adding the target predictor model to the post-deletion time prediction model to obtain a target time prediction model may include:
determining weight information of the target predictor model according to the number of reference predictors and the number of predictors in the time predictor model;
and adding the target prediction sub-model into the deleted time prediction model based on the weight information to obtain a target time prediction model.
208. The server takes the target time prediction model as a new time prediction model.
209. And the server returns to execute the step of selecting the to-be-deleted prediction sub-model from the time prediction models, deleting the to-be-deleted prediction sub-model from the time prediction models to obtain a deleted time prediction model until a target time prediction model meeting preset conditions is obtained, wherein the target time prediction model is used for carrying out transit time prediction processing on a target route to obtain a transit time prediction result.
Specifically, in each iteration, the application uses the increment sample to generate a new target predictor model, and the structure and parameters of other existing predictor models are not adjusted, so that the model can be prevented from excessively learning the new sample, so that the old sample is forgotten.
The preset condition can be set according to actual conditions. For example, the preset condition may be that the number of iterations reaches a preset number T.
Wherein, T can be determined according to the size of the sample size in the incremental traffic data, and if the sample size is more, some original trees can be replaced more, and T can be set larger; if the sample size is small, some original trees can be replaced less, and T can be set smaller.
Optionally, in this embodiment, the predictor model is a tree model including at least one leaf node; after the step of adding the target predictor model to the time prediction model to obtain a target time prediction model, the training method of the time prediction model may further include:
aiming at each predictor model in the target time prediction model, determining a target leaf node of the target route falling into the predictor model according to a time prediction strategy corresponding to the predictor model and each passing characteristic of the target route;
Determining the predicted transit time of the target route output by the predictor model according to the node value of the target leaf node;
and based on the weight information of each prediction sub-model, carrying out aggregation processing on the predicted passing time output by each prediction sub-model to obtain the target passing time required by the target route.
The aggregation processing mode of the predicted passing time output by each prediction sub-model can be weighted summation or the like.
Each predictor model is equivalent to a decision tree, and each predictor model corresponds to a time prediction strategy of at least one target traffic feature under a target feature value segmentation point. The decision tree represents the business rule by one or more tree results, and mainly comprises a root node, a judging node, a leaf node, judging conditions and the like.
In this embodiment, the time prediction processing is performed on the target route by using the predictor model based on the feature values corresponding to the traffic features of the target route, which may specifically be that at least one time prediction policy corresponding to the predictor model is utilized, the target leaf node where the target route falls in the predictor model is determined based on the feature values of the traffic features of the target route, and then the predicted traffic time of the target route output by the predictor model is determined according to the node value of the target leaf node.
The training device of the time prediction model provided by the application can be applied to various scenes. For example, in a navigation scene, when navigation is initiated, a background firstly provides a plurality of candidate routes, then the application can be used for calculating the estimated arrival time of each candidate route, and then a fastest route is selected from the candidate routes and provided for a user; after entering the navigation state, the application calculates the time of the remaining journey at regular intervals, thereby facilitating the user to arrange the journey. For example, the application can be used for calculating an isochronal reachable circle, such as a half hour reachable circle, a one hour reachable circle and the like, so that a user can know the living radius of a certain place conveniently. For example, when the delivery is carried out, the time consumption of each route can be accurately calculated by using the method, so that the delivery personnel can be better dispatched, and the delivery efficiency is improved. For example, in the mobile phone taxi taking scene, the time consumption of each route can be accurately calculated by using the method, so that a master order of a driver is better arranged, and the passenger transport efficiency is improved. In addition, ETA of each route can be provided for upstream service use so as to evaluate the advantages and disadvantages of each route and push the optimal route to the user; alternatively, the current target route may be determined according to the predicted passing time of the current target route, compared with the passing time of the same target route, to determine whether the current target route has a regular change of travel, and the upstream service is used, for example, to remind the user, adjust the route ranking, and the like.
In the prior art, most of the transit time prediction methods solve the ETA prediction problem under the conventional condition, and various defects are often caused when the seasonal and regular travel rule change scenes are dealt with: on the one hand, the whole model is trained by using annual data every time, and if the characteristics are complete, the model capacity is enough and the training method is excellent, the problem of seasonal and regular travel rule change can be really solved. However, this has the disadvantage that model training is costly, resulting in a relatively low update frequency, and in the worst case, may be an update of half a year or even once a year. On the other hand, in order to reduce the cost of retraining, training samples are sometimes reduced, and only data of about one month or about several weeks are used; this may increase the frequency of model updates, such as weekly or daily updates. However, the disadvantage is that the model cannot learn the travel law in the same period of the past year, so that the change of the travel law in a future period of time is not predicted enough.
The incremental learning provided by the present application can solve the above problems. It can update the model with only data for a short period of time while ensuring that the model does not forget previously learned knowledge. Specifically, the application introduces Dropout skills into the gradient lifting decision tree to realize the increment learning of a lifting tree algorithm, thereby realizing the day-level or week-level adaptation of time estimation to the travel rule.
As can be seen from the foregoing, in this embodiment, a time prediction model trained by using historical traffic data and incremental traffic data may be obtained through a server, where the time prediction model includes a plurality of predictor models, and the incremental traffic data includes at least one sample route, at least one traffic feature corresponding to the sample route, and an expected traffic time; selecting a to-be-deleted prediction sub-model from the time prediction models, and deleting the to-be-deleted prediction sub-model from the time prediction models to obtain deleted time prediction models; selecting a predictor model in the deleted time prediction model, and determining at least one selected reference predictor model; performing time prediction processing on the sample route based on each passing characteristic of the sample route through the reference predictor model to obtain the predicted passing time of the sample route output by the reference predictor model; determining, for each sample route, time residual information to be fitted to the sample route based on the expected transit time of the sample route and the predicted transit time of the sample route output by the respective reference predictor model; constructing a target predictor model according to the time residual information required to be fitted by each sample route; adding the target predictor model into the deleted time prediction model to obtain a target time prediction model; taking the target time prediction model as a new time prediction model; and returning to execute the step of selecting the to-be-deleted prediction sub-model from the time prediction models, deleting the to-be-deleted prediction sub-model from the time prediction models to obtain a deleted time prediction model until a target time prediction model meeting preset conditions is obtained, wherein the target time prediction model is used for carrying out transit time prediction processing on a target route to obtain a transit time prediction result.
According to the method, the predictor model can be selected from the time prediction model for deletion, and then the target predictor model trained by using new incremental data is added, so that the number of the predictor models in the time prediction model can be maintained within a certain range, unlimited growth of the predictor models in the time prediction model along with incremental training can be avoided, and unsustainable incremental training of the model is avoided. The application can also select part of the predictive sub-models from the time predictive models after the deletion processing, and determine the time residual information which needs to be fitted for the incremental sample based on the selected predictive sub-models, thereby generating the target predictive sub-model based on the time residual information so as to capture the change of the data rule in the new incremental sample through the new target predictive sub-model; in addition, the time residual information fitted by the newly added target predictive sub-model corresponds to the unselected predictive sub-model, so that the importance of the target predictive sub-model can be improved. Because if some predictor models are not selected, all predictor models in the processed temporal predictor model are directly deleted to determine the temporal residual information, the temporal residual information required to be fitted may be smaller, which may result in lower importance of the learned target predictor model. Moreover, the time prediction model can be updated in an increment mode, the whole time prediction model does not need to be updated every time, a new prediction sub model is only generated based on an increment sample, other prediction sub models in the time prediction model after deletion processing are not required to be changed, the prediction effect of the model on old data is not obviously reduced, and the accuracy of time prediction can be improved under the condition that the updated time prediction model is suitable for data law change in historical data; and the model updating cost is low, so that the model can continuously learn, the response speed of the model to the change of the traffic rule is improved, and the timely adaptation of the traffic time estimation to the change of the travel rule is realized.
In order to better implement the above method, the embodiment of the present application further provides a training device for a time prediction model, as shown in fig. 3, where the training device for a time prediction model may include an obtaining unit 301, a selecting unit 302, a predicting unit 303, a determining unit 304, a constructing unit 305, and an adding unit 306, as follows:
(1) An acquisition unit 301;
the time prediction model comprises a plurality of predictor models, the incremental traffic data comprises at least one sample route, at least one traffic feature corresponding to the sample route and expected traffic time, and the incremental traffic data is traffic data for incremental learning.
Optionally, in some embodiments of the present application, the historical traffic data includes at least one historical sample route, at least one traffic feature corresponding to the historical sample route, and a desired traffic time;
the training device of the time prediction model may further include a time prediction model training unit, as follows:
the time prediction model training unit is used for acquiring an initial time prediction model, and the initial time prediction model comprises at least three predictor models; selecting a predictor model in the initial time prediction model to obtain at least one selected initial reference predictor model; performing time prediction processing on the historical sample route based on each passing characteristic of the historical sample route through the initial reference predictor model to obtain the predicted passing time of the historical sample route output by the initial reference predictor model; determining, for each historical sample route, time residual information to be fitted to the historical sample route based on expected transit times of the historical sample route and predicted transit times of the historical sample route output by the respective initial reference predictor model; constructing an initial target predictor model according to the time residual information required to be fitted by each historical sample route; and adding the initial target predictor model into the initial time prediction model to obtain a time prediction model.
Optionally, in some embodiments of the present application, the historical traffic data includes at least one historical sample route, at least one traffic feature corresponding to the historical sample route, and a desired traffic time;
the training device of the time prediction model may further include a time prediction model generation unit that may be used to generate a time prediction model; the temporal prediction model generation unit may include a residual determination subunit, a model construction subunit, and a return execution subunit and a model acquisition subunit, as follows:
the residual determination subunit is used for determining time residual information which is needed to be fitted currently by the historical sample route based on expected passing time of the historical sample route;
the model construction subunit is used for constructing a prediction sub-model according to the time residual information which needs to be fitted currently by the historical sample route and the passing characteristics of the historical sample route;
the return execution subunit is used for returning to execute the step of determining the time residual information which is needed to be fitted currently for the historical sample route according to the constructed prediction sub-model and the expected passing time based on the historical sample route so as to construct and obtain a new prediction sub-model;
And the model acquisition subunit is used for acquiring the time prediction model based on each constructed prediction sub-model.
Optionally, in some embodiments of the present application, the residual determining subunit may be specifically configured to obtain a preset fitting value when there is no constructed prediction sub-model, and determine the preset fitting value as time residual information that needs to be fitted currently by the historical sample route; when the constructed prediction sub-model exists, performing time prediction processing on the historical sample route based on each passing characteristic of the historical sample route through the constructed prediction sub-model to obtain the predicted passing time of the historical sample route output by the constructed prediction sub-model; for each historical sample route, determining time residual information which is needed to be fitted currently by the historical sample route based on expected passing time of the historical sample route and predicted passing time of the historical sample route output by each constructed predictor model.
Optionally, in some embodiments of the present application, the model building subunit may be specifically configured to determine gradient information corresponding to the historical sample route according to time residual information currently required to be fitted to the historical sample route; determining target gain information of each passing feature on passing time based on the gradient information and the feature value of the history sample route on each passing feature; selecting a target passing feature from the passing features according to the target gain information of the passing features on the passing time; and generating a time prediction strategy according to the target traffic characteristics, and constructing a predictor model based on the time prediction strategy.
(2) A selecting unit 302;
and the selecting unit is used for selecting the predictor model in the time prediction model to obtain at least one selected reference predictor model.
(3) A prediction unit 303;
and the prediction unit is used for inputting each traffic characteristic of the sample route in the incremental traffic data into the reference prediction sub-model to perform time prediction processing of the sample route, so as to obtain the predicted traffic time of the sample route output by the reference prediction sub-model.
(4) A determination unit 304;
and the determining unit is used for determining time residual information which is required to be fitted by the sample route according to the expected passing time of the sample route and the predicted passing time of the sample route output by each reference predictor model for each sample route.
(5) A construction unit 305;
and the construction unit is used for constructing a target predictor model according to the time residual information required to be fitted by each sample route.
Alternatively, in some embodiments of the present application, the construction unit may include a gradient determination subunit, a gain determination subunit, a feature selection subunit, and a construction subunit, as follows:
The gradient determining subunit is used for determining gradient information corresponding to the sample route according to the time residual information required to be fitted by the sample route;
a gain determination subunit, configured to determine target gain information of each traffic feature for a traffic time based on the gradient information and a feature value of the sample route on each traffic feature;
the characteristic selecting subunit is used for selecting target passing characteristics from the passing characteristics according to the target gain information of the passing characteristics on the passing time;
and the construction subunit is used for generating a time prediction strategy according to the target traffic characteristics and constructing a target prediction sub-model based on the time prediction strategy.
Optionally, in some embodiments of the present application, the gain determining subunit may be specifically configured to divide, for each traffic feature, a preset feature value interval corresponding to the traffic feature based on a preset feature value dividing point of the traffic feature, to obtain at least two sub-feature value intervals corresponding to the traffic feature; determining a sample route of the increment traffic data, in which the characteristic value of the traffic characteristic falls in the sub-characteristic value interval, aiming at each sub-characteristic value interval, so as to obtain a target sample route corresponding to the sub-characteristic value interval; determining the information entropy corresponding to the sub-characteristic value interval according to the gradient information of the target sample route corresponding to the sub-characteristic value interval; calculating gain information of the passing feature on passing time under the preset feature value dividing points according to the information entropy corresponding to each sub-feature value interval; and determining target gain information of the passing characteristics on the passing time according to the gain information of the passing characteristics on the passing time at preset characteristic value dividing points.
Optionally, in some embodiments of the present application, the building subunit may specifically be configured to perform decision tree generation based on the temporal prediction policy to obtain a decision tree model structure, where the decision tree model structure includes at least one leaf node; determining leaf nodes in which the sample route falls based on the traffic characteristics of the sample route and the time prediction strategy; determining, for each leaf node, a node value for the leaf node based on gradient information of a sample route falling on the leaf node; and determining a target predictor model according to the decision tree model structure and the node value of each leaf node, wherein the target predictor model is a tree model.
(6) An adding unit 306;
the adding unit is used for adding the target prediction sub-model into the time prediction model to obtain a target time prediction model, and the target time prediction model is used for carrying out transit time prediction processing on a target route to obtain a transit time prediction result.
Optionally, in some embodiments of the present application, the selecting unit may include a deleting subunit and a selecting subunit as follows:
the deleting subunit is configured to select a to-be-deleted prediction sub-model from the time prediction models, delete the to-be-deleted prediction sub-model from the time prediction models, and obtain a time prediction model after deletion processing;
A selecting subunit, configured to select a predictor model in the deleted time prediction model, and determine at least one selected reference predictor model;
the adding unit may specifically be configured to add the target predictor model to the post-deletion time prediction model, to obtain a target time prediction model.
Optionally, in some embodiments of the present application, the adding unit may include an adding subunit, a determining subunit, and a returning subunit, as follows:
the adding subunit is configured to add the target prediction sub-model to the post-deletion time prediction model to obtain a target time prediction model;
a determining subunit, configured to take the target time prediction model as a new time prediction model;
and the returning subunit is used for returning to execute the step of selecting the to-be-deleted prediction sub-model from the time prediction models, deleting the to-be-deleted prediction sub-model from the time prediction models, and obtaining the time prediction models after deletion until obtaining the target time prediction model meeting the preset conditions.
Alternatively, in some embodiments of the present application, the adding unit may include a weight determining subunit and a model adding subunit, as follows:
The weight determining subunit is configured to determine weight information of the target prediction sub-model according to the number of reference prediction sub-models and the number of prediction sub-models in the time prediction model;
and the model adding subunit is used for adding the target prediction sub model into the time prediction model based on the weight information to obtain a target time prediction model.
Optionally, in some embodiments of the present application, the predictor model is a tree model including at least one leaf node; the training device of the time prediction model may further include a node determining unit, a time determining unit, and an aggregation unit, as follows:
the node determining unit is used for determining target leaf nodes of the target route falling into each predictor model in the target time prediction model according to the time prediction strategy corresponding to the predictor model and each passing characteristic of the target route;
the time determining unit is used for determining the predicted passing time of the target route output by the predictor model according to the node value of the target leaf node;
and the aggregation unit is used for aggregating the predicted passing time output by each predictor model based on the weight information of each predictor model to obtain the target passing time required by the target route.
As can be seen from the above, in this embodiment, the obtaining unit 301 may obtain, from the time prediction model trained with the historical traffic data, the time prediction model including a plurality of predictor models, and the incremental traffic data including at least one sample route, at least one traffic feature corresponding to the sample route, and an expected traffic time, where the incremental traffic data is traffic data for incremental learning; selecting a predictor model in the time prediction model through a selecting unit 302 to obtain at least one selected reference predictor model; the prediction unit 303 inputs each traffic characteristic of the sample route in the incremental traffic data into the reference prediction sub-model to perform time prediction processing of the sample route, so as to obtain the predicted traffic time of the sample route output by the reference prediction sub-model; determining, by the determining unit 304, for each sample route, time residual information to be fitted to the sample route based on the expected transit time of the sample route and the predicted transit time of the sample route output by the respective reference predictor model; constructing a target predictor model by a construction unit 305 according to the time residual information required to be fitted by each sample route; the target prediction sub-model is added to the time prediction model through the adding unit 306 to obtain a target time prediction model, and the target time prediction model is used for performing transit time prediction processing on a target route to obtain a transit time prediction result.
The application can select part of the predictor models in the time predictor model, and determine the time residual information which needs to be fitted for the increment sample based on the selected predictor models, thereby generating the target predictor model based on the time residual information, and capturing the change of the data rule in the new increment sample through the newly added target predictor model; in addition, the time residual information fitted by the newly added target predictive sub-model corresponds to the unselected predictive sub-model, so that the importance of the target predictive sub-model can be improved. Because if some predictor models are not selected, all predictor models are directly used for determining the time residual information, the time residual information required to be fitted may be smaller, which may result in lower importance of the target predictor model after learning. Moreover, the time prediction model can be updated in an increment mode, the whole time prediction model does not need to be updated every time, a new prediction sub model is only generated based on an increment sample, other prediction sub models are not needed to be changed, the prediction effect of the model on old data is not obviously reduced, and the accuracy of time prediction can be improved under the condition that the updated time prediction model is applicable to the change of data rules in historical data; and the model updating cost is low, so that the model can continuously learn, the response speed of the model to the change of the traffic rule is improved, and the timely adaptation of the traffic time estimation to the change of the travel rule is realized.
The embodiment of the application also provides an electronic device, as shown in fig. 4, which shows a schematic structural diagram of the electronic device according to the embodiment of the application, where the electronic device may be a terminal or a server, specifically:
the electronic device may include one or more processing cores 'processors 401, one or more computer-readable storage media's memory 402, power supply 403, and input unit 404, among other components. Those skilled in the art will appreciate that the electronic device structure shown in fig. 4 is not limiting of the electronic device and may include more or fewer components than shown, or may combine certain components, or may be arranged in different components. Wherein:
the processor 401 is a control center of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device and processes data by running or executing software programs and/or modules stored in the memory 402, and calling data stored in the memory 402. Optionally, processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, an application program, etc., and the modem processor mainly processes wireless communication. It will be appreciated that the modem processor described above may not be integrated into the processor 401.
The memory 402 may be used to store software programs and modules, and the processor 401 executes various functional applications and data processing by executing the software programs and modules stored in the memory 402. The memory 402 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data created according to the use of the electronic device, etc. In addition, memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
The electronic device further comprises a power supply 403 for supplying power to the various components, preferably the power supply 403 may be logically connected to the processor 401 by a power management system, so that functions of managing charging, discharging, and power consumption are performed by the power management system. The power supply 403 may also include one or more of any of a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
The electronic device may further comprise an input unit 404, which input unit 404 may be used for receiving input digital or character information and generating keyboard, mouse, joystick, optical or trackball signal inputs in connection with user settings and function control.
Although not shown, the electronic device may further include a display unit or the like, which is not described herein. In particular, in this embodiment, the processor 401 in the electronic device loads executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 executes the application programs stored in the memory 402, so as to implement various functions as follows:
acquiring a time prediction model trained by using historical traffic data and incremental traffic data, wherein the time prediction model comprises a plurality of predictor models, the incremental traffic data comprises at least one sample route, at least one traffic feature corresponding to the sample route and expected traffic time, and the incremental traffic data is traffic data for incremental learning; selecting a predictor model in the time prediction model to obtain at least one selected reference predictor model; inputting each traffic characteristic of a sample route in the incremental traffic data into the reference predictor model to perform time prediction processing of the sample route, so as to obtain predicted traffic time of the sample route output by the reference predictor model; determining, for each sample route, time residual information to be fitted to the sample route based on the expected transit time of the sample route and the predicted transit time of the sample route output by the respective reference predictor model; constructing a target predictor model according to the time residual information required to be fitted by each sample route; and adding the target prediction sub-model into the time prediction model to obtain a target time prediction model, wherein the target time prediction model is used for carrying out transit time prediction processing on a target route to obtain a transit time prediction result.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
As can be seen from the foregoing, the present embodiment may acquire a time prediction model trained with historical traffic data and incremental traffic data, where the time prediction model includes a plurality of predictor models, the incremental traffic data includes at least one sample route, at least one traffic feature corresponding to the sample route, and an expected traffic time, and the incremental traffic data is traffic data for incremental learning; selecting a predictor model in the time prediction model to obtain at least one selected reference predictor model; inputting each traffic characteristic of a sample route in the incremental traffic data into the reference predictor model to perform time prediction processing of the sample route, so as to obtain predicted traffic time of the sample route output by the reference predictor model; determining, for each sample route, time residual information to be fitted to the sample route based on the expected transit time of the sample route and the predicted transit time of the sample route output by the respective reference predictor model; constructing a target predictor model according to the time residual information required to be fitted by each sample route; and adding the target prediction sub-model into the time prediction model to obtain a target time prediction model, wherein the target time prediction model is used for carrying out transit time prediction processing on a target route to obtain a transit time prediction result. According to the method, under the condition that the updated time prediction model is applicable to the change of the historical data law, the change of the data law in the incremental sample is captured through the newly added target prediction sub model, and the accuracy of time prediction is improved; and the model updating cost is low, so that the timely adaptation of time estimation to travel rule change can be realized.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor.
To this end, embodiments of the present application provide a computer readable storage medium having stored therein a plurality of instructions capable of being loaded by a processor to perform the steps of any one of the methods for training a temporal prediction model provided by embodiments of the present application. For example, the instructions may perform the steps of:
acquiring a time prediction model trained by using historical traffic data and incremental traffic data, wherein the time prediction model comprises a plurality of predictor models, the incremental traffic data comprises at least one sample route, at least one traffic feature corresponding to the sample route and expected traffic time, and the incremental traffic data is traffic data for incremental learning; selecting a predictor model in the time prediction model to obtain at least one selected reference predictor model; inputting each traffic characteristic of a sample route in the incremental traffic data into the reference predictor model to perform time prediction processing of the sample route, so as to obtain predicted traffic time of the sample route output by the reference predictor model; determining, for each sample route, time residual information to be fitted to the sample route based on the expected transit time of the sample route and the predicted transit time of the sample route output by the respective reference predictor model; constructing a target predictor model according to the time residual information required to be fitted by each sample route; and adding the target prediction sub-model into the time prediction model to obtain a target time prediction model, wherein the target time prediction model is used for carrying out transit time prediction processing on a target route to obtain a transit time prediction result.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
Wherein the computer-readable storage medium may comprise: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
Because the instructions stored in the computer readable storage medium may execute the steps in any one of the training methods for a time prediction model provided by the embodiments of the present application, the beneficial effects that can be achieved by any one of the training methods for a time prediction model provided by the embodiments of the present application may be achieved, which are detailed in the previous embodiments and are not described herein.
According to one aspect of the present application, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The computer instructions are read from the computer-readable storage medium by a processor of a computer device, and executed by the processor, cause the computer device to perform the methods provided in various alternative implementations of the training aspects of the temporal prediction model described above.
The foregoing describes in detail a training method of a time prediction model and related devices provided by the embodiments of the present application, and specific examples are applied to illustrate the principles and embodiments of the present application, where the foregoing examples are only used to help understand the method and core ideas of the present application; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present application, the present description should not be construed as limiting the present application.

Claims (15)

1. A method of training a temporal prediction model, comprising:
acquiring a time prediction model trained by using historical traffic data and incremental traffic data, wherein the time prediction model comprises a plurality of predictor models, the incremental traffic data comprises at least one sample route, at least one traffic feature corresponding to the sample route and expected traffic time, and the incremental traffic data is traffic data for incremental learning;
selecting a to-be-deleted prediction sub-model from the time prediction models, and deleting the to-be-deleted prediction sub-model from the time prediction models to obtain deleted time prediction models;
Selecting the predictor model based on preset probability aiming at each predictor model in the deleted time predictor model, and determining at least one selected reference predictor model;
inputting each traffic characteristic of a sample route in the incremental traffic data into the reference predictor model to perform time prediction processing of the sample route, so as to obtain predicted traffic time of the sample route output by the reference predictor model;
determining, for each sample route, time residual information to be fitted to the sample route based on the expected transit time of the sample route and the predicted transit time of the sample route output by the respective reference predictor model;
constructing a target predictor model according to the time residual information required to be fitted by each sample route;
and adding the target prediction sub-model into the deleted time prediction model to obtain a target time prediction model, wherein the target time prediction model is used for carrying out passing time prediction processing on a target route to obtain a passing time prediction result.
2. The method of claim 1, wherein adding the target predictor model to the post-deletion temporal prediction model results in a target temporal prediction model, comprising:
Adding the target predictor model into the deleted time prediction model to obtain a target time prediction model;
taking the target time prediction model as a new time prediction model;
and returning to the step of executing the to-be-deleted prediction sub-model selected from the time prediction models, deleting the to-be-deleted prediction sub-model from the time prediction models to obtain the time prediction models after deletion processing until the target time prediction models meeting preset conditions are obtained.
3. The method of claim 1, wherein adding the target predictor model to the post-deletion temporal prediction model results in a target temporal prediction model, comprising:
determining weight information of the target predictor model according to the number of the reference predictor models and the number of the predictor models in the time predictor model after the deletion processing;
and adding the target prediction sub-model into the deleted time prediction model based on the weight information to obtain a target time prediction model.
4. The method of claim 1, wherein constructing the target predictor model from the time residual information to be fitted to each sample route comprises:
Determining gradient information corresponding to the sample route according to the time residual information required to be fitted by the sample route;
determining target gain information of each passing feature on passing time based on the gradient information and the feature value of the sample route on each passing feature;
selecting a target passing feature from the passing features according to the target gain information of the passing features on the passing time;
and generating a time prediction strategy according to the target traffic characteristics, and constructing a target prediction sub-model based on the time prediction strategy.
5. The method of claim 4, wherein the determining target gain information for each traffic feature versus traffic time based on the gradient information and the characteristic value of the sample route on each traffic feature comprises:
dividing a preset characteristic value interval corresponding to the passing feature based on a preset characteristic value dividing point of the passing feature aiming at each passing feature to obtain at least two sub-characteristic value intervals corresponding to the passing feature;
determining a sample route of the increment traffic data, in which the characteristic value of the traffic characteristic falls in the sub-characteristic value interval, aiming at each sub-characteristic value interval, so as to obtain a target sample route corresponding to the sub-characteristic value interval;
Determining the information entropy corresponding to the sub-characteristic value interval according to the gradient information of the target sample route corresponding to the sub-characteristic value interval;
calculating gain information of the passing feature on passing time under the preset feature value dividing points according to the information entropy corresponding to each sub-feature value interval; and determining target gain information of the passing characteristics on the passing time according to the gain information of the passing characteristics on the passing time at preset characteristic value dividing points.
6. The method of claim 4, wherein constructing a target predictor model based on the temporal prediction strategy comprises:
generating a decision tree based on the time prediction strategy to obtain a decision tree model structure, wherein the decision tree model structure comprises at least one leaf node;
determining leaf nodes in which the sample route falls based on the traffic characteristics of the sample route and the time prediction strategy;
determining, for each leaf node, a node value for the leaf node based on gradient information of a sample route falling on the leaf node;
and determining a target predictor model according to the decision tree model structure and the node value of each leaf node, wherein the target predictor model is a tree model.
7. The method of claim 6, wherein the predictor model is a tree model comprising at least one leaf node; the adding the target predictor model to the time prediction model after the deleting process to obtain a target time prediction model further comprises:
aiming at each predictor model in the target time prediction model, determining a target leaf node of the target route falling into the predictor model according to a time prediction strategy corresponding to the predictor model and each passing characteristic of the target route;
determining the predicted transit time of the target route output by the predictor model according to the node value of the target leaf node;
and based on the weight information of each prediction sub-model, carrying out aggregation processing on the predicted passing time output by each prediction sub-model to obtain the target passing time required by the target route.
8. The method of claim 1, wherein the historical traffic data includes at least one historical sample route, at least one traffic feature corresponding to the historical sample route, and a desired traffic time;
Before the time prediction model trained by the historical traffic data and the incremental traffic data are acquired, the method further comprises the following steps:
acquiring an initial time prediction model, wherein the initial time prediction model comprises at least three predictor models;
selecting a predictor model in the initial time prediction model to obtain at least one selected initial reference predictor model;
performing time prediction processing on the historical sample route based on each passing characteristic of the historical sample route through the initial reference predictor model to obtain the predicted passing time of the historical sample route output by the initial reference predictor model;
determining, for each historical sample route, time residual information to be fitted to the historical sample route based on expected transit times of the historical sample route and predicted transit times of the historical sample route output by the respective initial reference predictor model;
constructing an initial target predictor model according to the time residual information required to be fitted by each historical sample route;
and adding the initial target predictor model into the initial time prediction model to obtain a time prediction model.
9. The method of claim 1, wherein the historical traffic data includes at least one historical sample route, at least one traffic feature corresponding to the historical sample route, and a desired traffic time;
before the time prediction model trained by the historical traffic data and the incremental traffic data are acquired, the method further comprises the following steps:
determining time residual information to be fitted currently by the historical sample route based on expected passing time of the historical sample route;
constructing a predictor model according to the time residual information to be fitted currently of the historical sample route and each passing characteristic of the historical sample route;
returning to execute the step of determining the time residual information which needs to be fitted currently for the historical sample route according to the constructed prediction sub-model so as to construct and obtain a new prediction sub-model;
and obtaining a time prediction model based on each constructed predictor model.
10. The method of claim 9, wherein the determining time residual information that the historical sample route currently needs to fit based on the expected transit time of the historical sample route comprises:
When the constructed predictor model does not exist, acquiring a preset fitting value, and determining the preset fitting value as time residual information which needs to be fitted currently for the historical sample route;
when the constructed prediction sub-model exists, performing time prediction processing on the historical sample route based on each passing characteristic of the historical sample route through the constructed prediction sub-model to obtain the predicted passing time of the historical sample route output by the constructed prediction sub-model;
for each historical sample route, determining time residual information which is needed to be fitted currently by the historical sample route based on expected passing time of the historical sample route and predicted passing time of the historical sample route output by each constructed predictor model.
11. The method of claim 9, wherein constructing a predictor model from the time residual information that the historical sample route is currently required to fit and the traffic characteristics of the historical sample route comprises:
determining gradient information corresponding to the historical sample route according to the time residual information of the current fitting required by the historical sample route;
Determining target gain information of each passing feature on passing time based on the gradient information and the feature value of the history sample route on each passing feature;
selecting a target passing feature from the passing features according to the target gain information of the passing features on the passing time;
and generating a time prediction strategy according to the target traffic characteristics, and constructing a predictor model based on the time prediction strategy.
12. A training device for a temporal prediction model, comprising:
the acquisition unit is used for acquiring a time prediction model trained by using historical traffic data and incremental traffic data, wherein the time prediction model comprises a plurality of predictor models, the incremental traffic data comprises at least one sample route, at least one traffic feature corresponding to the sample route and expected traffic time, and the incremental traffic data is traffic data for incremental learning;
the selecting unit is used for selecting a to-be-deleted prediction sub-model from the time prediction models, deleting the to-be-deleted prediction sub-model from the time prediction models, and obtaining deleted time prediction models; selecting the predictor model based on preset probability aiming at each predictor model in the deleted time predictor model, and determining at least one selected reference predictor model;
The prediction unit is used for inputting each traffic characteristic of the sample route in the incremental traffic data into the reference prediction sub-model to perform time prediction processing of the sample route, so as to obtain the predicted traffic time of the sample route output by the reference prediction sub-model;
a determining unit, configured to determine, for each sample route, time residual information to be fitted to the sample route based on expected transit time of the sample route and predicted transit time of the sample route output by each reference predictor model;
the construction unit is used for constructing a target predictor model according to the time residual information required to be fitted by each sample route;
the adding unit is used for adding the target prediction sub-model into the deleted time prediction model to obtain a target time prediction model, and the target time prediction model is used for carrying out passing time prediction processing on a target route to obtain a passing time prediction result.
13. An electronic device comprising a memory and a processor; the memory stores an application program, and the processor is configured to execute the application program in the memory to perform the operations in the training method of the time prediction model according to any one of claims 1 to 11.
14. A computer readable storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the steps in the method of training a temporal prediction model according to any one of claims 1 to 11.
15. A computer system comprising a computer program or instructions which, when executed by a processor, performs the steps in the method of training a temporal prediction model according to any one of claims 1 to 11.
CN202310936520.2A 2023-07-28 2023-07-28 Training method of time prediction model and related equipment Active CN116662815B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310936520.2A CN116662815B (en) 2023-07-28 2023-07-28 Training method of time prediction model and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310936520.2A CN116662815B (en) 2023-07-28 2023-07-28 Training method of time prediction model and related equipment

Publications (2)

Publication Number Publication Date
CN116662815A CN116662815A (en) 2023-08-29
CN116662815B true CN116662815B (en) 2023-11-10

Family

ID=87724574

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310936520.2A Active CN116662815B (en) 2023-07-28 2023-07-28 Training method of time prediction model and related equipment

Country Status (1)

Country Link
CN (1) CN116662815B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117827112B (en) * 2024-01-04 2024-07-05 上海源斌电子科技有限公司 Electronic element storage data analysis system and method based on artificial intelligence

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106156809A (en) * 2015-04-24 2016-11-23 阿里巴巴集团控股有限公司 For updating the method and device of disaggregated model
CN107330464A (en) * 2017-06-30 2017-11-07 众安信息技术服务有限公司 Data processing method and device
CN113821535A (en) * 2021-07-15 2021-12-21 腾讯科技(深圳)有限公司 Model training method and device, computer equipment and storage medium
CN114881315A (en) * 2022-04-24 2022-08-09 腾讯科技(深圳)有限公司 Travel arrival time determining method and device, electronic equipment and storage medium
CN114973677A (en) * 2016-04-18 2022-08-30 北京嘀嘀无限科技发展有限公司 Method and apparatus for determining estimated time of arrival

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11250296B2 (en) * 2019-07-24 2022-02-15 Nvidia Corporation Automatic generation of ground truth data for training or retraining machine learning models

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106156809A (en) * 2015-04-24 2016-11-23 阿里巴巴集团控股有限公司 For updating the method and device of disaggregated model
CN114973677A (en) * 2016-04-18 2022-08-30 北京嘀嘀无限科技发展有限公司 Method and apparatus for determining estimated time of arrival
CN107330464A (en) * 2017-06-30 2017-11-07 众安信息技术服务有限公司 Data processing method and device
CN113821535A (en) * 2021-07-15 2021-12-21 腾讯科技(深圳)有限公司 Model training method and device, computer equipment and storage medium
CN114881315A (en) * 2022-04-24 2022-08-09 腾讯科技(深圳)有限公司 Travel arrival time determining method and device, electronic equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"Flight Delay Prediction Using Gradient Boosting Machine Learning Classifiers";Mingdao lu et al;《Journal of Quantum Computing》;第3卷(第1期);第1-12页 *
"On Incremental Learning for Gradient Boosting Decision Trees";Chongsheng Zhang et al;《Neural Processing Letters》;第50卷;第957-987页 *

Also Published As

Publication number Publication date
CN116662815A (en) 2023-08-29

Similar Documents

Publication Publication Date Title
Noaeen et al. Reinforcement learning in urban network traffic signal control: A systematic literature review
US20220374712A1 (en) Decision making for motion control
Lin et al. An efficient deep reinforcement learning model for urban traffic control
Yu et al. Prediction of highway tunnel pavement performance based on digital twin and multiple time series stacking
EP3035314A1 (en) A traffic data fusion system and the related method for providing a traffic state for a network of roads
Kong et al. Big data‐driven machine learning‐enabled traffic flow prediction
CN110400015B (en) Time estimation method, device and equipment thereof
CN111033535A (en) System and method for bus order scheduling
CN111582559B (en) Arrival time estimation method and device
Zhou et al. Learning the Car‐following Behavior of Drivers Using Maximum Entropy Deep Inverse Reinforcement Learning
CN106022549A (en) Short term load predication method based on neural network and thinking evolutionary search
CN117808180B (en) Path planning method, application and device based on knowledge and data combination
Wang et al. Car-following models for human-driven vehicles and autonomous vehicles: A systematic review
CN116662815B (en) Training method of time prediction model and related equipment
CN115311860B (en) Online federal learning method of traffic flow prediction model
Xu et al. A taxi dispatch system based on prediction of demand and destination
CN112036598A (en) Charging pile use information prediction method based on multi-information coupling
Li et al. Cycle-based signal timing with traffic flow prediction for dynamic environment
CN111507499B (en) Method, device and system for constructing model for prediction and testing method
CN111160594B (en) Method and device for estimating arrival time and storage medium
CN112820111B (en) Abnormal vehicle identification method and device and electronic equipment
Mishra et al. Exploratory data analysis for electric vehicle driving range prediction: insights and evaluation
Dell’Orco et al. Simulation of users decision in transport mode choice using neuro-fuzzy approach
Chen et al. Reconciling spatiotemporal conjunction with digital twin for sequential travel time prediction and intelligent routing
Chen et al. A bidirectional context-aware and multi-scale fusion hybrid network for short-term traffic flow prediction

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant