Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The embodiment of the invention discloses a method and related equipment for predicting the passenger seat rate of a flight, which are used for acquiring current flight data and current passenger ticket booking data, carrying out feature preprocessing to obtain current derivative features suitable for a service scene, carrying out feature vectorization processing on the current derivative features to obtain current feature vectors, and inputting the current feature vectors into a pre-established flight passenger seat rate prediction model to obtain a flight passenger seat rate prediction value. The model is characterized in that a training sample feature vector marked with a flight passenger rate label is used as training data in the flight passenger rate prediction model, parameters are initialized to be XGBoost models, and then the obtained model parameters are sent to a central server by a client, so that the central server adopts a transverse federal learning algorithm to carry out model fusion and parameter updating on the model parameters sent by a plurality of clients to obtain the model parameters, and the transverse federal learning allows a plurality of devices to cooperatively train the model under the condition of not sharing the data.
Referring to fig. 1, a flow chart of a method for predicting a passenger rate of a flight, which is disclosed in an embodiment of the present invention, is applied to a client of an airline, and the client is connected to a central server, where the method for predicting a passenger rate of a flight includes:
step S101, current flight data and current passenger ticket booking data are acquired.
Among them, current flight data includes, but is not limited to, market airline, flight number, departure time, arrival time, departure airport, arrival airport, etc.
Current passenger reservation data includes, but is not limited to, passenger personal information, passenger ticket information, and the like.
And step S102, performing feature preprocessing on the current flight data and the current passenger ticket booking data to obtain current derivative features suitable for a service scene.
The characteristic preprocessing process comprises the following steps: feature screening, missing value and outlier handling and feature derivation.
In practical application, based on the journey data of the passengers, flights (one flight is determined by using a flight number, a departure time, an arrival time, a departure airport and an arrival airport) can be grouped and feature derivation is implemented, so that current derived features are obtained and participate in subsequent model establishment.
Current derivative features include, but are not limited to, flight departure date, market airline on which the flight resides, flight number, departure airport code, and the like.
And step S103, performing feature vectorization processing on the current derivative features to obtain current feature vectors.
The purpose of feature vectorization is to convert data into a numerical vector form so that machine learning algorithms can handle. A feature vector is a vector that has some important properties or characteristics. In data science, feature vectors typically represent one attribute or feature in a dataset.
In this embodiment, the current feature vector may be a vector with a length of 17 and used for storing derivative features, for example, the content of the derivative features is shown in table 1.
TABLE 1
The current feature vector obtained after feature vectorization processing of the derived features is:
[7,2,4,165,1800,1320,1.06,0.3,0.01,0.01,0.58,0,1,15,1,1,1,178]。
and step S104, inputting the current feature vector into a pre-established flight passenger seat rate prediction model to obtain a flight passenger seat rate prediction value.
The model is characterized in that the model for predicting the passenger seat rate of the flight takes a training sample feature vector marked with a label of the passenger seat rate of the flight as training data, and after being trained by adopting a XGBoost model initialized by parameters, the client transmits the obtained model parameters to the central server, so that the central server adopts a transverse federal learning algorithm to carry out model fusion and parameter update on the model parameters transmitted by a plurality of clients.
It should be noted that, when the initialization of the XGBoost model parameters is performed, the initial parameters are shared between the participating computing parties (clients of each airline company), and mainly include the following parameters:
Learning rate (learning_rate): controlling the step length of each iteration round, and determining the updating rate of the weight during each iteration round;
Maximum tree depth (max_depth): the maximum depth of the decision tree controls the complexity and fitting capacity of the model;
base learner (base estimator): a foundation model of a transverse federal learning algorithm is selected, and XGBoost algorithm is selected in the scheme;
Regularization parameters (regularization): controlling the overfitting of the model, and performing overfitting correction by using L2 regularization in the scheme;
sample sampling ratio (subsamples): the sample ratio of the samples at each iteration is controlled:
feature sample ratio (colsample _ bytree): the ratio of features used to train the model at each iteration;
Iteration number (num_boost_round): used to control the training time and accuracy of the model.
Federal learning (FEDERATED LEARNING) is a method of distributed machine learning that allows multiple devices or data centers to co-train models without sharing data. In traditional centralized machine learning, data is stored centrally on one central server, but in federal learning, data is distributed across different devices or data centers, each of which can train a local model and aggregate it with the models of other devices to generate a global model.
In this embodiment, the central server is connected to clients of each airline company, and is configured to implement fusion of multiple local models (i.e., local models) by using a horizontal federal learning algorithm on model parameters uploaded by each client, so as to obtain a total regression model, i.e., a global model. Parameters of each local model are updated and then transmitted back to each client.
In summary, the invention discloses a method for predicting the passenger seat rate of a flight, which comprises the steps of obtaining current flight data and current passenger ticket booking data, performing feature preprocessing to obtain current derivative features suitable for a service scene, performing feature vectorization on the current derivative features to obtain current feature vectors, and inputting the current feature vectors into a pre-established model for predicting the passenger seat rate of the flight to obtain a predicted value of the passenger seat rate of the flight. The model is characterized in that a training sample feature vector marked with a flight passenger rate label is used as training data in the flight passenger rate prediction model, parameters are initialized to be XGBoost models, and then the obtained model parameters are sent to a central server by a client, so that the central server adopts a transverse federal learning algorithm to carry out model fusion and parameter updating on the model parameters sent by a plurality of clients to obtain the model parameters, and the transverse federal learning allows a plurality of devices to cooperatively train the model under the condition of not sharing the data.
To further optimize the above embodiment, step S102 may specifically include:
(1) Screening initial characteristics from current flight data and current passenger booking data;
(2) Processing the missing value and the abnormal value of the initial feature to obtain a target feature;
(3) And performing feature derivation processing on the target feature to obtain the current derived feature.
Among these, initial features include, but are not limited to, the following 24 features:
Passenger personal information: whether it is a large customer or a frequent passenger;
Passenger ticket information: travel date, ticket time, flight fare, flight discount and the place of the cabin;
Passenger trip information: whether it is team travel;
Flight information: market airline, flight number, departure time, arrival time, departure airport, arrival airport, flight duration, whether travel is during spring, holiday, maximum number of passengers accommodated by flight, flight distance, flight delay rate;
Other information: economic prosperity of arrival at an airport, traffic prosperity of arrival at an airport, whether a airline company belongs to the starry sky alliance, and whether a airline company belongs to the heaven alliance.
When the missing value and the abnormal value are processed for the initial feature, the following two modes can be adopted according to the specific condition of each feature:
1) Filling a default value of-1 for the category type feature, wherein the feature value is missing or abnormal;
2) For a numerical feature, a sample similar to it is found in the dataset and then the anomaly or missing value is filled with the corresponding feature value for that sample.
The feature is digitized, and because the non-numerical special symbol exists in the feature, the feature is incomparable, and in the case that the number of the feature categories is not too large, one-hot encoding is adopted, for example, whether the feature is a feature of a weekend is judged, if the feature is a weekend, the value of the feature is set to be 1, and otherwise, the value is set to be 0.
According to the embodiment, on the basis of carrying out missing value and abnormal value processing on the initial characteristics, the derivative characteristics which are more suitable for the service scene are created through carrying out characteristic derivative processing.
In practical applications, based on the journey data of passengers, the following 25 derived features are created by grouping flights (one determined using a flight number, departure time, arrival time, departure airport, arrival airport) and performing feature derivation:
1. Flight departure date;
2. the market department where the flight is located;
3. A flight number;
4. take-off airport codes;
5. An arrival airport code;
6. The time interval of the ticket booking time and the takeoff time (the time interval formed by the specific time point in 2.2 is used, for example, if the time interval of the ticket booking time and the takeoff time interval is 11 days, the ticket booking time and the takeoff time interval fall into the interval and are advanced by 20 days);
7. the time period of the flight take-off time (every two hours is a time period, and 12 time periods in the day are all included);
8. The time period in which the flight arrives (one time period every two hours, 12 time periods in total in one day);
9. the flight duration;
10. Average flight distance of the flight;
11. The average fare for the flight;
12. The ratio of the average fare of the flights to the average fare of the same flights in the same industry;
13. the group multiplication probability of the flight;
14. large customer rate for the flight;
15. The frequent flyer rate of the flight;
16. Average discount rate for the flight;
17. whether the flight is traveling during spring travel;
18. whether the flight is traveling during holidays;
19. The delay rate of the flight (the actual departure time is more than one hour later than the planned departure time, and is regarded as the flight delay);
20. whether the airline company to which the flight belongs inputs a starry sky alliance or a sky alliance;
21. the economic prosperity of the arrival airport of the flight (empirically determined, three levels 1,2, 3, the smaller the number, the higher the prosperity);
22. The arrival airport traffic prosperity of the flight (empirically determined, three classes 1,2, 3, the smaller the number, the higher the prosperity);
23. the number of bookings for the flight (by the time point mentioned in point 7);
24. The maximum number of passengers accommodated by the flight;
25. The flight passenger rate of the flight.
In order to further optimize the above embodiments, referring to fig. 2, a method for constructing a flight passenger rate prediction model according to an embodiment of the present invention includes:
step S201, acquiring a historical original data set of a preset time period.
The value of the preset time period is determined according to actual needs, for example, one month, and the invention is not limited herein.
The historical raw dataset comprises: historical flight data and historical passenger reservation data.
The historical flight data includes flight information and the like.
Historical passenger reservation data includes passenger personal information, passenger travel information, and the like.
Airlines are classified into three scales of large, medium and small according to the number of passengers, the number of flights, the number of aircrafts, etc. of each airline in the last year. Federal learning models can be built together by airlines of the same scale.
In practical application, the embodiment acquires historical flight data and historical passenger ticket booking data from three large airlines as the original data set for model training.
Step S202, preprocessing the original data set to obtain a training sample.
In practice, training samples include, but are not limited to, passenger personal information, passenger ticket information, passenger itinerary information, flight information, and the like.
The process of preprocessing the original data set includes: feature screening, missing value and outlier processing, and feature derivation processing.
Specifically, screening out historical initial characteristics from a historical original data set; processing the missing value and the abnormal value of the historical initial feature to obtain a historical target feature; and performing feature derivation processing on the historical target features to obtain training samples.
Wherein the screened historical initial features include, but are not limited to, the following 24 features:
Passenger personal information: whether it is a large customer or a frequent passenger;
Passenger ticket information: travel date, ticket time, flight fare, flight discount and the place of the cabin;
Passenger trip information: whether it is team travel;
Flight information: market airline, flight number, departure time, arrival time, departure airport, arrival airport, flight duration, whether travel is during spring, holiday, maximum number of passengers accommodated by flight, flight distance, flight delay rate;
Other information: economic prosperity of arrival at an airport, traffic prosperity of arrival at an airport, whether a airline company belongs to the starry sky alliance, and whether a airline company belongs to the heaven alliance.
The derived features obtained by performing feature derivation processing on the historical target features in this embodiment can be referred to the 25 derived features shown in the above embodiment. The present embodiment uses the obtained history derived features as training samples.
Step S203, performing feature vectorization processing on the training samples to obtain training sample feature vectors;
the purpose of feature vectorization is to convert data into a numerical vector form so that machine learning algorithms can handle. A feature vector is a vector that has some important properties or characteristics. In data science, feature vectors typically represent one attribute or feature in a dataset. In this case, the feature vector is a one-dimensional and 17-long vector, and the partially derived features, for example, the feature vectors shown in table 1 above, are stored separately.
In practical applications, the feature vectors of each sample data in the training samples may be 17 feature vectors shown in table 1.
Step S204, determining the corresponding historical flight passenger seat rate based on the training sample.
The present embodiment takes the ratio of the number of bookings for a target flight at a target time to the maximum number of accommodated passengers for an aircraft model as the flight occupancy of that flight at that time (and the status of the historical flight must be the status that has been completed).
Assuming that the flight passenger rate P mn of the flight m at the time n, the calculation formula of the flight passenger rate P mn is as follows:
Where B mn is the number of orders for flight m at time n and C m is the maximum number of passengers that can be accommodated by the extension of flight m.
According to the formula, the flight passenger seat rate of each flight on a specific time node is calculated, and after experience judgment, the application selects the first 1 day, the first 2 days, the first 3 days, the first 4 days, the first 5 days, the first 7 days, the first 10 days, the first 20 days, the first 30 days and the first 45 days which are the distance from the take-off date as specific time points, and reflects different flight passenger seat rate conditions of different stages by calculating the flight passenger seat rate of each specific time point.
And step S205, inputting the training sample feature vector and the historical flight passenger rate into a XGBoost model with initialized parameters for training.
After the training samples are determined, XGBoost model parameters are initialized, the initial parameters are shared among the participating computing parties (local clients of each airline, and mainly include the following parameters:
Learning rate (learning_rate), namely controlling the step length of each iteration round and determining the updating rate of the weight at each iteration round;
Maximum tree depth (max_depth), the maximum depth of the decision tree, the complexity of the control model and the fitting capacity;
a base learner (base estimator) which selects XGBoost algorithm based on the basic model of the horizontal federal learning algorithm;
Regularization parameters (regularization) are used for controlling the overfitting of the model, and the L2 regularization is used for carrying out overfitting correction in the scheme;
Sample sampling ratio (subsamples): control the sample ratio sampled at each iteration:
feature sampling scale (colsample _ bytree), the scale of the features used to train the model at each iteration;
Iteration number (num_boost_round): the iteration times are used for controlling the training time and the accuracy of the model.
Step S206, the model parameters obtained after training are sent to the central server, so that the central server adopts a transverse federal learning algorithm to perform model fusion and segmentation on the model parameters sent by a plurality of clients to obtain optimized model parameters;
it should be noted that, the model parameter sent by the client to the central server is encrypted data.
Wherein, the model fusion (ensable_method) is a method for fusing the results of a plurality of local models.
Federal learning (FEDERATED LEARNING) model is a distributed machine learning approach that allows multiple devices or data centers to co-train a model without sharing data. In traditional centralized machine learning, data is stored centrally on one central server, but in federal learning, data is distributed across different devices or data centers, each of which can train a local model and aggregate it with the models of other devices to generate a global model. In general, the federal learning is used for predicting the passenger rate of the flight, so that the data privacy and safety can be improved, the training speed can be increased, the cost can be reduced, and the model accuracy can be improved.
The invention aims to predict the passenger rate of flights for different airlines, and the data sets of each airline participating in calculation are different but have the same characteristic space, so that the invention adopts a transverse federal learning algorithm, adopts a model of a greedy method, and minimizes the expression of an objective function as follows:
In the method, in the process of the invention, Representation and y i,Related loss function,The predicted value of a lost sample i of the previous t-1 decision tree is represented; y i represents the actual value of sample i, f t(xi) represents the predicted value of sample i for the t-th decision tree; omega (f t) represents the model complexity of the t-th decision tree, usuallyT is the number of leaf nodes and ω is the value of the leaf nodes.
A first derivative function that is a loss function;
i is the second derivative function of the loss function, t is the t-th iteration.
In practice, each participant (i.e., the computing-involved airline) performs the computation on a local data set, which is typically done by the participant on a local client, without sharing the raw data to other participants or to a central server. After each round of model training is completed, the trained model parameters (i.e., XGBoost parameters) are sent to a central server.
The central server receives the model parameters sent from each airline as follows:
{(GL,GR,GA,HL,HR,HA,)1,...,(GL,GR,GA,HL,HR,HA,)n}
Wherein, GA,=∑i∈Igi;H A,=∑i∈Ihi,IL denotes left node data after splitting, I R denotes right node data after splitting, and n is the sum of splitting cases of the tree.
Based on homomorphic encryption, the central server can aggregate parameters of the local model from the local client without decryption, update the parameters and transmit the updated parameters back to each local server.
The optimal split node is given according to the following equation that maximizes:
Where k is the number of local clients (number of airlines participating in the calculation); g L is the G i sum of the samples of all the left Bian Shezi nodes of the binary tree; g R is the G i sum of samples of all right leaf nodes of the binary tree; g A is the G i sum of samples of all leaf nodes; h L is the sum of H i of samples of all left Bian Shezi nodes of the binary tree; h R is the sum of H i of samples of all right leaf nodes of the binary tree; h A is the H i sum of samples of all leaf nodes; lambda is the Taylor expansion coefficient; gamma is a penalty term.
After the model fusion is completed, the central server transmits the optimized segmentation point information to the local client, the local client decrypts the segmentation point information and uses the segmentation point information as new parameters of the local model, and the steps are repeated until the model converges.
And S207, performing model training again by using the optimized model parameters, and sending the latest model parameters obtained after training to the central server again, and repeating the steps until the model converges to obtain the model for predicting the passenger rate of the flight.
The local client calculates G F and H F of each leaf node and sends the calculation result { (G F,HF)1,...,(GF,HF)m) encryption to the central server, whereinI j is the data for leaf node j. The central server performs new weight calculation: /(I)WhereinThe weight of the leaf node j; k is the number of local clients (the number of airlines participating in the calculation), and the calculated result is sent to the clients.
Model optimization: and continuously adjusting and selecting an optimal parameter combination through a grid searching method, and storing a final model, wherein the output of the model is the predicted future flight passenger rate condition.
The parameters set by the final model after experimental debugging are shown in table 2.
TABLE 2
| |
Parameter name |
Meaning of |
Numerical value |
| 1 |
learning_rate |
Learning rate |
0.015 |
| 2 |
max_depth |
Maximum depth of tree |
5 |
| 3 |
subsample |
Sample sampling ratio |
80% |
| 4 |
colsample_bytree |
Ratio of feature sampling |
60% |
| 5 |
num_boost_round |
Number of iterations |
200 |
Aiming at the flight passenger rate prediction model, the invention also provides a model evaluation process, which comprises the following steps:
And preprocessing and labeling the test data according to the finally determined data preprocessing and labeling rules, calling the stored model to predict the test data, and comparing the test sample successfully labeled with the sample predicted by the model. The evaluation index of the experimental model is MSE (mean square error). The mean square error is the expected value of the square of the difference between the parameter estimated value and the parameter true value, and the smaller the mean square error of a model is, the better the fitting effect of the model is.
The final results are shown in Table 3.
TABLE 3 Table 3
| Prediction result name |
Remarks |
| Flight number |
|
| Departure date |
|
| By the time point |
10 Time points specified in scheme 2.2 |
| Flight passenger rate at this point in time |
Examples: passenger rate of flights 10 days before aircraft take-off |
The invention is based on XGBoost model, adopts transverse federal learning model as regression model of the model for predicting the passenger rate of the flight, compares with the traditional machine learning local training model, takes the prediction result of XX airline company as an example, and the result is shown in Table 4.
TABLE 4 Table 4
| Algorithm model |
MSE |
| Traditional machine learning local training model |
0.11 |
| Federal learning model (XGBoost based) |
0.08 |
Compared with the traditional scheme that each airline is required to concentrate the data set to a central server for model training, the method does not need to threaten the data privacy of the user. While federal learning protects the data security of airlines and passengers by model training on local clients without the need to centralize the data sets. For distributed deployment systems, this algorithm also solves the problem that data cannot be processed centrally.
Secondly, model training is carried out on the local client through horizontal federal learning, so that a large amount of computing resources can be saved, and computing pressure is uniformly distributed to all airlines participating in computing.
Again, federal learning can utilize data on multiple local clients for model training, and thus accuracy of the model. Meanwhile, the future passenger rate situation and trend of the flights are predicted more objectively and accurately, and ticket price adjustment is convenient and timely.
Furthermore, the invention adopts federation learning to adjust according to different scenes, such as increasing participation of a local client, increasing training times of the local client, or adjusting update frequency of a global model, so that federation learning can be applied to different avionics and scenes.
It is noted that the flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
Corresponding to the embodiment of the method, the invention also discloses a device for predicting the passenger rate of the flight.
Fig. 3 is a schematic structural diagram of a device for predicting a passenger rate of a flight, which is disclosed in an embodiment of the present invention, and the device is applied to a client of an airline company, where the client is connected to a central server, and the predicting device includes:
A data acquisition unit 301, configured to acquire current flight data and current passenger ticket booking data;
among them, current flight data includes, but is not limited to, market airline, flight number, departure time, arrival time, departure airport, arrival airport, etc.
Current passenger reservation data includes, but is not limited to, passenger personal information, passenger ticket information, and the like.
The preprocessing unit 302 is configured to perform feature preprocessing on the current flight data and the current passenger ticket booking data to obtain a current derivative feature suitable for a service scenario;
The characteristic preprocessing process comprises the following steps: feature screening, missing value and outlier handling and feature derivation.
In practical application, based on the journey data of the passengers, flights (one flight is determined by using a flight number, a departure time, an arrival time, a departure airport and an arrival airport) can be grouped and feature derivation is implemented, so that current derived features are obtained and participate in subsequent model establishment.
Current derivative features include, but are not limited to, flight departure date, market airline on which the flight resides, flight number, departure airport code, and the like.
A vectorization unit 303, configured to perform feature vectorization processing on the current derivative feature to obtain a current feature vector;
The purpose of feature vectorization is to convert data into a numerical vector form so that machine learning algorithms can handle. A feature vector is a vector that has some important properties or characteristics. In data science, feature vectors typically represent one attribute or feature in a dataset.
The prediction unit 304 is configured to input the current feature vector to a pre-established flight passenger rate prediction model, so as to obtain a flight passenger rate prediction value;
The model is characterized in that the model for predicting the passenger seat rate of the flight takes a training sample feature vector marked with a label of the passenger seat rate of the flight as training data, and after being trained by adopting a XGBoost model initialized by parameters, the client transmits the obtained model parameters to the central server, so that the central server adopts a transverse federal learning algorithm to carry out model fusion and parameter update on the model parameters transmitted by a plurality of clients.
In this embodiment, the central server is connected to clients of each airline company, and is configured to implement fusion of multiple local models (i.e., local models) by using a horizontal federal learning algorithm on model parameters uploaded by each client, so as to obtain a total regression model, i.e., a global model. Parameters of each local model are updated and then transmitted back to each client.
In summary, the invention discloses a device for predicting the passenger seat rate of a flight, which is used for acquiring current flight data and current passenger ticket booking data, carrying out feature preprocessing to obtain current derivative features suitable for a service scene, carrying out feature vectorization processing on the current derivative features to obtain current feature vectors, and inputting the current feature vectors into a pre-established model for predicting the passenger seat rate of the flight to obtain a predicted value of the passenger seat rate of the flight. The model is characterized in that a training sample feature vector marked with a flight passenger rate label is used as training data in the flight passenger rate prediction model, parameters are initialized to be XGBoost models, and then the obtained model parameters are sent to a central server by a client, so that the central server adopts a transverse federal learning algorithm to carry out model fusion and parameter updating on the model parameters sent by a plurality of clients to obtain the model parameters, and the transverse federal learning allows a plurality of devices to cooperatively train the model under the condition of not sharing the data.
To further optimize the above embodiments, the preprocessing unit 302 may specifically be configured to:
screening initial characteristics from current flight data and current passenger booking data;
processing the missing value and the abnormal value of the initial feature to obtain a target feature;
and carrying out feature derivatization processing on the target feature to obtain the current derivatization feature.
To further optimize the above embodiment, the prediction apparatus may further include:
the model building unit is used for building a flight passenger rate prediction model;
the model building unit includes:
An obtaining subunit, configured to obtain a historical original data set for a preset period of time, where the historical original data set includes: historical flight data and historical passenger booking data;
the preprocessing subunit is used for preprocessing the historical original data set to obtain a training sample;
The vectorization subunit is used for carrying out feature vectorization processing on the training samples to obtain training sample feature vectors;
the passenger seat rate determining subunit is used for determining the corresponding historical flight passenger seat rate based on the training sample;
The training subunit is provided with a XGBoost model for inputting the training sample feature vector and the historical flight passenger seat rate into parameter initialization for training;
the model parameter optimization subunit is used for sending the model parameters obtained after training to the central server, so that the central server adopts a transverse federal learning algorithm to perform model fusion and segmentation on the model parameters sent by the plurality of clients to obtain optimized model parameters;
And the training subunit is used for carrying out model training again by utilizing the optimized model parameters, sending the latest model parameters obtained after training to the central server again, and repeating the steps until the model converges to obtain the flight passenger rate prediction model.
The specific operation principle of each component in the embodiment of the device should be specifically described, please refer to the corresponding portion of the method embodiment, and the detailed description is omitted herein.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The name of the unit does not in any way constitute a limitation of the unit itself, for example the first acquisition unit may also be described as "unit acquiring at least two internet protocol addresses".
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
Corresponding to the above embodiment, as shown in fig. 4, the present invention further provides an electronic device, where the electronic device may include: a processor 1 and a memory 2;
Wherein the processor 1 and the memory 2 complete communication with each other through the communication bus 3;
a processor 1 for executing at least one instruction;
A memory 2 for storing at least one instruction;
The processor 1 may be a central processing unit CPU, or an Application-specific integrated Circuit ASIC (Application SPECIFIC INTEGRATED Circuit), or one or more integrated circuits configured to implement embodiments of the present invention.
The memory 2 may comprise a high-speed RAM memory or may further comprise a non-volatile memory (non-volatile memory), such as at least one disk memory.
The processor executes at least one instruction to implement the steps shown in the embodiment of the method for predicting the passenger rate of the flight.
In summary, the invention discloses an electronic device, which is used for acquiring current flight data and current passenger ticket booking data, carrying out feature preprocessing to obtain current derivative features suitable for a service scene, carrying out feature vectorization processing on the current derivative features to obtain current feature vectors, and inputting the current feature vectors into a pre-established flight passenger seat rate prediction model to obtain a flight passenger seat rate prediction value. The model is characterized in that a training sample feature vector marked with a flight passenger rate label is used as training data in the flight passenger rate prediction model, parameters are initialized to be XGBoost models, and then the obtained model parameters are sent to a central server by a client, so that the central server adopts a transverse federal learning algorithm to carry out model fusion and parameter updating on the model parameters sent by a plurality of clients to obtain the model parameters, and the transverse federal learning allows a plurality of devices to cooperatively train the model under the condition of not sharing the data.
Corresponding to the above embodiment, the invention also discloses a computer readable storage medium storing at least one instruction, which when executed by the processor, implements the steps shown in the embodiment of the method for predicting the passenger occupancy of a flight.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
In summary, the invention discloses a computer readable storage medium, which is used for acquiring current flight data and current passenger ticket booking data, carrying out feature preprocessing to obtain current derivative features suitable for a service scene, carrying out feature vectorization processing on the current derivative features to obtain current feature vectors, and inputting the current feature vectors into a pre-established flight passenger seat rate prediction model to obtain a flight passenger seat rate prediction value. The model is characterized in that a training sample feature vector marked with a flight passenger rate label is used as training data in the flight passenger rate prediction model, parameters are initialized to be XGBoost models, and then the obtained model parameters are sent to a central server by a client, so that the central server adopts a transverse federal learning algorithm to carry out model fusion and parameter updating on the model parameters sent by a plurality of clients to obtain the model parameters, and the transverse federal learning allows a plurality of devices to cooperatively train the model under the condition of not sharing the data.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.
While several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).