CN114880806A - New energy automobile sales prediction model parameter optimization method based on particle swarm optimization - Google Patents

New energy automobile sales prediction model parameter optimization method based on particle swarm optimization Download PDF

Info

Publication number
CN114880806A
CN114880806A CN202210578354.9A CN202210578354A CN114880806A CN 114880806 A CN114880806 A CN 114880806A CN 202210578354 A CN202210578354 A CN 202210578354A CN 114880806 A CN114880806 A CN 114880806A
Authority
CN
China
Prior art keywords
particle swarm
new energy
energy automobile
particle
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210578354.9A
Other languages
Chinese (zh)
Inventor
王小璇
邓欣宇
陆杨
黄旭
刘超
杨国朝
徐智
赵长伟
高强伟
刘伟
陈静
王晶
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
State Grid Corp of China SGCC
State Grid Tianjin Electric Power Co Ltd
Chengdong Power Supply Co of State Grid Tianjin Electric Power Co Ltd
Original Assignee
State Grid Corp of China SGCC
State Grid Tianjin Electric Power Co Ltd
Chengdong Power Supply Co of State Grid Tianjin Electric Power Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by State Grid Corp of China SGCC, State Grid Tianjin Electric Power Co Ltd, Chengdong Power Supply Co of State Grid Tianjin Electric Power Co Ltd filed Critical State Grid Corp of China SGCC
Priority to CN202210578354.9A priority Critical patent/CN114880806A/en
Publication of CN114880806A publication Critical patent/CN114880806A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/10Geometric CAD
    • G06F30/17Mechanical parametric or variational design
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • G06F30/27Design optimisation, verification or simulation using machine learning, e.g. artificial intelligence, neural networks, support vector machines [SVM] or training a model
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • G06N20/10Machine learning using kernel methods, e.g. support vector machines [SVM]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/004Artificial life, i.e. computing arrangements simulating life
    • G06N3/006Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0201Market modelling; Market analysis; Collecting market data
    • G06Q30/0202Market predictions or forecasting for commercial activities
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Business, Economics & Management (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Geometry (AREA)
  • Data Mining & Analysis (AREA)
  • Strategic Management (AREA)
  • Finance (AREA)
  • Artificial Intelligence (AREA)
  • Development Economics (AREA)
  • Accounting & Taxation (AREA)
  • Computer Hardware Design (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Medical Informatics (AREA)
  • Mathematical Physics (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Computing Systems (AREA)
  • Economics (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computational Linguistics (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • General Business, Economics & Management (AREA)
  • Marketing (AREA)
  • Game Theory and Decision Science (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention relates to a new energy automobile sales prediction model parameter optimization method based on particle swarm optimization, which comprises the following steps of: step 1, selecting an input variable, and dividing a training set and a test set; step 2, data preprocessing, namely performing normalization processing on input data and output data of a training set; step 3, selecting a kernel function, searching optimal values of C and sigma by using a particle swarm parameter optimization algorithm, calculating the mean square error of training sample data, taking the mean square error as a fitness function of the particle swarm, and initializing the particle swarm; step 4, updating the individual extreme value and the global extreme value, comparing the magnitude of the two extreme values in each iteration process, and updating in real time; and 5, updating the particle flight speed and the current position in real time, and outputting the current optimal parameter value after the optimization is finished when the population iteration reaches the termination condition. The method has the advantages of simple algorithm, high convergence speed, no need of subjective setting of excessive parameters, and capability of improving the training effect and the prediction precision while reducing the error of the model.

Description

New energy automobile sales prediction model parameter optimization method based on particle swarm optimization
Technical Field
The invention belongs to the technical field of prediction model parameter optimization, relates to a new energy automobile sales prediction model parameter optimization method, and particularly relates to a new energy automobile sales prediction model parameter optimization method based on particle swarm optimization.
Background
Because the development process of the new energy automobile in China is short, the data in all aspects are refined and the intensification degree is still relatively insufficient, and the historical data related to the new energy automobile industry is not finished with standardized arrangement and release, the number of effective sample sets required by prediction regression is relatively small, and the prediction problem of monthly sales of the new energy automobile needs to be converted into the machine learning problem of small samples and complex nonlinear historical data. The new energy automobile sales prediction model based on the least square vector machine can extract a large amount of effective information from sample data in any unknown distribution, has the characteristics of minimizing structural risk and maximizing learning and popularization capacity, and is suitable for describing a continuous dynamic development process of a new energy automobile, so that a recursive model is constructed.
However, after the input variables, the training set partition mode and the kernel function form of the model are determined, the performance of the model depends on the selection of model parameters, including a penalty parameter C and a width coefficient σ of the kernel function. In the process of modeling by using the least square support vector machine, the values of the two parameters need to be adjusted manually. In the modeling process, sigma is used for quantifying the correlation level among the support vectors, too large sigma can cause insufficient training of model sample data, and too large sigma can cause excessive risk of the sample data; and C is set too large, so that the punishment of the model on the deviation is too small, sample data learning is insufficient, and the opposite is true. It can be easily seen that the fixed value of the hyper-parameter can make the algorithm too rigid, and the values of the two key parameters can influence the training result and the prediction precision of the model, and the popularization capability and the stability of the model are determined to a great extent. In order to reduce the error of the model and improve the training effect and the prediction precision, the invention researches the parameter optimization method of the traditional least square support vector machine model.
Through searching, the published patent documents which are the same as or similar to the invention are not found.
Disclosure of Invention
The invention aims to overcome the defects of the prior art, and provides a new energy automobile sales prediction model parameter optimization method based on particle swarm optimization, which is simple in algorithm, high in convergence speed, free of subjectively setting too many parameters, and capable of improving the training effect and the prediction precision while reducing the error of the model.
The invention solves the practical problem by adopting the following technical scheme:
a new energy automobile sales prediction model parameter optimization method based on particle swarm optimization comprises the following steps:
step 1, selecting an input variable, and dividing a training set and a test set;
step 2, data preprocessing, namely performing normalization processing on input data and output data of a training set;
step 3, selecting a kernel function, searching optimal values of C and sigma by using a particle swarm parameter optimization algorithm, calculating the mean square error of training sample data, taking the mean square error as a fitness function of the particle swarm, and initializing the particle swarm;
step 4, updating the individual extreme value and the global extreme value, comparing the magnitude of the two extreme values in each iteration process, and updating in real time;
and 5, updating the particle flight speed and the current position in real time, and outputting the current optimal parameter value after the optimization is finished when the population iteration reaches the termination condition.
Moreover, the specific method of step 1 is: compiling a standardization program, selecting monthly sales data of 1-3 periods as input variables of the model, and selecting a predicted value of the 4 th period as an output variable; then, the initial value of monthly sales data in the period of 2-4 is used as an input variable of the model, and the predicted value in the period of 5 is used as network output; according to the rule, a sample data set of a least square vector machine model is formed by analogy;
and dividing the sample data of the first 77 stages into a training set, taking the sample data of the remaining 8 stages as a test set, and constructing an optimal machine learning model fitting x (t).
Moreover, the specific formula of step 2 is as follows:
Figure BDA0003662907730000031
the present invention normalizes the input data using the mapminmax function.
The specific method of step 3 is:
and selecting the radial basis kernel function as a kernel function form of the new energy automobile holding quantity prediction model. The kernel function is generally defined as the euclidean distance from any point x in space to a central point x', and is written as:
Figure BDA0003662907730000032
wherein x' is the center point;
σ — Bandwidth parameter.
Moreover, the specific method of the step 4 is as follows:
boundary conditions are set for the position of the particles: the kernel penalty parameter cmax is set to 100, the minimum to 1, the width coefficient σ max of the kernel function to 500, and the minimum to 0.001.
Moreover, the specific method of the step 5 is as follows:
assume that there is a population of m particles in a d-dimensional space, where the position of a single particle can be expressed as follows:
x i =(x i1 ,x i2 ,...,x id ),i=1,2,...,m
the particle flight velocity can be expressed as:
v i =(v i1 ,v i2 ,...,v id ),i=1,2,...,m
the optimal position searched by the ith particle can be expressed as:
p i =(p i1 ,p i2 ,...,p id ),i=1,2,...,m
the optimal position searched by the current particle population
p g =(p g1 ,p g2 ,...,p gd ),i=1,2,...,m
In the PSO algorithm, the update formula for particle velocity and position is as follows:
v id =ωv id +c 1 r 1 (p id -x id )+c 2 r 2 (p gd -x id )
x id =v id +x id
in the formula r 1 ,r 2 ——[0,1]A random number of intervals;
c 1 -the step size of the particle flying to its optimal position;
c 2 -step size of the particles flying to the optimal position of the whole population;
ω -inertial weight coefficient;
searching extreme values and extreme points, calculating the average fitness of each generation of population, finishing iterative optimization, and outputting the optimal values of a kernel penalty parameter C and the width coefficient sigma of the kernel function.
Further, the following steps are included after the step 5:
and 6, verifying the validity of the model through the test set.
The specific method of step 6 is:
inputting the normalized data of the test set into a least square support vector machine model which is trained and has fixed parameters at present, calculating relevant target parameters, carrying out reverse normalization on the result to obtain a predicted value of a final research object, calculating prediction precision, outputting if the predicted value meets the expected requirement, otherwise, returning to the particle swarm optimization algorithm for retraining until the predicted result meets the expectation.
The invention has the advantages and beneficial effects that:
1. the invention provides a new energy automobile sales prediction model parameter optimization method based on particle swarm optimization, and in consideration of the defect of a new energy automobile sales prediction model based on a least square vector machine in parameter selection, the particle swarm algorithm is selected to optimize a bandwidth parameter sigma and a penalty coefficient C, the mode of selecting parameters in an SVM model is converted to the global search problem of a specific space, the average error of a test sample is used as the basis of algorithm ending, automatic parameter optimization is realized, the complex and subjective parameter adjusting process is avoided, the algorithm is simple, and the convergence speed is high.
2. According to the invention, the particle swarm optimization is adopted, the position and speed of the particles are initialized, and an iterative optimization method is adopted, so that the stability and accuracy of the model are improved, and the prediction precision and the training effect are improved to a certain extent by comparing the errors of the parameter optimization model and the original model. Moreover, as time goes on, the input vector of the prediction model can be continuously updated according to the processing method provided by the invention, thereby realizing rolling prediction and saving a complex repeated calculation process for subsequent model application.
Drawings
FIG. 1 is a modeling flow chart of a new energy automobile sales prediction model based on particle swarm optimization and a least square vector machine according to an embodiment of the invention;
fig. 2 is a schematic diagram of particle searching conditions of a particle swarm optimization model according to an embodiment of the present invention;
fig. 3 is a new energy automobile monthly sales prediction curve diagram based on particle swarm optimization and a least square support vector machine according to the embodiment of the invention.
Detailed Description
The embodiments of the invention will be described in further detail below with reference to the accompanying drawings:
a new energy automobile sales prediction model parameter optimization method based on particle swarm optimization is shown in figure 1 and comprises the following steps:
step 1, selecting an input variable, and dividing a training set and a test set;
the specific method of the step 1 comprises the following steps: the method comprises the steps of compiling a standardization program in an MATLAB2018b environment, predicting a numerical value of a fourth month by adopting time series historical sales data of the previous three months, namely selecting monthly sales data of 1-3 periods as an input variable of a model, and selecting a predicted value of the 4 th period as an output variable; then, the initial value of monthly sales data in the period of 2-4 is used as an input variable of the model, and the predicted value in the period of 5 is used as network output; and (5) forming a sample data set of the least square vector machine model by analogy according to the rule.
And dividing the first 77-stage sample data into a training set, taking the residual 8-stage sample data as a test set, and constructing an optimal machine learning model capable of better fitting x (t).
Step 2, data preprocessing, in order to accelerate the training speed and eliminate the influence of the dimension on the prediction result, normalizing the input data and the output data of the training set:
the specific formula is as follows:
Figure BDA0003662907730000061
the present invention normalizes the input data using the mapminmax function.
Step 3, selecting a kernel function, searching optimal values of C and sigma by using a particle swarm parameter optimization algorithm, calculating the mean square error of training sample data, taking the mean square error as a fitness function of the particle swarm, and initializing the particle swarm including random position and speed;
the specific method of the step 3 comprises the following steps:
the method selects the radial basis kernel function as the kernel function form of the new energy automobile holding capacity prediction model. The kernel function is generally defined as the euclidean distance from any point x to a central point x' in space, and is written as:
Figure BDA0003662907730000062
wherein x' is the center point;
σ -Bandwidth parameter.
The invention sets the group size to be 20, and the local searching capability c of the parameter 1 Empirical value of 1.5, global search capability of parameter c 2 The value is 1.7; the maximum number of iterations is set to 200; the value of the inertial weight factor omega is 0.9. Generating initial particles and an initialization speed by using a rand function, randomly generating a population, calculating initial fitness, solving the predicted values of a training set and a test set by using a simlssvm function, and taking the mean square error calculated by the predicted values of the test set as the fitness value.
Step 4, updating the individual extreme value and the global extreme value, comparing the magnitude of the two extreme values in each iteration process, and updating in real time;
the specific method of the step 4 comprises the following steps:
in order to reduce unnecessary search, improve optimizing efficiency and control the operation time of the algorithm, the invention sets boundary conditions for the positions of particles: the kernel penalty parameter Cmax is set to 100, the min is set to 1, the width coefficient σ max of the kernel function is set to 500, and the min is set to 0.001.
Step 5, updating the flight speed and the current position of the particles in real time, finishing optimization when the population iteration reaches the termination condition, and outputting the current optimal parameter value;
the specific method of the step 5 comprises the following steps:
assume that there is a population of m particles in a d-dimensional space, where the position of a single particle can be expressed as follows:
x i =(x i1 ,x i2 ,...,x id ),i=1,2,...,m
the particle flight velocity can be expressed as:
v i =(v i1 ,v i2 ,...,v id ),i=1,2,...,m
the optimal position searched by the ith particle can be expressed as:
p i =(p i1 ,p i2 ,...,p id ),i=1,2,...,m
the optimal position searched by the current particle population
p g =(p g1 ,p g2 ,...,p gd ),i=1,2,...,m
In the PSO algorithm, the update formula for particle velocity and position is as follows:
v id =ωv id +c 1 r 1 (p id -x id )+c 2 r 2 (p gd -x id )
x id =v id +x id
in the formula r 1 ,r 2 ——[0,1]A random number of intervals;
c 1 to which the particles flyStep length of the optimal position;
c 2 -step size of the particles flying to the optimal position of the whole population;
ω -inertial weight coefficient.
A specific two-dimensional spatial particle search scenario is shown in fig. 2.
Searching extreme values and extreme points, calculating the average fitness of each generation of population, finishing iterative optimization, and outputting the optimal values of a kernel penalty parameter C and the width coefficient sigma of the kernel function.
And 6, verifying the validity of the model through the test set.
Inputting the normalized data of the test set into a least square support vector machine model which is trained and has fixed parameters at present, calculating relevant target parameters, carrying out reverse normalization on the result to obtain a predicted value of a final research object, calculating prediction precision, outputting if the predicted value meets the expected requirement, otherwise, returning to the particle swarm optimization algorithm for retraining until the predicted result meets the expectation.
The invention is further illustrated by the following specific examples:
in order to realize the prediction research of the monthly sales volume of the new energy automobile, the model simulation analysis based on the Matlab2018b environment is performed from the selection and the pretreatment of the input data, so that the monthly sales volume prediction model of the new energy automobile based on the two-multiplication vector machine is constructed, and the result shows that the constructed model can meet the prediction precision requirement of the new energy automobile in the early development stage. However, considering that the model still has defects in parameter selection, the invention selects the particle swarm optimization to optimize the bandwidth parameter sigma and the penalty coefficient C of the prediction model. The modeling process of the new energy automobile monthly sales prediction model based on the particle swarm optimization least square support vector machine is as follows:
(1) an input variable is selected and the training set and the test set are partitioned.
Considering that the invention aims to construct a monthly sales forecasting model of the new energy automobile, although factors influencing sales are numerous, the influence factors are not likely to change greatly in a short period, such as a month, and the influence is likely to have a hysteresis effect. Secondly, considering the data acquireability problem, the data investigation related to the new energy automobile industry is very complicated, and the statistical data is difficult to be sorted and released every month; thirdly, selecting historical sales data as independent variables to predict future sales conditions, and also avoiding subjective influence factor analysis to a certain extent. Fourthly, the new energy automobile industry is developed to the present, the market is approximately in a complete competitive game stage, the competitive relationship of multi-party benefit agents is basically fixed, the fluctuation of the market capacity melon-score ratio is not large, objective historical data comprehensively shows the influence of various factors, therefore, the historical data serving as input variables can objectively describe the evolution relationship between prediction and the time process, the prediction result has relatively large reference value, and the deviation tends to be stable. In conclusion, in a sound market environment, the new energy automobile monthly sales volume model based on the time series historical data has the characteristics of simplicity and convenience in operation and high efficiency in solving.
According to the statistical rule, through repeated tests, the numerical value of the fourth month is predicted by adopting the time sequence value of the first three months, namely the predicted value of the 1-3 th and the 4 th months is selected as an output variable; then, taking the initial value of the 2-4 period as the input variable of the model, and taking the predicted value of the 5 th period as the network output; and (5) forming a sample data set of the least square vector machine model by analogy according to the rule. And dividing the first 77-stage sample data into a training set, and taking the residual 8-stage sample data as a test set, thereby concentrating time sequence information and constructing an optimal machine learning model which can better fit x (t).
(2) And (4) preprocessing data, namely normalizing input data and output data of a training set in order to accelerate the training speed and eliminate the influence of the dimension on a prediction result. The specific formula is as follows:
Figure BDA0003662907730000101
(3) and selecting a kernel function, searching the optimal values of C and sigma by using a particle swarm parameter optimization algorithm, calculating the mean square error of the training sample data, taking the mean square error as a fitness function of the particle swarm, and initializing the particle swarm.
The method selects the radial basis kernel function as a kernel function form of the new energy automobile holding capacity prediction model. The RBF kernel function is generally defined as the euclidean distance from any point x to a central point x' in space, and is written as:
Figure BDA0003662907730000102
wherein x' is the center point;
σ — Bandwidth parameter.
K (x, x ') has a unique maximum value at the center point x', and as the Euclidean distance | | x-x '| | increases, K (x, x') rapidly decreases to 0. Therefore, only a small portion of a given input vector near the center will be activated. When x is far from the center point x ', the value of K (x, x') is small and negligible. Through the processing, the least square vector machine can locally and quickly approach to network learning, and the defect of poor tightness of the RBF function is made up to a certain extent.
(4) And updating the individual extremum and the global extremum. And in each iteration process, comparing the magnitude of the two polar values, and updating in real time.
(5) And updating the flight speed and the current position of the particles in real time. When the population iteration reaches the termination condition, the optimization is finished, and the optimal values of the current bandwidth parameter sigma and the penalty coefficient C are output.
(6) The model validity is verified by the test set. Inputting the normalized data of the test set into a least square support vector machine model which is trained and has fixed parameters at present, calculating relevant target parameters, carrying out reverse normalization on the result to obtain a predicted value of a final research object, calculating prediction precision, outputting if the predicted value meets the expected requirement, otherwise, returning to the particle swarm optimization algorithm for retraining until the predicted result meets the expectation.
The time series rolling prediction model based on the PSO-LSSVM is established according to the steps by combining the actual situation of the industrial development of the new energy automobile.
For the prediction model of the invention, the population size is 20, c 1 And c 2 The values are 1.5 and 1.7 according to experience; the maximum number of iterations is set to 200; the value of the inertial weight factor omega is 0.9. In order to reduce unnecessary search, improve optimizing efficiency and control the operation time of the algorithm, the invention sets boundary conditions for the positions of particles: the kernel penalty parameter Cmax is set to 100, the min is set to 1, the width coefficient σ max of the kernel function is set to 500, and the min is set to 0.001.
The modeling process of the new energy automobile monthly sales forecasting model based on the PSO-LSSVM is shown in figure 1, and the detailed experimental results are as follows:
according to the invention, a standardized program is compiled in an MATLAB2018b environment, and specific numerical values of the prediction results of the new energy automobile monthly sales prediction model based on the PSO-LSSVM are shown in Table 1. The result shows that the average relative error of the PSO-LSSVM prediction model is 7.83%, the root mean square error is 1.27, the model performance is good, and the prediction precision requirement of the new energy automobile in the early development stage can be met. In this embodiment, the relative error is used as a model evaluation index, and the comparison of the obtained prediction error is shown in table 1.
Table 1 new energy vehicle monthly sales prediction result analysis table based on particle swarm optimization least square support vector machine
Figure BDA0003662907730000111
Figure BDA0003662907730000121
The prediction results plotted using the plot function are shown in fig. 3.
2. Presentation of predicted effects
The comparison of the new energy automobile monthly sales model prediction results based on the LSSVM and the PSO-LSSVM is shown in Table 2.
As can be seen, the PSO-LSSVM model constructed by the embodiment has universality and dynamic property. Along with the time, the input vector of the prediction model can be continuously updated, the rolling prediction is realized, the prediction precision is improved, and meanwhile, the complex repeated calculation process is saved for the subsequent model application. Through comparative analysis of the prediction results, it is easy to find that the prediction error of the PSO-LSSVM model is reduced by about 2% compared with the traditional LSSVM model, and the prediction precision is obviously improved. And because the parameters of the traditional LSSVM prediction model are fixed and depend on manual selection, the time consumption is long and relatively complex, and the PSO algorithm greatly simplifies the parameter adjusting process. Therefore, the optimization strategy provided by the invention has certain effectiveness.
Table 2 comparison table of monthly sales model prediction results of new energy vehicle
Figure BDA0003662907730000122
The working principle of the invention is as follows:
when the least square support vector machine algorithm is adopted to predict monthly sales data of the new energy automobile, the verified model has excellent performance, but in the aspect of parameter selection, values of two parameters need to be adjusted manually. The fixed value of the hyper-parameter can make the algorithm be rigid, and the values of the two key parameters can influence the training result and the prediction precision of the model, and determine the popularization capability and the stability of the model to a great extent.
The Particle Swarm Optimization (PSO) adopted by the invention is an intelligent algorithm for solving the global optimal solution of the optimization problem. The method searches for a global optimal solution by simulating intelligent competition and cooperation behavior of bird groups in the foraging process. In the process of optimizing parameters by the particle swarm optimization algorithm, the particle swarm has memory, the best historical positions of the particles can be mutually transmitted according to the peer experience and the adaptive value, the speed of the particles is updated while the relevant position information changes, the real-time dynamic adjustment of the positions of the particles is completed, and when the preset condition of the model is reached, the default algorithm obtains the optimal solution. The particle swarm optimization algorithm is simple, the convergence speed is high, excessive parameters do not need to be set subjectively, the advantages are remarkable, and the training effect and the prediction precision are improved while the error of the model is reduced.
The invention relates to a method for optimizing parameters of a traditional least square support vector machine model, which comprises the following steps: selecting an input variable, and dividing a training set and a test set; data preprocessing, namely normalizing input data and output data of a training set in order to accelerate the training speed and eliminate the influence of dimension on a prediction result; selecting a kernel function, searching optimal values of C and sigma by using a particle swarm parameter optimization algorithm, calculating the mean square error of training sample data, taking the mean square error as a fitness function of a particle swarm, and initializing the particle swarm; and updating the individual extremum and the global extremum. In each iteration process, comparing the magnitude of the two pole values and updating in real time; and updating the particle flight speed and the current position in real time. When the population iteration reaches the termination condition, finishing the optimization, and outputting the current optimal parameter value; the model validity is verified by the test set. Inputting the normalized data of the test set into a least square support vector machine model which is trained and has fixed parameters at present, calculating relevant target parameters, carrying out reverse normalization on the result to obtain a predicted value of a final research object, calculating prediction precision, outputting if the predicted value meets the expected requirement, otherwise, returning to the particle swarm optimization algorithm for retraining until the predicted result meets the expectation. Through verification, the method reduces the error of the model, and improves the training effect and the prediction precision.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

Claims (8)

1. A new energy automobile sales prediction model parameter optimization method based on particle swarm optimization is characterized by comprising the following steps: the method comprises the following steps:
step 1, selecting an input variable, and dividing a training set and a test set;
step 2, data preprocessing, namely performing normalization processing on input data and output data of a training set;
step 3, selecting a kernel function, searching optimal values of C and sigma by using a particle swarm parameter optimization algorithm, calculating the mean square error of training sample data, taking the mean square error as a fitness function of the particle swarm, and initializing the particle swarm;
step 4, updating the individual extreme value and the global extreme value, comparing the magnitude of the two extreme values in each iteration process, and updating in real time;
and 5, updating the particle flight speed and the current position in real time, and outputting the current optimal parameter value after the optimization is finished when the population iteration reaches the termination condition.
2. The new energy automobile sales prediction model parameter optimization method based on particle swarm optimization according to claim 1, characterized in that: the specific method of the step 1 comprises the following steps: compiling a standardization program, selecting monthly sales data of 1-3 periods as input variables of the model, and selecting a predicted value of the 4 th period as an output variable; then, the initial value of monthly sales data in the period of 2-4 is used as an input variable of the model, and the predicted value in the period of 5 is used as network output; according to the rule, sequentially analogizing to form a sample data set of a least square vector machine model;
and dividing the sample data of the first 77 stages into a training set, taking the sample data of the remaining 8 stages as a test set, and constructing an optimal machine learning model fitting x (t).
3. The new energy automobile sales prediction model parameter optimization method based on particle swarm optimization according to claim 1, characterized in that: the specific formula of step 2 is as follows:
Figure FDA0003662907720000021
the present invention normalizes the input data using the mapminmax function.
4. The new energy automobile sales prediction model parameter optimization method based on particle swarm optimization according to claim 1, characterized in that: the specific method of the step 3 comprises the following steps:
and selecting the radial basis kernel function as a kernel function form of the new energy automobile holding quantity prediction model. The kernel function is generally defined as the euclidean distance from any point x in space to a central point x', and is written as:
Figure FDA0003662907720000022
wherein x' is the center point;
σ — Bandwidth parameter.
5. The new energy automobile sales prediction model parameter optimization method based on particle swarm optimization according to claim 1, characterized in that: the specific method of the step 4 comprises the following steps:
boundary conditions are set for the position of the particles: the kernel penalty parameter Cmax is set to 100, the min is set to 1, the width coefficient σ max of the kernel function is set to 500, and the min is set to 0.001.
6. The new energy automobile sales prediction model parameter optimization method based on particle swarm optimization according to claim 1, characterized in that: the specific method of the step 5 comprises the following steps:
assume that there is a population of m particles in a d-dimensional space, where the position of a single particle can be expressed as follows:
x i =(x i1 ,x i2 ,...,x id ),i=1,2,...,m
the particle flight velocity can be expressed as:
v i =(v i1 ,v i2 ,...,v id ),i=1,2,...,m
the optimal position searched by the ith particle can be expressed as:
p i =(p i1 ,p i2 ,...,p id ),i=1,2,...,m
the optimal position searched by the current particle population
p g =(p g1 ,p g2 ,...,p gd ),i=1,2,...,m
In the PSO algorithm, the update formula for particle velocity and position is as follows:
v id =ωv id +c 1 r 1 (p id -x id )+c 2 r 2 (p gd -x id )
x id =v id +x id
in the formula r 1 ,r 2 ——[0,1]A random number of intervals;
c 1 -the step size of the particle flying to its optimal position;
c 2 -step size of the particles flying to the optimal position of the whole population;
ω -inertial weight coefficient;
searching extreme values and extreme points, calculating the average fitness of each generation of population, finishing iterative optimization, and outputting the optimal values of a kernel penalty parameter C and the width coefficient sigma of the kernel function.
7. The new energy automobile sales prediction model parameter optimization method based on particle swarm optimization according to claim 1, characterized in that: the following steps are also included after the step 5:
and 6, verifying the validity of the model through the test set.
8. The new energy automobile sales prediction model parameter optimization method based on particle swarm optimization according to claim 1, characterized in that: the specific method of the step 6 comprises the following steps:
inputting the normalized data of the test set into a least square support vector machine model which is trained and has fixed parameters at present, calculating relevant target parameters, carrying out reverse normalization on the result to obtain a predicted value of a final research object, calculating prediction precision, outputting if the predicted value meets the expected requirement, otherwise, returning to the particle swarm optimization algorithm for retraining until the predicted result meets the expectation.
CN202210578354.9A 2022-05-25 2022-05-25 New energy automobile sales prediction model parameter optimization method based on particle swarm optimization Pending CN114880806A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210578354.9A CN114880806A (en) 2022-05-25 2022-05-25 New energy automobile sales prediction model parameter optimization method based on particle swarm optimization

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210578354.9A CN114880806A (en) 2022-05-25 2022-05-25 New energy automobile sales prediction model parameter optimization method based on particle swarm optimization

Publications (1)

Publication Number Publication Date
CN114880806A true CN114880806A (en) 2022-08-09

Family

ID=82677116

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210578354.9A Pending CN114880806A (en) 2022-05-25 2022-05-25 New energy automobile sales prediction model parameter optimization method based on particle swarm optimization

Country Status (1)

Country Link
CN (1) CN114880806A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116029329A (en) * 2023-02-15 2023-04-28 武汉工程大学 Anxiety mileage value prediction method, anxiety mileage value prediction device, anxiety mileage value prediction system and storage medium
CN117744283A (en) * 2024-02-20 2024-03-22 陕西空天信息技术有限公司 Design method, device, equipment and computer storage medium for compressor
CN117828299A (en) * 2024-01-03 2024-04-05 佛山职业技术学院 Tire wear degree detection and calculation system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116029329A (en) * 2023-02-15 2023-04-28 武汉工程大学 Anxiety mileage value prediction method, anxiety mileage value prediction device, anxiety mileage value prediction system and storage medium
CN117828299A (en) * 2024-01-03 2024-04-05 佛山职业技术学院 Tire wear degree detection and calculation system
CN117828299B (en) * 2024-01-03 2024-06-07 佛山职业技术学院 Tire wear degree detection and calculation system
CN117744283A (en) * 2024-02-20 2024-03-22 陕西空天信息技术有限公司 Design method, device, equipment and computer storage medium for compressor
CN117744283B (en) * 2024-02-20 2024-04-30 陕西空天信息技术有限公司 Design method, device, equipment and computer storage medium for compressor

Similar Documents

Publication Publication Date Title
CN114880806A (en) New energy automobile sales prediction model parameter optimization method based on particle swarm optimization
CN108133258B (en) Hybrid global optimization method
CN112700060B (en) Station terminal load prediction method and prediction device
CN112632860B (en) Power transmission system model parameter identification method based on reinforcement learning
CN111173573A (en) Identification method for power object model of steam turbine regulating system
CN114781692B (en) Short-term power load prediction method and device and electronic equipment
CN111709511A (en) Harris eagle optimization algorithm based on random unscented Sigma point variation
CN111240796B (en) Load balancing scheduling method based on improved MMAS
CN113391894A (en) Optimization method of optimal hyper-task network based on RBP neural network
CN113255873A (en) Clustering longicorn herd optimization method, system, computer equipment and storage medium
CN109840551A (en) A method of the optimization random forest parameter for machine learning model training
CN107016239B (en) steam turbine valve flow characteristic analysis method
CN113032367A (en) Dynamic load scene-oriented cross-layer configuration parameter collaborative tuning method and system for big data system
CN106296434B (en) Grain yield prediction method based on PSO-LSSVM algorithm
CN111008790A (en) Hydropower station group power generation electric scheduling rule extraction method
CN113177673A (en) Air conditioner cold load prediction optimization method, system and equipment
CN113673679A (en) Cut tobacco drying process parameter selection method based on particle swarm optimization neural network
CN110222824B (en) Intelligent algorithm model autonomous generation and evolution method, system and device
CN112733301A (en) Six-dimensional torque sensor gravity compensation method and system based on neural network
CN114330119A (en) Deep learning-based pumped storage unit adjusting system identification method
CN118192472A (en) Improved sparrow optimization method for scheduling problem of flexible job shop
CN108803330A (en) A kind of learning aid optimization sliding-mode control based on personality coefficient adjustment
CN113240094A (en) SVM-based LSTM hyper-parameter optimization method, system, medium and device
CN114936413B (en) Ship body appearance optimization neural network modeling method and ship body appearance optimization method
CN110047088A (en) A kind of HT-29 image partition method based on improvement learning aid optimization algorithm

Legal Events

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