Generalized learning vectorization-based academic prediction method and system, medium and equipment
Through a method based on generalized learning vectorization, the multi-dimensional data of the school district is integrated into a feature vector, and the XGBoost regression prediction model is used for optimization, which solves the problem that it is difficult to predict the degree at the school district level with the existing technology, and realizes the efficient degree demand at the school district level. predict.
Patent Information
- Application Number
- CN202411907654.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-01-24
AI Technical Summary
The existing degree predictions are mainly aimed at the urban and district levels, and it is difficult to make effective predictions at the school district level, and there is a lack of feasible solutions for the school district level.
The method based on a broad learning method is used to integrate the multi -dimensional data of the school district into a feature vector of unified dimensions. The XGBOOST regression prediction model construction and target function optimization can be achieved to achieve the prediction of degree requirements at the school district level.
It effectively realizes the degree prediction at the school district level, provides more accurate and detailed degree demand prediction results, and meets the degree prediction needs at the school district level.
Smart Images

Figure CN119359506A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of degree prediction, and in particular to a degree prediction method, system, medium and device based on generalized learning vectorization. Background Art
[0002] In the field of education, degree prediction has many meanings in education planning and management, and plays an important role in promoting educational equity, optimizing resource allocation, and improving education quality. Therefore, educational institutions and education management departments should attach importance to and strengthen degree prediction work to provide strong guarantees for the sustainable development of education.
[0003] Existing degree predictions are mainly aimed at the urban area level. Degree demand is mainly related to local economic development, household registration population data, permanent population data, floating population data, basic education admission policies and other factors. For degree predictions at the urban level, degree demand can be roughly predicted based on these macro data. However, degree resources in most cities in my country are currently allocated based on school districts. The data involved in degree predictions based on school districts is more basic and the influencing factors are more complex. There is no ready-made reference solution for in-depth data prediction at the school district level. Therefore, a method and system for degree prediction at the school district level is urgently needed. Summary of the invention
[0004] Based on this, it is necessary to propose a degree prediction method, system, medium and equipment based on generalized learning vectorization to address the above problems.
[0005] A degree prediction method based on generalized learning vectorization, the method comprising: The school districts are divided into different types according to the degree of school district shortage, different types of school districts are determined, and multi-dimensional data of each school district in historical school years and multi-dimensional data of school districts in future school years are obtained.
[0006] The multi-dimensional data of the school districts in the historical school year are integrated into a first eigenvector of a unified dimension, and the multi-dimensional data of the school districts in the future school year are integrated into a second eigenvector of a unified dimension.
[0007] Based on the generalized learning vectorization algorithm, the first feature vector of the historical academic year is used as an input sample, and an objective function is defined according to the distance between the input sample and the prototype vector.
[0008] The latest tree is generated by the objective function, the number of public school enrollments in each school district in the historical school year is used as the prediction target, the first feature vector is used as the input sample, and the final XGBoost regression prediction model for each school district type is constructed by adding the latest tree.
[0009] The second eigenvector of each school district in the next school year is input into the final XGBoost regression prediction model of the school district type corresponding to each school district to predict the degree demand, so as to obtain the predicted number of enrollments for public schools in each school district in the next school year.
[0010] The generalized learning vectorization algorithm is based on taking the first feature vector of the historical academic year as an input sample and defining an objective function according to the distance between the input sample and the prototype vector, specifically including: Based on the generalized learning vectorization algorithm, the first feature vector of the historical school year is used as an input sample, and five corresponding types of prototype vectors are initialized according to the school district type of the input sample.
[0011] A cosine similarity loss function is determined according to the distance between the input sample and the initialized prototype vector of the corresponding type.
[0012] An objective function is determined according to the cosine similarity loss function.
[0013] The determining of the objective function according to the cosine similarity loss function specifically includes: The expression of the objective function is as follows:
[0014] in, .
[0015] Among them, L is the loss function of the regression prediction model, is the i-th input sample, is the true value corresponding to the i-th input sample, is the predicted value of the t-1th round, is the leaf weight regularization parameter, is the cosine similarity loss function, is the objective function, t is the round, is the latest tree in round t, is the regularization term.
[0016] The method of generating the latest tree through the objective function, taking the number of public school enrollments in each school district in the historical school year as the prediction target, taking the first feature vector as the input sample, and constructing the final XGBoost regression prediction model of each school district type by adding the latest tree specifically includes: The number of public school enrollments in each school district in the historical school year is used as the prediction target, and the first eigenvector is used as the input sample for modeling to determine the initial constant model.
[0017] Based on the gain function, the left child node and the right child node when the gain function is minimized are determined according to the first-order derivative and the second-order derivative of the objective function.
[0018] Generate an updated tree through the left child node and the right child node.
[0019] The latest tree is fitted to the initial constant model, and the XGBoost regression prediction model of the current round is determined by adding the latest tree.
[0020] The XGBoost regression prediction model of the current round is used to make predictions to obtain the predicted value of the current round.
[0021] Repeat the above steps until the preset number of trees is reached to determine the final XGBoost regression prediction model for the current school district.
[0022] The method of taking the number of public school enrollments in each school district in the historical school year as the prediction target, taking the first feature vector as the input sample for modeling, and determining the initial constant model specifically includes: The expression of the initial constant model is as follows:
[0023] in, is the initial constant model, is the true value corresponding to the i-th input sample, is the loss function of the regression prediction model, is the average value of the predicted target.
[0024] The above steps are repeated until the preset number of trees is reached to determine the final XGBoost regression prediction model for the current school district, which specifically includes: The final XGBoost regression prediction model for the current school district is expressed as follows:
[0025] in, The final XGBoost regression prediction model for the current school district, is the final prediction value of the final XGBoost regression prediction model, T is the maximum round, is the input sample for the next academic year, t is the round, is the latest tree in round t, and 500 is the preset number of trees.
[0026] The method of integrating the other multi-dimensional data of the school district in the historical school year into a first feature vector of a unified dimension and integrating the other multi-dimensional data of the school district in the future school year into a second feature vector of a unified dimension specifically includes: Determine a first query matrix, a first key matrix, and a first value matrix based on other multidimensional data of the school district in the historical school year, and determine a second query matrix, a second key matrix, and a second value matrix based on other multidimensional data of the school district in the future school year; according to Determine the first eigenvector of uniform dimension, where is the feature vector, is the fusion function, is the first query matrix, is the transpose of the first bond matrix, is the first value matrix; according to Determine the second eigenvector of uniform dimension, where is the feature vector, is the fusion function, is the second query matrix, is the transpose of the second bond matrix, is the second value matrix.
[0027] A degree prediction system based on generalized learning vectorization, the system comprising: The multidimensional data acquisition module is used to classify school districts according to the degree of school district shortage, determine different school district types, and obtain the multidimensional data of each school district in the historical school year and the multidimensional data of the school district in the future school year.
[0028] The feature vector integration module is used to integrate the multi-dimensional data of the school districts in the historical school year into a first feature vector of a unified dimension, and to integrate the multi-dimensional data of the school districts in the future school year into a second feature vector of a unified dimension.
[0029] The objective function definition module is used to define the objective function based on the generalized learning vectorization algorithm, taking the first feature vector of the historical academic year as an input sample and according to the distance between the input sample and the prototype vector.
[0030] The final XGBoost regression prediction model construction module is used to generate the latest tree through the objective function, take the number of public school enrollments in each school district in the historical school year as the prediction target, take the first feature vector as the input sample, and construct the final XGBoost regression prediction model for each school district type by adding the latest tree.
[0031] The prediction module is used to input the second feature vector of each school district in the next school year into the final XGBoost regression prediction model of the school district type corresponding to each school district to predict the degree demand, and obtain the predicted number of enrollments for public schools in each school district in the next school year.
[0032] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the steps of the method described above.
[0033] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above method.
[0034] The embodiments of the present invention have the following beneficial effects: It can be seen from the above description that in the present invention, the multidimensional data of the school district in the historical school year and the multidimensional data of the school district in the future school year are obtained. The multidimensional data of the school district can fully reflect the actual situation of each school district in the current year, and the multidimensional data of the school district in the historical school year and the multidimensional data of the school district in the future school year are respectively integrated into the first eigenvector and the second eigenvector of the unified dimension. Further, based on the generalized learning vectorization algorithm and the multidimensional data of the school district in the historical school year of each semester, each school district is divided into different school district types, and the first eigenvector of the school district belonging to the same type is used to determine the prototype vector of each school district type, and the first eigenvector of the historical school year is used as an input sample. The objective function is defined according to the distance between the input sample and the prototype vector, and the latest tree is generated through the objective function. The number of public school enrollments in each school district in the historical school year is used as the prediction target, and the first eigenvector is used as the input sample. The final XGBoost regression prediction model of each school district type is constructed by adding the latest tree, and the second eigenvector of each school district in the future school year is input into the final XGBoost regression prediction model of the school district type corresponding to each school district for degree demand prediction, and the predicted number of public school enrollments in each school district in the future school year is obtained. Through the above methods, the degree prediction at the school district level can be effectively realized to meet the needs of degree prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0036] in: Figure 1 A schematic diagram of a flow chart of an embodiment of a degree prediction method based on generalized learning vectorization provided by the present invention; Figure 2 A schematic flow chart of another embodiment of a degree prediction method based on generalized learning vectorization provided by the present invention; Figure 3A flowchart of another embodiment of a degree prediction method based on generalized learning vectorization provided by the present invention; Figure 4 A schematic diagram of the structure of an embodiment of a degree prediction system based on generalized learning vectorization provided by the present invention; Figure 5 A schematic structural diagram of an embodiment of the device provided by the present invention; Figure 6 A schematic structural diagram of an embodiment of the medium provided by the present invention. DETAILED DESCRIPTION
[0037] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0038] like Figure 1 As shown, Figure 1 A flowchart of an embodiment of a degree prediction method based on generalized learning vectorization provided by the present invention. A degree prediction method based on generalized learning vectorization, the method comprising: S101: Classify school districts according to the degree of school district shortage, determine different types of school districts, and obtain multi-dimensional data of each school district in historical school years and multi-dimensional data of school districts in future school years.
[0039] For example, first, multiple types of school districts are defined according to the degree of school district tension. For example, five types of school districts can be defined: "tight", "mildly tight", "moderate", "mildly oversupplied", and "oversupplied". Obtain the number of public school enrollments in each school district in the historical school year And school district multidimensional data , specifically: The number of public school enrollments matched to the school district in the historical school year; The maximum circumscribed polygon of the school district in the historical school year. The maximum circumscribed polygon refers to the shape formed by the edges of the school district's geographical location; is the registered school-age population of City A in the historical school year, where City A is the city where the school district is located; The non-registered school-age population of City A in the historical school year; for the floating school-age population of the school district during the historical school year; The number of supporting public schools for the school district in the historical school year; The number of students enrolled in the supporting public schools of the school district in the historical school year; The school system of the public schools in the school district in the historical school year is coded as follows: 1 for primary school, 2 for nine-year system, 3 for junior high school, and 4 for twelve-year system; To add new places for the district's new, renovated and expanded construction during the historical school year; To provide the school district with the planned number of public schools to enroll in the historical academic year.
[0040] Similarly, obtain the multi-dimensional data of each school district in the next school year. , each school district in the coming school year will be Describe: The maximum circumscribed polygon of the school district in the next school year; The registered school-age population in City A in the next school year, where City A is the city where the school district is located; The non-hukou school-age population of City A in the coming school year; for the district’s mobile school-age population in the coming school year; The number of supporting public schools for the school district in the coming school year; The number of students enrolled in the supporting public schools for the school district in the coming school year; To provide the school district with a matching public school system in the future school year, the code is: 1 for primary school, 2 for a nine-year system, 3 for junior high school, and 4 for a twelve-year system; To add new places for the district’s new, renovated and expanded construction in future school years; To provide school districts with a matching public school enrollment plan for the coming school year.
[0041] It is understandable that the number of public school enrollments in a school district in the historical school year refers to the sum of the actual number of enrollments for all public schools in the entire school district, and the technical solution of this application is to predict the number of enrollments in each school district in the future school year. The number of public school enrollments in each school district in the historical school year and the multi-dimensional data of the school district are both known. Before predicting the number of enrollments in each school district in the future school year, the multi-dimensional data of the school district in the future school year is also known, so that the prediction can be better achieved. Furthermore, the historical school year can be one or more years in the past, and the future school year can also be one or more years in the future that need to be predicted.
[0042] S102: Integrate the multidimensional data of school districts in historical school years into a first eigenvector of a unified dimension, and integrate the multidimensional data of school districts in future school years into a second eigenvector of a unified dimension.
[0043] In the embodiment of the present invention, the multi-dimensional data of each school district in the historical school year and the future school year need to be integrated according to a unified dimension to obtain the first eigenvector of the historical school year and the second eigenvector of the future school year, specifically: First, we use the multidimensional data of school districts in historical school years to determine the modal characteristics of the school district's maximum circumscribed polygon and the modal characteristics of the non-maximum circumscribed polygon: ; *[ ]; in, is the modal feature of the maximum circumscribed polygon of the school district in the multidimensional data of school districts in the historical school year, is the modal feature of other data in the school district multidimensional data except the largest circumscribed polygon. In a feasible implementation method, The dimension can be The square array, The dimension can be The matrix of .
[0044] Furthermore, the above modal features are integrated into a first feature vector of unified dimension, including transforming and Projected to a uniform dimension vector and then fused through the converter model, the first eigenvector of each school district is obtained as shown below:
[0045] in, is the first eigenvector, is the fusion function of the converter model, is the first query matrix, is the transpose of the first bond matrix, is the first value matrix, , , , is the query matrix weight, is the bond matrix weight, is the value matrix weight, and in one feasible manner, the above-mentioned unified dimension vector can be 128.
[0046] Similarly, the multi-dimensional data of school districts in the future school year are integrated into the second eigenvector of unified dimension. Specifically: First, use the multidimensional data of school districts in the future school year to determine the modal characteristics of the maximum circumscribed polygon and the modal characteristics of non-maximum circumscribed polygons in the multidimensional data of school districts: ; *[ ]; in, is the modal feature of the maximum circumscribed polygon of the school district in the multidimensional data of the school district for the next school year, For the modal characteristics of the data other than the largest circumscribed polygon in the multidimensional data of the school district in the future school year, in a feasible way, The dimension can be The square array, The dimension can be The matrix of .
[0047] Then, the above modal features are integrated into the first feature vector of the same dimension, including: and Projected to a uniform dimensional vector and then fused through the converter model, the second eigenvector of each school district is obtained as shown below:
[0048] in, is the second eigenvector, is the fusion function of the converter model, is the second query matrix, is the transpose of the second bond matrix, is the second value matrix, , , , is the query matrix weight, is the bond matrix weight, is the value matrix weight, and in one feasible manner, the above-mentioned unified dimension vector can be 128.
[0049] S103: Based on the generalized learning vectorization algorithm, the first eigenvector of the historical academic year is used as an input sample, and the objective function is defined according to the distance between the input sample and the prototype vector.
[0050] Considering the tension between the school district population and the number of applicants, some school districts have a large population density and a high number of public school applicants, and the school district population and the number of public school applicants are positively correlated. Some school districts have a large school-age population density, but the number of public school applicants is very low, and the school district population and the number of public school applicants are negatively correlated. Therefore, the school district classification model can be trained based on the generalized learning vectorization algorithm. Generalized learning vector quantization is a prototype-based classification algorithm that is used to assign input data to previously defined categories. In a feasible implementation method, first, five corresponding types of prototype vectors are initialized according to the school district type of the input sample. Specifically, according to the registered school-age population of city A in the historical school year ( ) and the ratio of the number of applicants to public schools to initialize 5 prototype vectors , , , , (5 prototype vectors , , , , Representing five pre-defined school district types respectively), among which, the ratio of public school enrollment number / registered school-age population>1.25 is defined as tight, 1<public school enrollment number / registered school-age population<=1.25 is defined as slightly tight, 0.85<public school enrollment number / registered school-age population<=1 is defined as moderate, 0.6<public school enrollment number / registered school-age population<=0.85 is defined as slightly surplus, and public school enrollment number / registered school-age population<=0.6 is defined as surplus.
[0051] Furthermore, based on the above-defined and initialized prototype vector, the first eigenvector of the historical academic year is used as the input sample. For each input sample , and use cosine similarity to calculate the distance between it and the initialized prototype vector:
[0052] in, is the distance between the input sample and the prototype vector, is the input sample, is the prototype vector, i=(1, 2, 3, 4, 5).
[0053] Furthermore, the cosine similarity loss function is determined according to the input sample and the initialized prototype vector of the corresponding type. The cosine similarity loss function is shown as follows:
[0054] in, is the prototype variable corresponding to the school district type of the input sample, For other types of prototype variables, is the Euclidean norm, For the input sample x and The angle of For the input sample x and , m is the preset distance, GLVQLoss is the cosine similarity loss function, which tends to reduce the distance within the class and amplify the distance between classes, so that the prototype vector of the correct class should be closer to the input sample x.
[0055] Furthermore, the objective function is determined according to the cosine similarity loss function.
[0056] S104: Generate the latest tree through the objective function, take the number of public school enrollments in each school district in the historical school year as the prediction target, take the first eigenvector as the input sample, and build the final XGBoost regression prediction model for each school district type by adding the latest tree.
[0057] Exemplarily, the number of public school registrations in each school district in the historical school year is used as the prediction target, and the first eigenvector of the school district is used as the input sample for modeling to determine the initial constant model of the school district type corresponding to the school district. Based on the gain function, the left child node and the right child node when the gain function is minimized are determined according to the first-order derivative and the second-order derivative of the objective function. The latest tree is generated through the left child node and the right child node. The latest tree is fitted to the initial constant model, and the XGBoost regression prediction model of the current round is determined by adding the latest tree. Predictions are made through the XGBoost regression prediction model of the current round to obtain the predicted value of the current round. Repeat the above steps until the preset number of trees is reached to determine the final XGBoost regression prediction model of the current school district. It can be understood that for each school district type, the final XGBoost regression prediction model corresponding to the corresponding school district type can be trained in the above manner, and each school district type has a corresponding final XGBoost regression prediction model.
[0058] S105: Input the second eigenvector of each school district in the next school year into the final XGBoost regression prediction model of the school district type corresponding to each school district to predict the degree demand, and obtain the predicted number of enrollments for public schools in each school district in the next school year.
[0059] Exemplarily, the second eigenvector of the current school district in the next school year is input into the final XGBoost regression prediction model of the school district type corresponding to the current school district to predict the degree demand, and obtain the predicted number of applicants for public schools in the school district in the next school year. For example, if the school district type of the current school district is "tight", the second eigenvector of the current school district in the next school year is input into the final XGBoost regression prediction model corresponding to the school district type "tight" to predict the degree.
[0060] It can be seen from the above description that in the present invention, the multidimensional data of the school district in the historical school year and the multidimensional data of the school district in the future school year are obtained. The multidimensional data of the school district can fully reflect the actual situation of each school district in the current year, and the multidimensional data of the school district in the historical school year and the multidimensional data of the school district in the future school year are respectively integrated into the first eigenvector and the second eigenvector of the unified dimension. Further, based on the generalized learning vectorization algorithm and the multidimensional data of the school district in the historical school year of each semester, each school district is divided into different school district types, and the first eigenvector of the school district belonging to the same type is used to determine the prototype vector of each school district type, and the first eigenvector of the historical school year is used as an input sample. The objective function is defined according to the distance between the input sample and the prototype vector, and the latest tree is generated through the objective function. The number of public school enrollments in each school district in the historical school year is used as the prediction target, and the first eigenvector is used as the input sample. The final XGBoost regression prediction model of each school district type is constructed by adding the latest tree, and the second eigenvector of each school district in the future school year is input into the final XGBoost regression prediction model of the school district type corresponding to each school district for degree demand prediction, and the predicted number of public school enrollments in each school district in the future school year is obtained. Through the above methods, the degree prediction at the school district level can be effectively realized to meet the needs of degree prediction.
[0061] like Figure 2 As shown, Figure 2 A flowchart of another embodiment of a degree prediction method based on generalized learning vectorization provided by the present invention, the method comprising: S201: Classify school districts according to the degree of school district shortage, determine different types of school districts, and obtain multi-dimensional data of each school district in historical school years and multi-dimensional data of school districts in future school years.
[0062] S202: Integrate the multidimensional data of school districts in historical school years into a first eigenvector of a unified dimension, and integrate the multidimensional data of school districts in future school years into a second eigenvector of a unified dimension.
[0063] It should be noted that steps S201-S202 are Figure 1 This has been discussed in detail in the implementation scenario shown and will not be repeated here.
[0064] S203: Based on the generalized learning vectorization algorithm, the first eigenvector of the historical school year is used as an input sample, and five corresponding types of prototype vectors are initialized according to the school district type of the input sample.
[0065] For example, the registered age population of City A in the historical school year ( ) and the ratio of the number of applicants to public schools. Initialize 5 prototype vectors among all prototype vectors. , , , , (5 prototype vectors , , , , Representing five pre-defined school district types respectively), among which, the ratio of public school enrollment number / registered school-age population>1.25 is defined as tight, 1<public school enrollment number / registered school-age population<=1.25 is defined as slightly tight, 0.85<public school enrollment number / registered school-age population<=1 is defined as moderate, 0.6<public school enrollment number / registered school-age population<=0.85 is defined as slightly surplus, and public school enrollment number / registered school-age population<=0.6 is defined as surplus.
[0066] S204: Determine a cosine similarity loss function according to the distance between the input sample and the initialized prototype vector of the corresponding type.
[0067] For example, the first feature vector of the historical academic year is used as the input sample. For each input sample , and use cosine similarity to calculate the distance between it and the prototype vector:
[0068] in, is the distance between the input sample and the prototype vector, is the input sample, is the prototype vector, i=(1, 2, 3, 4, 5).
[0069] Furthermore, the cosine similarity loss function is defined according to the input sample and the corresponding prototype vector. The cosine similarity loss function is shown as follows:
[0070] in, is the prototype variable corresponding to the school district type of the input sample, For other types of prototype variables, is the Euclidean norm, For the input sample x and The angle of For the input sample x and , m is the preset distance, GLVQLoss is the cosine similarity loss function, which tends to reduce the distance within the class and amplify the distance between classes, so that the prototype vector of the correct class should be closer to the input sample x.
[0071] At the same time, the prototype vector needs to be iteratively optimized. Specifically, the prototype vector is updated using GLVQLoss:
[0072]
[0073] in, is the prototype variable for the updated school district type assigned to the input sample, is the updated prototype variable of other categories that are not assigned to the input sample, is the leaf number regularization parameter, is the prototype variable for the type of school district assigned to the input sample, is the prototype variable of other categories that are not assigned to the input sample, and GLVQLoss is the cosine similarity loss function.
[0074] S205: Determine the target function according to the cosine similarity loss function.
[0075] Exemplarily, the regression prediction model loss function is first determined according to the following formula:
[0076] Among them, L is the loss function of the regression prediction model, is the i-th input sample, is the true value corresponding to the i-th input sample, is the predicted value of the t-1th round, is the leaf weight regularization parameter, is the cosine similarity loss function; it can be understood that the above input sample is the first eigenvector of the school district in the historical school year, and the true value of the input sample is the above The above forecast value is the predicted number of public school enrollments in the school district in the historical school year.
[0077] Then determine the objective function according to the following formula:
[0078] in, is the objective function, t is the round, is the i-th input sample, L is the regression prediction model loss function, is the true value corresponding to the i-th input sample, is the predicted value of the t-1th round, is the latest tree in round t, is the regularization term.
[0079] It should be noted that the regularization term It is a penalty term for model complexity to prevent overfitting. Usually it includes the number of leaves in the tree and the L2 regularization of the leaf weights, as shown in the following formula:
[0080] in, is the number of leaves in the tree, is the leaf weight, is the leaf number regularization parameter, is the leaf weight regularization parameter.
[0081] It can be understood that the input samples and prototype vectors of the same school district type can obtain the objective function of the corresponding school district type. For example, the first eigenvector of the school district whose school district type is "mild tension" and the prototype vector corresponding to the school district type of "mild tension" can be used to obtain the objective function corresponding to the school district type of "mild tension" in the above manner.
[0082] S206: Generate the latest tree through the objective function, take the number of public school enrollments in each school district in the historical school year as the prediction target, take the first eigenvector as the input sample, and build the final XGBoost regression prediction model for each school district type by adding the latest tree.
[0083] S207: Input the second eigenvector of each school district in the next school year into the final XGBoost regression prediction model of the school district type corresponding to each school district to predict the degree demand, and obtain the predicted number of enrollments for public schools in each school district in the next school year.
[0084] From the above description, it can be seen that the present invention superimposes the cosine similarity loss function in the objective function, which not only needs to consider the minimum regression value of the predicted value, but also needs to consider the number of registrations with the same trend in school districts with similar characteristics (i.e., the same school district type), which helps to aggregate school districts with similar characteristics and minimize the regression error. The prediction goal can be achieved by end-to-end training through the constructed objective function.
[0085] It should be noted that steps S206-S207 are Figure 1 This has been discussed in detail in the implementation scenario shown and will not be repeated here.
[0086] like Figure 3 As shown, Figure 3A flowchart of another embodiment of a degree prediction method based on generalized learning vectorization provided by the present invention. A degree prediction method based on generalized learning vectorization is specifically a refinement of the above step S105, specifically comprising: S301: Taking the number of public school enrollments in each school district in the historical school year as the prediction target, modeling is performed using the first eigenvector as an input sample to determine an initial constant model.
[0087] For example, the number of public school enrollments in each school district in the historical school year is used as the prediction target, and the first eigenvector is used as the input sample for modeling to determine the initial constant model; Specifically, the initial constant model is determined according to the following formula:
[0088] in, is the initial constant model, is the true value corresponding to the i-th input sample, which is the number of public school enrollments in the school district in the historical school year. is the loss function of the regression prediction model, is the average value of the predicted target.
[0089] S302: Based on the gain function, determine the left child node and the right child node when the gain function is minimized according to the first-order derivative and the second-order derivative of the objective function.
[0090] Exemplarily, the objective function is approximated by a second-order Taylor expansion, and the objective function is shown in the following formula:
[0091] in, is the first-order derivative, is the second-order derivative, is the regularization term.
[0092] ; .
[0093] The criterion for splitting nodes is based on the gain function. The larger the gain, the more the model error is reduced after the split. The gain function is shown as follows:
[0094] in, is the gain function, left is the left child node, right is the right child node, is the leaf number regularization parameter, is the leaf weight regularization parameter.
[0095] It should be noted that the gain function is a tool used to guide how to optimize the objective function. By calculating the gain, the optimal tree structure and splitting method can be selected to minimize the objective function.
[0096] S303: Generate the latest tree through the left child node and the right child node.
[0097] S304: Fit the latest tree to the initial constant model, and determine the XGBoost regression prediction model of the current round by adding the latest tree.
[0098] Exemplarily, the XGBoost regression prediction model of the tth round can be determined by gradually adding the latest trees. The expression of the XGBoost regression prediction model of the tth round is as follows:
[0099] in, is the predicted value of round t, is the predicted value of the t-1th round, is the latest tree in round t, where t is the round.
[0100] S305: Predicting is performed using the XGBoost regression prediction model of the current round to obtain the predicted value of the current round.
[0101] S306: Repeat the above steps until the preset number of trees is reached to determine the final XGBoost regression prediction model for the current school district.
[0102] For example, the final XGBoost regression prediction model for the current school district is shown in the following formula:
[0103] in, The final XGBoost regression prediction model for the current school district, is the final prediction value of the final XGBoost regression prediction model, T is the maximum round, is the input sample for the next academic year, t is the round, is the latest tree in round t, and 500 is the preset number of trees.
[0104] like Figure 4 As shown, Figure 4 A schematic diagram of a degree prediction system based on generalized learning vectorization provided by the present invention. A degree prediction system 10 based on generalized learning vectorization, the system comprises: The multi-dimensional data acquisition module 11 is used to classify school districts according to the degree of school district shortage, determine different school district types, and obtain the multi-dimensional data of each school district in the historical school year and the multi-dimensional data of the school district in the future school year.
[0105] The feature vector integration module 12 is used to integrate the multi-dimensional data of school districts in historical school years into a first feature vector of unified dimension, and to integrate the multi-dimensional data of school districts in future school years into a second feature vector of unified dimension.
[0106] The objective function definition module 13 is used to define the objective function based on the generalized learning vectorization algorithm, taking the first eigenvector of the historical academic year as an input sample and the distance between the input sample and the prototype vector.
[0107] The final XGBoost regression prediction model construction module 14 is used to generate the latest tree through the objective function, taking the number of public school enrollments in each school district in the historical school year as the prediction target, and taking the first eigenvector as the input sample, and constructing the final XGBoost regression prediction model for each school district type by adding the latest tree.
[0108] The prediction module 15 is used to input the second eigenvector of each school district in the next school year into the final XGBoost regression prediction model of the school district type corresponding to each school district to predict the degree demand, and obtain the predicted number of enrollments for public schools in each school district in the next school year.
[0109] Exemplarily, in the multidimensional data acquisition module 11, the school districts are divided into school district types according to the degree of degree of degree tension, different school district types are determined, and the school district multidimensional data of each school district in the historical school year and the school district multidimensional data of the future school year are obtained. In the feature vector integration module 12, the school district multidimensional data of the historical school year is integrated into the first feature vector of the unified dimension, and the school district multidimensional data of the future school year is integrated into the second feature vector of the unified dimension. In the objective function definition module 13, based on the generalized learning vectorization algorithm, the first feature vector of the historical school year is used as the input sample, and the prototype vectors of five corresponding types are initialized according to the school district type of the input sample. The cosine similarity loss function is determined according to the distance between the input sample and the initialized prototype vector of the corresponding type. The objective function is determined according to the cosine similarity loss function. In the final XGBoost regression prediction model construction module 14, the number of public school registrations in each school district in the historical school year is used as the prediction target, and the first feature vector is used as the input sample for modeling to determine the initial constant model. Based on the gain function, the left child node and the right child node when the gain function is the smallest are determined according to the first-order derivative and the second-order derivative of the objective function. Generate the latest tree through the left child node and the right child node. Fit the latest tree to the initial constant model, and determine the XGBoost regression prediction model of the current round by adding the latest tree. Make predictions through the XGBoost regression prediction model of the current round to obtain the predicted value of the current round. Repeat the above steps until the preset number of trees is reached to determine the final XGBoost regression prediction model of the current school district. In the prediction module 15, the second eigenvector of each school district in the next school year is input into the final XGBoost regression prediction model of the school district type corresponding to each school district to predict the degree demand, and obtain the predicted number of registrations for public schools in each school district in the next school year.
[0110] like Figure 5 As shown, Figure 5 The device 20 includes a memory 21 and a processor 22. The memory 21 stores a computer program, and the processor 22 executes the computer program when working to implement the following. Figure 1 , Figure 2 and Figure 3 The method shown.
[0111] The specific technical details of a degree prediction method based on generalized learning vectorization implemented when the above-mentioned device 20 executes a computer program have been discussed in detail in the aforementioned method steps, so they will not be repeated here.
[0112] like Figure 6 As shown, Figure 6 The structure diagram of an embodiment of the medium provided by the present invention is shown in FIG. The medium 30 stores at least one computer program 31, and the computer program 31 is executed by a processor to implement the following Figure 1-Figure 3 In one embodiment, the medium 30 may be a storage chip, a hard disk, a mobile hard disk, a USB flash drive, an optical disk, or other readable and writable storage tools, or a server, etc.
[0113] The above describes specific embodiments of the present specification, and other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily have to be performed in the specific order or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0114] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and non-volatile computer-readable storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0115] The apparatus, device, non-volatile computer-readable storage medium and method provided in the embodiments of this specification correspond to each other, and therefore, the apparatus, device, and non-volatile computer storage medium also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the corresponding apparatus, device, and non-volatile computer storage medium will not be repeated here.
[0116] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0117] For the convenience of description, the above device is described by being divided into various units according to their functions and described separately. Of course, when implementing this specification, the functions of each unit can be implemented in one or more software and / or hardware. It should be understood by those skilled in the art that this specification embodiment can be provided as a method, system, or computer program product. Therefore, this specification embodiment can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification embodiment can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0118] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0119] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0120] The above disclosure is only the preferred embodiment of the present invention, which certainly cannot be used to limit the scope of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope of the present invention.
Claims
1. A degree prediction method based on generalized learning vectorization, characterized in that: The method comprises: Classify the school districts according to the degree of school enrollment shortage, determine the different types of school districts, and obtain the multi-dimensional data of each school district in the historical school year and the multi-dimensional data of the school district in the future school year; Integrate the multidimensional data of the school districts in the historical school year into a first eigenvector of a unified dimension, and integrate the multidimensional data of the school districts in the future school year into a second eigenvector of a unified dimension; Based on the generalized learning vectorization algorithm, the first feature vector of the historical academic year is used as an input sample, and an objective function is defined according to the distance between the input sample and the prototype vector; Generate the latest tree through the objective function, take the number of public school enrollments in each school district in the historical school year as the prediction target, take the first feature vector as the input sample, and build the final XGBoost regression prediction model of each school district type by adding the latest tree; The second characteristic vector of each school district in the next school year is input into the final XGBoost regression prediction model of the school district type corresponding to each school district to predict the degree demand, so as to obtain the predicted number of enrollments for public schools in each school district in the next school year.
2. A degree prediction method based on generalized learning vectorization according to claim 1, characterized in that: The generalized learning vectorization algorithm uses the first feature vector of the historical academic year as an input sample and defines an objective function according to the distance between the input sample and the prototype vector, specifically including: Based on the generalized learning vectorization algorithm, the first feature vector of the historical school year is used as an input sample, and five corresponding types of prototype vectors are initialized according to the school district type of the input sample; Determine a cosine similarity loss function according to the distance between the input sample and the initialized prototype vector of the corresponding type; An objective function is determined according to the cosine similarity loss function.
3. A degree prediction method based on generalized learning vectorization according to claim 2, characterized in that: Determining the objective function according to the cosine similarity loss function specifically includes: The expression of the objective function is as follows: in, Among them, L is the loss function of the regression prediction model, is the i-th input sample, is the true value corresponding to the i-th input sample, is the predicted value of the t-1th round, is the leaf weight regularization parameter, is the cosine similarity loss function, is the objective function, t is the round, is the latest tree in round t, is the regularization term.
4. A degree prediction method based on generalized learning vectorization according to claim 2, characterized in that: The method generates the latest tree through the objective function, takes the number of public school enrollments in each school district in the historical school year as the prediction target, takes the first feature vector as the input sample, and constructs the final XGBoost regression prediction model of each school district type by adding the latest tree, specifically including: The number of public school enrollments in each school district in the historical school year is used as the prediction target, and the first characteristic vector is used as the input sample to build a model and determine the initial constant model; Based on the gain function, determining the left child node and the right child node when the gain function is minimized according to the first-order derivative and the second-order derivative of the objective function; Generate a latest tree through the left child node and the right child node; Fitting the latest tree to the initial constant model, and determining the XGBoost regression prediction model of the current round by adding the latest tree; Predicting by using the XGBoost regression prediction model of the current round to obtain the predicted value of the current round; Repeat the above steps until the preset number of trees is reached to determine the final XGBoost regression prediction model for the current school district.
5. A degree prediction method based on generalized learning vectorization according to claim 4, characterized in that: The method uses the number of public school enrollments in each school district in the historical school year as a prediction target, uses the first feature vector as an input sample to perform modeling, and determines an initial constant model, specifically including: The expression of the initial constant model is as follows: in, is the initial constant model, is the true value corresponding to the i-th input sample, is the loss function of the regression prediction model, is the average value of the predicted target.
6. A degree prediction method based on generalized learning vectorization according to claim 4, characterized in that: The above steps are repeated until the preset number of trees is reached to determine the final XGBoost regression prediction model for the current school district, specifically including: The final XGBoost regression prediction model for the current school district is expressed as follows: in, The final XGBoost regression prediction model for the current school district, is the final prediction value of the final XGBoost regression prediction model, T is the maximum round, is the input sample for the next academic year, t is the round, is the latest tree in round t, and 500 is the preset number of trees.
7. A degree prediction method based on generalized learning vectorization according to claim 1, characterized in that: The method of integrating the other multi-dimensional data of the school district in the historical school year into a first feature vector of a unified dimension and integrating the other multi-dimensional data of the school district in the future school year into a second feature vector of a unified dimension specifically includes: Determine a first query matrix, a first key matrix, and a first value matrix based on other multidimensional data of the school district in the historical school year, and determine a second query matrix, a second key matrix, and a second value matrix based on other multidimensional data of the school district in the future school year; according to Determine the first eigenvector of uniform dimension, where is the first eigenvector, is the fusion function, is the first query matrix, is the transpose of the first bond matrix, is the first value matrix; according to Determine the second eigenvector of uniform dimension, where is the second eigenvector, is the fusion function, is the second query matrix, is the transpose of the second bond matrix, is the second value matrix.
8. A degree prediction system based on generalized learning vectorization, characterized in that: The system comprises: The multi-dimensional data acquisition module is used to classify school districts according to the degree of school district shortage, determine different types of school districts, and obtain the multi-dimensional data of each school district in the historical school year and the multi-dimensional data of the school district in the future school year; A feature vector integration module, used to integrate the multi-dimensional data of the school districts in the historical school year into a first feature vector of a unified dimension, and to integrate the multi-dimensional data of the school districts in the future school year into a second feature vector of a unified dimension; An objective function definition module, for defining an objective function based on a generalized learning vectorization algorithm, taking the first feature vector of the historical academic year as an input sample and defining the objective function according to the distance between the input sample and the prototype vector; The final XGBoost regression prediction model construction module is used to generate the latest tree through the objective function, take the number of public school enrollments in each school district in the historical school year as the prediction target, take the first feature vector as the input sample, and construct the final XGBoost regression prediction model of each school district type by adding the latest tree; The prediction module is used to input the second feature vector of each school district in the next school year into the final XGBoost regression prediction model of the school district type corresponding to each school district to predict the degree demand, and obtain the predicted number of enrollments for public schools in each school district in the next school year.
9. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 8.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 8.