+

CN116468181A - Improved whale-based optimization method - Google Patents

Improved whale-based optimization method Download PDF

Info

Publication number
CN116468181A
CN116468181A CN202310463413.2A CN202310463413A CN116468181A CN 116468181 A CN116468181 A CN 116468181A CN 202310463413 A CN202310463413 A CN 202310463413A CN 116468181 A CN116468181 A CN 116468181A
Authority
CN
China
Prior art keywords
whale
optimal
support vector
individual
vector machine
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
CN202310463413.2A
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.)
Shandong Technology and Business University
Original Assignee
Shandong Technology and Business University
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 Shandong Technology and Business University filed Critical Shandong Technology and Business University
Priority to CN202310463413.2A priority Critical patent/CN116468181A/en
Publication of CN116468181A publication Critical patent/CN116468181A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2474Sequence data queries, e.g. querying versioned data
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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]
    • 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)
  • Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Human Resources & Organizations (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Data Mining & Analysis (AREA)
  • Economics (AREA)
  • General Engineering & Computer Science (AREA)
  • Fuzzy Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Tourism & Hospitality (AREA)
  • Quality & Reliability (AREA)
  • Operations Research (AREA)
  • Probability & Statistics with Applications (AREA)
  • Marketing (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Game Theory and Decision Science (AREA)
  • Databases & Information Systems (AREA)
  • Development Economics (AREA)
  • General Business, Economics & Management (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

一种基于改进鲸鱼优化方法,属于大数据技术领域。S1搜集样本数据并对其进行归一化,将数据分为训练集与测试集;S2用改进的鲸鱼优化算法对支持向量机的核参数与惩罚因子进行优化,建立基于改进鲸鱼优化算法的支持向量机预测模型;S3用训练集样本对支持向量机预测模型进行训练,得到最优核参数和惩罚因子的支持向量机预测模型;S4将测试集样本特征导入基于最优核参数和惩罚因子的支持向量机预测模型中,得到数据的预测值;S5用RMSE、MAE和MAPE对模型预测效果进行评价。本发明提高了算法的寻优速度与寻优精度;在鲸鱼算法中加入了萤火虫扰动策略,进一步提高算法跳出局部最优的能力,大大提高了算法的寻优精度。

An optimization method based on improved whales belongs to the field of big data technology. S1 collects sample data and normalizes it, and divides the data into training set and test set; S2 uses the improved whale optimization algorithm to optimize the kernel parameters and penalty factors of the support vector machine, and establishes the support vector machine prediction model based on the improved whale optimization algorithm; S3 uses the training set samples to train the support vector machine prediction model, and obtains the support vector machine prediction model with optimal kernel parameters and penalty factors; MAE and MAPE evaluate the prediction effect of the model. The invention improves the optimization speed and optimization accuracy of the algorithm; adds the firefly disturbance strategy to the whale algorithm, further improves the ability of the algorithm to jump out of the local optimum, and greatly improves the optimization accuracy of the algorithm.

Description

一种基于改进鲸鱼优化方法An Optimization Method Based on Improved Whale

技术领域technical field

一种基于改进鲸鱼优化方法,属于大数据技术领域。An optimization method based on improved whales belongs to the field of big data technology.

背景技术Background technique

随着群智能优化算法的发展,学者们将一些优化算法用于对神经网络、支持向量机与极限学习机等一些预测模型的参数进行优化。常见的群智能优化算法有粒子群算法、蚁群优化算法、果蝇优化算法、鲸鱼优化算法、以及麻雀搜索算法等一些性能良好的新型优化算法。鲸鱼算法是Mirjalili等于2016年提出的一种模拟鲸鱼群体捕食行为的启发式优化算法,捕食行为称为泡泡网捕食方法,分为搜寻猎物、包围猎物、泡网攻击3个阶段。算法简练易于实现,且对目标函数条件要求宽松,参数控制较少。With the development of swarm intelligence optimization algorithms, scholars have used some optimization algorithms to optimize the parameters of some prediction models such as neural networks, support vector machines, and extreme learning machines. Common swarm intelligence optimization algorithms include particle swarm optimization algorithm, ant colony optimization algorithm, fruit fly optimization algorithm, whale optimization algorithm, and some new optimization algorithms with good performance, such as sparrow search algorithm. The whale algorithm is a heuristic optimization algorithm proposed by Mirjalili et al. in 2016 to simulate the predation behavior of whale groups. The predation behavior is called the bubble net predation method, which is divided into three stages: searching for prey, surrounding prey, and bubble net attack. The algorithm is concise and easy to implement, and has loose requirements on the objective function conditions and less parameter control.

鲸鱼算法与其他群智能算法一样,在求解复杂组合优化问题上,该算法也存在一些不足,比如求解精度低、容易陷入局部最优等缺点。Like other swarm intelligence algorithms, the whale algorithm also has some shortcomings in solving complex combinatorial optimization problems, such as low solution accuracy and easy to fall into local optimum.

发明内容Contents of the invention

本发明要解决的技术问题是:克服现有技术的不足,提供一种能解决单一预测模型在数据预测中难预测的高度非线性、随机性的复杂负荷序列,提高负荷预测的精度的基于改进鲸鱼优化方法。The technical problem to be solved by the present invention is to overcome the deficiencies of the prior art, provide a highly nonlinear and random complex load sequence that is difficult to predict in data forecasting by a single forecasting model, and improve the accuracy of load forecasting based on an improved whale optimization method.

本发明解决其技术问题所采用的技术方案是:该基于改进鲸鱼优化方法,其特征在于:包括如下步骤:The technical scheme that the present invention solves its technical problem adopts is: this optimization method based on improved whale, it is characterized in that: comprise the steps:

S1 搜集样本数据并对其进行归一化,将数据分为训练集与测试集;S1 collects sample data and normalizes it, and divides the data into training set and test set;

S2用改进的鲸鱼优化算法对支持向量机的核参数与惩罚因子进行优化,建立基于改进鲸鱼优化算法的支持向量机预测模型;S2 uses the improved whale optimization algorithm to optimize the kernel parameters and penalty factors of the support vector machine, and establishes a support vector machine prediction model based on the improved whale optimization algorithm;

S3用训练集样本对支持向量机预测模型进行训练,得到最优核参数和惩罚因子的支持向量机预测模型;S3 uses the training set samples to train the support vector machine prediction model, and obtains the support vector machine prediction model with optimal kernel parameters and penalty factors;

S4将测试集样本特征导入基于最优核参数和惩罚因子的支持向量机预测模型中,得到数据的预测值;S4 imports the sample features of the test set into the support vector machine prediction model based on the optimal kernel parameters and penalty factors to obtain the predicted value of the data;

S5用RMSE、MAE和MAPE对模型预测效果进行评价。S5 uses RMSE, MAE and MAPE to evaluate the prediction effect of the model.

优选的,所述的归一化处理方法如下:Preferably, the normalization processing method is as follows:

;

其中,为标准化后的值,/>为原始数据,/>和/>表示样本数据的最大值和最小值。in, is the normalized value, /> for raw data, /> and /> Indicates the maximum and minimum values of the sample data.

优选的,利用改进的鲸鱼优化算法来优化支持向量机的核参数和惩罚因子的方法,包括如下步骤:Preferably, the method for optimizing the kernel parameters and the penalty factor of the support vector machine using the improved whale optimization algorithm comprises the following steps:

S3.1参数初始化;S3.1 parameter initialization;

S3.2利用混沌映射策略产生个体的初始位置;S3.2 Use the chaotic mapping strategy to generate the initial position of the individual;

S3.3计算每只个体的适应度,并找出最优适应度的个体;S3.3 Calculate the fitness of each individual and find out the individual with the best fitness;

S3.4鲸鱼优化算法的位置更新;S3.4 Position update of whale optimization algorithm;

S3.5萤火虫扰动策略:计算适应度,利用正余弦扰动策略来更新当前最优位置,计算位置更新后的最优个体适应度,并与猎物当前最优适应度值进行比较,若更新后的个体适应度值优于猎物,则以适应度值更优的个体位置作为新的最优位置;S3.5 Firefly disturbance strategy: calculate the fitness, use the sine-cosine disturbance strategy to update the current optimal position, calculate the optimal individual fitness after the position update, and compare it with the current optimal fitness value of the prey, if the updated individual fitness value is better than the prey, then use the individual position with a better fitness value as the new optimal position;

S3.6判断是否达到最大迭代次数,若已经达到则到步骤S3.7,否则到步骤S3.3;S3.6 Judging whether the maximum number of iterations has been reached, if it has been reached, go to step S3.7, otherwise go to step S3.3;

S3.7导出最优鲸鱼位置,即得到支持向量机的最优核参数和惩罚因子。S3.7 Deriving the optimal whale position, that is, obtaining the optimal kernel parameters and penalty factors of the support vector machine.

优选的,所述方法还包括,Tent混沌映射为:Preferably, the method also includes that the Tent chaotic map is:

;

其中,k为当前迭代次数,为了使种群初始化具有随机性,Among them, k is the current number of iterations, in order to make the population initialization random, .

优选的,所述方法还包括,计算以内部K折交叉验证法计算出极限学习机的准确度ACC:Preferably, the method also includes calculating the accuracy ACC of the extreme learning machine with the internal K-fold cross-validation method:

;

其中,表示每一折数据上计算获得的准确度。in, Indicates the accuracy calculated on each fold of data.

优选的,所述方法还包括,在D维空间内每个鲸鱼的位置为:Preferably, the method also includes, the position of each whale in the D-dimensional space is:

.

优选的,所述方法还包括,向着最优位置鲸鱼游动,位置更新公式如下:Preferably, the method further includes, swimming towards the optimal position of the whale, and the position update formula is as follows:

;

;

非线性收敛因子为:The nonlinear convergence factor is:

;

;

其中,为当前最优的鲸鱼位置,/>、/>为/>的随机数,t表示当前迭代次数,T表示最大迭代次数;in, is the current optimal whale position, /> , /> for /> The random number of , t represents the current number of iterations, and T represents the maximum number of iterations;

向着随机鲸鱼的位置游动该鲸鱼的位置更新如下:Swim towards the position of a random whale The position of the whale is updated as follows:

;

其中,为当前群体中随机选择的鲸鱼的位置,当|A<1|时,鲸鱼选择向着最优个体游动,当|(A≥1)|时,鲸鱼选择向着随机个体游动。in, is the position of the randomly selected whale in the current group, when |A<1|, the whale chooses to swim towards the optimal individual, and when |(A≥1)|, the whale chooses to swim towards the random individual.

优选的,所述方法还包括,使用气泡网时,鲸鱼的位置更新如下:Preferably, the method also includes, when using the bubble net, the whale's position is updated as follows:

;

其中,为常数,/>为均匀分布在/>内的随机数;/>in, is a constant, /> for uniform distribution over /> random number inside; /> ;

在每次行动之前,每只鲸鱼都会利用自适应阈值来判断选择包围猎物还是使用气泡网来驱赶猎物,其位置更新如下:Before each action, each whale will use the adaptive threshold to judge whether to choose to surround the prey or use the bubble net to drive the prey, and its position is updated as follows:

.

优选的,萤火虫的相对荧光亮度为:Preferably, the relative fluorescence brightness of fireflies is:

;

其中,为萤火虫最大荧光亮度,/>为光强吸收系数,/>为萤火虫i与j之间的欧式距离;in, is the maximum fluorescence brightness of fireflies, /> is the light intensity absorption coefficient, /> is the Euclidean distance between fireflies i and j;

萤火虫的吸引力的公式表达式为:The formula expression for the attraction of fireflies is:

;

其中,为最大吸引度。in, is the maximum attractiveness.

优选的,萤火虫位置更新为:Preferably, the position of the firefly is updated as:

;

其中,∈/>为步长因子;/>为/>上服从正态分布的随机数。in, ∈/> is the step factor; /> for /> random numbers that follow a normal distribution.

与现有技术相比,本发明所具有的有益效果是:Compared with prior art, the beneficial effect that the present invention has is:

本基于改进鲸鱼优化方法在鲸鱼优化算法的寻优过程中加入了非线性收敛因子与自适应阈值、自适应权重,平衡了算法的全局搜索与局部搜索,提高了算法的寻优速度与寻优精度;在鲸鱼算法中加入了萤火虫扰动策略,进一步提高算法跳出局部最优的能力,大大提高了算法的寻优精度。Based on the improved whale optimization method, the nonlinear convergence factor, adaptive threshold and adaptive weight are added in the optimization process of the whale optimization algorithm, which balances the global search and local search of the algorithm, and improves the optimization speed and optimization accuracy of the algorithm; the firefly disturbance strategy is added to the whale algorithm to further improve the algorithm's ability to jump out of the local optimum, and greatly improve the algorithm's optimization accuracy.

附图说明Description of drawings

图1为改进鲸鱼优化算法来优化数据预测的方法的流程图;Fig. 1 is the flowchart of the method for optimizing data prediction by improving the whale optimization algorithm;

图2为基于改进鲸鱼优化算法的支持向量机预测模型示意图;Fig. 2 is a schematic diagram of a support vector machine prediction model based on the improved whale optimization algorithm;

图3为算法用于预测的原始实验数据趋势图;Fig. 3 is the trend diagram of the original experimental data used for prediction by the algorithm;

图4为算法用于预测的原始实验数据的七个数据子集的框线图。Figure 4 is a block diagram of the seven data subsets of the original experimental data that the algorithm used for prediction.

具体实施方式Detailed ways

下面结合具体实施例对本发明做进一步说明,然而熟悉本领域的人们应当了解,在这里结合附图给出的详细说明是为了更好的解释,本发明的结构必然超出了有限的这些实施例,而对于一些等同替换方案或常见手段,本文不再做详细叙述,但仍属于本申请的保护范围。The present invention will be further described below in conjunction with specific embodiments, but those who are familiar with the art should understand that the detailed description given here in conjunction with accompanying drawings is for better explanation, and the structure of the present invention must exceed these limited embodiments, and for some equivalent replacement schemes or common means, this paper does not describe in detail again, but still belongs to the protection scope of the present application.

图1~4是本发明的最佳实施例,下面结合附图1~4对本发明做进一步说明。Fig. 1~4 is preferred embodiment of the present invention, below in conjunction with accompanying drawing 1~4 the present invention is described further.

如图1~2所示:一种基于改进鲸鱼优化方法,包括如下步骤:As shown in Figures 1 and 2: an optimization method based on improved whales, including the following steps:

S1 搜集样本数据并对其进行归一化,将数据分为训练集与测试集。S1 collects sample data and normalizes it, and divides the data into training set and test set.

具体过程为,获取待解决问题的相关历史数据,将数据分为训练集与测试集,并进行归一化处理,利用公式(1)对其进行标准的归一化处理;The specific process is to obtain the relevant historical data of the problem to be solved, divide the data into training set and test set, and perform normalization processing, and use the formula (1) to perform standard normalization processing;

; (1) ; (1)

其中,为标准化后的值,/>为原始数据,/>和/>表示样本数据的最大值和最小值。in, is the normalized value, /> for raw data, /> and /> Indicates the maximum and minimum values of the sample data.

S2用改进的鲸鱼优化算法对支持向量机的核参数与惩罚因子进行优化,建立基于改进鲸鱼优化算法的支持向量机预测模型。S2 uses the improved whale optimization algorithm to optimize the kernel parameters and penalty factors of the support vector machine, and establishes the support vector machine prediction model based on the improved whale optimization algorithm.

S3用训练集样本对支持向量机预测模型进行训练,得到最优核参数和惩罚因子的支持向量机预测模型。S3 uses the training set samples to train the support vector machine prediction model, and obtains the support vector machine prediction model with optimal kernel parameters and penalty factors.

具体包括如下步骤:Specifically include the following steps:

S3.1参数初始化。初始化参数有:最大迭代次数、当前迭代次数、种群数、搜索空间上下边界。S3.1 Parameter initialization. The initialization parameters are: the maximum number of iterations, the current number of iterations, the number of populations, and the upper and lower boundaries of the search space.

S3.2利种群初始化。用混沌映射策略产生个体的初始位置。S3.2 Initialize the population. The initial position of the individual is generated using a chaotic mapping strategy.

利用混沌映射策略产生个体的初始位置,Tent混沌映射如式(2)。Use the chaotic mapping strategy to generate the initial position of the individual, and the Tent chaotic mapping is as formula (2).

; (2) ; (2)

其中,k为当前迭代次数,为了使种群初始化具有随机性,Among them, k is the current number of iterations, in order to make the population initialization random, .

S3.3计算初始适应度。计算每只个体的适应度,并找出最优适应度的个体。S3.3 Calculate the initial fitness. Calculate the fitness of each individual and find the individual with the best fitness.

其中,每个个体的适应度是基于当前位置的输入层权值和阈值,根据公式以内部K折交叉验证法计算出极限学习机的准确度ACC;Among them, the fitness of each individual is based on the input layer weight and threshold of the current position, and the accuracy ACC of the extreme learning machine is calculated by the internal K-fold cross-validation method according to the formula;

; (3) ; (3)

其中,表示每一折数据上计算获得的准确度。in, Indicates the accuracy calculated on each fold of data.

S3.4鲸鱼优化算法的位置更新。S3.4 Position updates for the whale optimization algorithm.

在D维空间内每个鲸鱼的位置为:The position of each whale in the D-dimensional space is:

。 (4) . (4)

包围猎物:向着最优位置鲸鱼游动,位置更新公式如下:Surround the prey: the whale swims towards the optimal position, the position update formula is as follows:

; (5) ; (5)

; (6) ;(6)

非线性收敛因子为:The nonlinear convergence factor is:

; (7) ;(7)

; (8) ; (8)

其中,为当前最优的鲸鱼位置,/>、/>为/>的随机数,t表示当前迭代次数,T表示最大迭代次数。in, is the current optimal whale position, /> , /> for /> The random number of , t represents the current number of iterations, and T represents the maximum number of iterations.

向着随机鲸鱼的位置游动该鲸鱼的位置更新如下:Swim towards the position of a random whale The position of the whale is updated as follows:

; (9) ; (9)

其中,为当前群体中随机选择的鲸鱼的位置,当|A<1|时,鲸鱼选择向着最优个体游动,当|(A≥1)|时,鲸鱼选择向着随机个体游动。in, is the position of the randomly selected whale in the current group, when |A<1|, the whale chooses to swim towards the optimal individual, and when |(A≥1)|, the whale chooses to swim towards the random individual.

气泡网:鲸鱼在捕猎时会喷出汽包形成气泡网来驱赶猎物。鲸鱼为了使用气泡网来驱赶猎物,也会不断的更新自身的位置。使用气泡网时,鲸鱼的位置更新公式如下:Bubble net: When hunting, whales will eject steam drums to form a bubble net to drive away prey. In order to use the bubble net to drive away the prey, the whale will constantly update its position. When using the bubble net, the position update formula of the whale is as follows:

; (10) ;(10)

其中,为常数,/>为均匀分布在/>内的随机数;in, is a constant, /> for uniform distribution over /> random number in

; (11) ;(11)

在每次行动之前,每只鲸鱼都会利用自适应阈值来判断选择包围猎物还是使用气泡网来驱赶猎物。公式如下:Before each move, each whale uses an adaptive threshold to decide whether to encircle the prey or use the bubble net to drive the prey away. The formula is as follows:

。 (12) . (12)

S3.5萤火虫扰动策略:计算适应度,利用正余弦扰动策略来更新当前最优位置,计算位置更新后的最优个体适应度,并与猎物当前最优适应度值进行比较,若更新后的个体适应度值优于猎物,则以适应度值更优的个体位置作为新的最优位置。S3.5 Firefly disturbance strategy: Calculate the fitness, use the sine-cosine disturbance strategy to update the current optimal position, calculate the optimal individual fitness after the position update, and compare it with the current optimal fitness value of the prey. If the updated individual fitness value is better than the prey, the individual position with a better fitness value will be used as the new optimal position.

萤火虫的相对荧光亮度为:The relative fluorescence brightness of fireflies is:

; (13) ;(13)

其中,为萤火虫最大荧光亮度,目标函数值越优自身亮度越高;/>为光强吸收系数;/>为萤火虫i与j之间的欧式距离;in, is the maximum fluorescence brightness of fireflies, the better the objective function value is, the higher the brightness will be;/> is the light intensity absorption coefficient; /> is the Euclidean distance between fireflies i and j;

萤火虫的吸引力的公式表达式为:The formula expression for the attraction of fireflies is:

; (14) ;(14)

其中,为最大吸引度。in, is the maximum attractiveness.

萤火虫位置更新为:The firefly position is updated to:

; (15) ;(15)

其中,∈/>为步长因子;/>为/>上服从正态分布的随机数。in, ∈/> is the step factor; /> for /> random numbers that follow a normal distribution.

S3.6判断是否达到最大迭代次数,若已经达到则到步骤S3.7,否则到步骤S3.3;S3.6 Judging whether the maximum number of iterations has been reached, if it has been reached, go to step S3.7, otherwise go to step S3.3;

S3.7导出最优鲸鱼位置,即得到支持向量机的最优核参数和惩罚因子。S3.7 Deriving the optimal whale position, that is, obtaining the optimal kernel parameters and penalty factors of the support vector machine.

S4将测试集样本特征导入基于最优核参数和惩罚因子的支持向量机预测模型中,得到数据的预测值。S4 imports the sample features of the test set into the support vector machine prediction model based on the optimal kernel parameters and penalty factors to obtain the predicted value of the data.

S5用RMSE、MAE和MAPE对模型预测效果进行评价。S5 uses RMSE, MAE and MAPE to evaluate the prediction effect of the model.

支持向量机的具体为:最小二乘支持向量机(LSSVM)是一种可以实现分类与回归的模型,它可以将问题化为一个求解凸二次规划的问题。与其他分类或回归的模型相比,最小二乘支持向量机在学习复杂的非线性方程时提供了一种更为清晰以及更强大的方式。SVM 基本思想是通过任意一个输入样本 x,来推断得到对应的输出值 y,对于一组给定的训练数据样本集合为,其中i=1,2,3,…,l。SVM 的回归理论是对样本数据 x 做一个非线性映射,完成从低维空间到高维空间的转换,并在高维空间中解决回归问题。其预测模型表达式为:The details of the support vector machine are: the least squares support vector machine (LSSVM) is a model that can realize classification and regression, and it can turn the problem into a problem of solving convex quadratic programming. Compared with other classification or regression models, least squares support vector machines provide a clearer and more powerful way to learn complex nonlinear equations. The basic idea of SVM is to infer the corresponding output value y through any input sample x. For a given set of training data samples, it is , where i=1, 2, 3, ..., l. The regression theory of SVM is to make a nonlinear mapping on the sample data x, complete the conversion from low-dimensional space to high-dimensional space, and solve the regression problem in high-dimensional space. Its prediction model expression is:

; (16) ;(16)

其中,为权值;b为偏置项,取常数;/>为核函数,表示低维空间到高维空间的非线性映射。in, is the weight; b is the bias item, which is a constant; /> Is the kernel function, which represents the nonlinear mapping from low-dimensional space to high-dimensional space.

其优化目标的表达式与约束条件为:The expression and constraints of the optimization objective are:

; (17) ;(17)

; (18) ;(18)

; (19) ;(19)

; (20) ;(20)

其对偶形式为:Its dual form is:

; (21) ; (twenty one)

其中C为惩罚因子;和/>为松弛因子;/>为损失函数。where C is the penalty factor; and /> is the relaxation factor; /> is the loss function.

在对非线性样本进行预测时,一般通过核函数将数据从低维转为高维,而核函数的选取就非常重要,常用的核函数如表1。When predicting nonlinear samples, the kernel function is generally used to convert the data from low-dimensional to high-dimensional, and the selection of the kernel function is very important. The commonly used kernel functions are shown in Table 1.

表1 支持向量机的核函数Table 1 Kernel function of support vector machine

确定核函数确定后,然后对惩罚因子C和核参数g进行确定,本发明主要使用改进的鲸鱼优化算法对这两个参数优化。After confirming that the kernel function is determined, then the penalty factor C and the kernel parameter g are determined, and the present invention mainly uses an improved whale optimization algorithm to optimize these two parameters.

本发明公开了一种基于改进鲸鱼优化算法的支持向量机用于预测模型,下面结合具体实施例来说明本发明的有效性和优越性。本实施例以电力负荷预测为例,电力负荷由于具有一定的变化规律,而且也受到气温、时间等因素的影响,所以在进行负荷预测时要考虑到负荷自身的属性以及其他重要因素的影响是得到准确预测结果的关键。The present invention discloses a support vector machine based on an improved whale optimization algorithm used for prediction models. The effectiveness and superiority of the present invention will be described below in conjunction with specific embodiments. This embodiment takes power load forecasting as an example. Since power load has a certain change law and is also affected by factors such as temperature and time, the key to obtaining accurate forecast results is to take into account the properties of the load itself and the influence of other important factors when performing load forecasting.

为了检验本发明所提出的预测模型的可靠性和稳定性,选取了某地区2009年7月6日0:00到2009年8月30日24:00的8周实际电力负荷数据作为仿真实验的数据,一天中每隔十五分钟测一次数据,每天一共测量到96组数据,一共有5376组实验数据。本发明将前7周共4704个的负荷数据作为训练集样本,将第8周共672个的负荷数据作为测试集样本。将所有数据按周一到周日的类型分别储存在7个数据子集中,换而言之,就是十二周中每个周一的负荷数据储存在一个子集中,其他以此类推,一共得到7个不同周类型的数据子集。为每个数据子集分别创建预测模型利用前7周的数据训练模型,然后预测第8周的负荷数据,使用这样方式验证本发明所提出模型的精度与可靠性。原始数据的趋势如附图3所示,可以明显看出数据分布具有一定的规律,每七天是周期。七个数据子集的框线图如附图4所示,可以看出每周周一的耗电量最多,周六和周日的耗电量最少,周一到周五耗电比较均衡,还可以得到周一一天的用电数据比较分散,周日用电数据比较集中。In order to test the reliability and stability of the prediction model proposed by the present invention, the actual power load data of an area for 8 weeks from 0:00 on July 6, 2009 to 24:00 on August 30, 2009 was selected as the data of the simulation experiment, and the data was measured every fifteen minutes in a day. A total of 96 sets of data were measured every day, and there were 5376 sets of experimental data in total. In the present invention, a total of 4,704 load data in the first 7 weeks are used as a training set sample, and a total of 672 load data in the 8th week are used as a test set sample. Store all the data in 7 data subsets according to the type of Monday to Sunday. In other words, the load data of each Monday in twelve weeks is stored in a subset, and so on, and a total of 7 data subsets of different week types are obtained. Create a prediction model for each data subset, use the data of the first 7 weeks to train the model, and then predict the load data of the 8th week, using this method to verify the accuracy and reliability of the model proposed by the present invention. The trend of the original data is shown in Figure 3. It can be clearly seen that the data distribution has certain rules, and every seven days is a cycle. The frame diagram of the seven data subsets is shown in Figure 4. It can be seen that the power consumption is the most on Monday, and the power consumption on Saturday and Sunday is the least.

为了验证本发明所提出的模型的可靠性,本实施例中主要选取了均方根误差(RMSE)、平均绝对百分对误差(MAPE)、均方误差(MAE)、平均绝对误差(MAE)作为模型精度的评价标准。定义如下表所示。In order to verify the reliability of the proposed model of the present invention, root mean square error (RMSE), mean absolute percentage pair error (MAPE), mean square error (MAE), mean absolute error (MAE) are mainly selected as the evaluation criteria of model accuracy in the present embodiment. Definitions are shown in the table below.

表2 模型性能评估标准Table 2 Model performance evaluation criteria

为了检验本发明所提出模型的可靠性,选用了标准的WOA-LSSVM和本发明所提出的FA-CAWOA-LSSVM模型进行对比,结果表明,基于改进鲸鱼优化算法的支持向量机预测模型相比于基于标准鲸鱼优化算法的支持向量机预测模型的稳定性与预测精度更好,说明改进鲸鱼优化算法大大提高了鲸鱼优化算法的寻优能力。In order to test the reliability of the model proposed by the present invention, the standard WOA-LSSVM and the FA-CAWOA-LSSVM model proposed by the present invention were selected for comparison. The results show that the support vector machine prediction model based on the improved whale optimization algorithm has better stability and prediction accuracy than the support vector machine prediction model based on the standard whale optimization algorithm, indicating that the improved whale optimization algorithm has greatly improved the optimization ability of the whale optimization algorithm.

表 3两种模型的预测值与真实值的误差比较图Table 3 Comparison chart of the error between the predicted value and the real value of the two models

上表再次表明本发明所提出的算法具有更好的寻优性能,FA-CAWOA-LSSVM相比于WOA-LSSVM而言预测精度的提高十分显著。The above table shows again that the algorithm proposed by the present invention has better optimization performance, and the prediction accuracy of FA-CAWOA-LSSVM is significantly improved compared with WOA-LSSVM.

以上所述,仅是本发明的较佳实施例而已,并非是对本发明作其它形式的限制,任何熟悉本专业的技术人员可能利用上述揭示的技术内容加以变更或改型为等同变化的等效实施例。但是凡是未脱离本发明技术方案内容,依据本发明的技术实质对以上实施例所作的任何简单修改、等同变化与改型,仍属于本发明技术方案的保护范围。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention in other forms. Any person skilled in the art may use the technical contents disclosed above to change or modify them into equivalent embodiments with equivalent changes. However, any simple modifications, equivalent changes and modifications made to the above embodiments according to the technical essence of the present invention without departing from the content of the technical solution of the present invention still belong to the protection scope of the technical solution of the present invention.

Claims (9)

1. An improved whale optimization method is characterized in that: the method comprises the following steps:
s1, collecting sample data and normalizing the sample data, and dividing the data into a training set and a testing set;
s2, optimizing the nuclear parameters and the penalty factors of the support vector machine by using an improved whale optimization algorithm, and establishing a support vector machine prediction model based on the improved whale optimization algorithm;
s3, training the support vector machine prediction model by using a training set sample to obtain an optimal kernel parameter and a penalty factor support vector machine prediction model;
s4, importing the sample characteristics of the test set into a support vector machine prediction model based on the optimal nuclear parameters and penalty factors to obtain a predicted value of the data;
s5, evaluating model prediction effects by using RMSE, MAE and MAPE;
a method for optimizing the kernel parameters and penalty factors of a support vector machine using an improved whale optimization algorithm, comprising the steps of:
s3.1, initializing parameters;
s3.2, generating an initial position of an individual by using a chaotic mapping strategy;
s3.3, calculating the fitness of each individual, and finding out the individual with the optimal fitness;
s3.4, updating the position of the whale optimization algorithm;
s3.5 firefly disturbance strategy: calculating fitness, namely updating a current optimal position by utilizing a sine and cosine disturbance strategy, calculating the updated optimal individual fitness of the position, comparing the calculated optimal individual fitness with a current optimal fitness value of a prey, and taking the individual position with the better fitness value as a new optimal position if the updated individual fitness value is better than the prey;
s3.6, judging whether the maximum iteration times are reached, if so, going to the step S3.7, otherwise, going to the step S3.3;
and S3.7, deriving the optimal whale position to obtain the optimal kernel parameters and penalty factors of the support vector machine.
2. The improved whale-based optimization method according to claim 1, wherein: the normalization processing method comprises the following steps:
wherein,,for normalized values, ++>For the original data +.>And->Representing the maximum and minimum values of the sample data.
3. The improved whale-based optimization method according to claim 1, wherein: the method further comprises the following steps of:
where k is the current iteration number, in order to have randomness in the population initialization,
4. the improved whale-based optimization method according to claim 1, wherein: the method further comprises the step of calculating accuracy ACC of the extreme learning machine by an internal K-fold cross validation method:
wherein,,representing the accuracy of the calculated results on each fold data.
5. The improved whale-based optimization method according to claim 1, wherein: the method further comprises the steps of:
wherein,,representing the position of the whale individual in D-dimensional space.
6. The improved whale-based optimization method of claim 5, wherein: the method further comprises swimming towards the optimal position whale, the position update formula being as follows:
wherein,,position of the ith individual after the t+1st iteration, +.>Position of i-th individual for current iteration number, < ->For the current optimal whale position, A and C are both coefficients, < >>、/>Is->Random number of->The self-adaptive weight is adopted, T is the current iteration number, and T is the maximum iteration number;
the nonlinear convergence factor is:
wherein,,and->The two parameters are selected as +.>,/>
The position update of swimming the whale towards the position of a random whale is as follows:
wherein,,for the position of randomly selected whales in the current population, when +.>When whale chooses to swim towards the optimal individual, when +.>When whale chooses to swim towards random individuals.
7. The improved whale-based optimization method of claim 5, wherein: the method further comprises, using the bubble network, updating the position of whales as follows:
wherein,,is constant (I)>Is uniformly distributed in->A random number within; />
Prior to each action, each whale will determine whether to choose to surround the prey or to use a net of bubbles to repel the prey using an adaptive thresholdThe method comprises the following steps:
8. the improved whale-based optimization method according to claim 1, wherein: the relative fluorescence intensity of fireflies is:
wherein,,is the maximum fluorescence brightness of firefly, +.>Is the light intensity absorption coefficient>Is the Euclidean distance between firefly i and j;
the attractive force of fireflies is expressed as:
wherein,,is the maximum attraction.
9. The improved whale-based optimization method of claim 8, wherein: firefly position updates are:
wherein,,∈/>is a step factor; />Is->Random numbers obeying normal distribution.
CN202310463413.2A 2023-04-26 2023-04-26 Improved whale-based optimization method Pending CN116468181A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310463413.2A CN116468181A (en) 2023-04-26 2023-04-26 Improved whale-based optimization method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310463413.2A CN116468181A (en) 2023-04-26 2023-04-26 Improved whale-based optimization method

Publications (1)

Publication Number Publication Date
CN116468181A true CN116468181A (en) 2023-07-21

Family

ID=87175174

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310463413.2A Pending CN116468181A (en) 2023-04-26 2023-04-26 Improved whale-based optimization method

Country Status (1)

Country Link
CN (1) CN116468181A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116884623A (en) * 2023-09-06 2023-10-13 西南医科大学附属医院 Medical rehabilitation prediction system based on laser scanning imaging
CN117028874A (en) * 2023-09-12 2023-11-10 辽宁石油化工大学 Method and system for detecting leakage of fire-fighting pipeline
CN117150374A (en) * 2023-10-27 2023-12-01 国网江西省电力有限公司电力科学研究院 A transformer fault identification method and system based on feature importance ranking
CN117518780A (en) * 2023-12-04 2024-02-06 陕西旭氢时代科技有限公司 Fuel cell cogeneration system control method based on simulation model
CN118332922A (en) * 2024-05-06 2024-07-12 西南石油大学 Oil and gas pipe inner corrosion rate prediction method based on IWOA-SVM
CN117028874B (en) * 2023-09-12 2025-10-10 辽宁石油化工大学 Fire protection pipe leakage detection method and system

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110069817A (en) * 2019-03-15 2019-07-30 温州大学 A method of prediction model is constructed based on California gray whale optimization algorithm is improved
CN110378490A (en) * 2019-07-24 2019-10-25 江苏壹度科技股份有限公司 Based on the semiconductor yields prediction technique for improving whale algorithm optimization support vector machines
CN110516831A (en) * 2019-06-18 2019-11-29 国网(北京)节能设计研究院有限公司 A Short-Term Load Forecasting Method Based on MWOA Algorithm Optimizing SVM
CN112700060A (en) * 2021-01-08 2021-04-23 佳源科技股份有限公司 Station terminal load prediction method and prediction device
CN113392587A (en) * 2021-06-16 2021-09-14 中国地质调查局西安地质调查中心(西北地质科技创新中心) Parallel support vector machine classification method for large-area landslide risk evaluation
CN114611801A (en) * 2022-03-15 2022-06-10 淮阴工学院 Traveler problem solving method based on improved whale optimization algorithm
CN115876476A (en) * 2023-02-16 2023-03-31 山东科技大学 Rolling bearing fault diagnosis method, system, computer equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110069817A (en) * 2019-03-15 2019-07-30 温州大学 A method of prediction model is constructed based on California gray whale optimization algorithm is improved
CN110516831A (en) * 2019-06-18 2019-11-29 国网(北京)节能设计研究院有限公司 A Short-Term Load Forecasting Method Based on MWOA Algorithm Optimizing SVM
CN110378490A (en) * 2019-07-24 2019-10-25 江苏壹度科技股份有限公司 Based on the semiconductor yields prediction technique for improving whale algorithm optimization support vector machines
CN112700060A (en) * 2021-01-08 2021-04-23 佳源科技股份有限公司 Station terminal load prediction method and prediction device
CN113392587A (en) * 2021-06-16 2021-09-14 中国地质调查局西安地质调查中心(西北地质科技创新中心) Parallel support vector machine classification method for large-area landslide risk evaluation
CN114611801A (en) * 2022-03-15 2022-06-10 淮阴工学院 Traveler problem solving method based on improved whale optimization algorithm
CN115876476A (en) * 2023-02-16 2023-03-31 山东科技大学 Rolling bearing fault diagnosis method, system, computer equipment and storage medium

Non-Patent Citations (8)

* Cited by examiner, † Cited by third party
Title
吴飞;李霆;张航;李金湖;林翰;林朝灯;: "基于CWOA-ELM的短期电力负荷预测研究", 电子测量技术, no. 04, 23 February 2020 (2020-02-23) *
唐宏;冯平;陈镜伯;陈杰睿;朱建疆;: "萤火虫算法优化SVR参数在短期电力负荷预测中的应用", 西华大学学报(自然科学版), no. 01, 10 January 2017 (2017-01-10) *
宋婷婷;张达敏;王依柔;徐航;樊英;王栎桥;: "基于改进鲸鱼优化算法的WSN覆盖优化", 传感技术学报, no. 03, 15 March 2020 (2020-03-15) *
心升明月: "基于Tent映射的自适应鲸鱼优化算法", Retrieved from the Internet <URL:https://blog.csdn.net/weixin_43821559/article/details/121214043> *
智能算法研学社(JACK旭): "一种改进的鲸鱼优化算法-附代码", Retrieved from the Internet <URL:https://blog.csdn.net/u011835903/article/details/125900854> *
智能算法研学社(JACK旭): "收敛因子非线性变化的鲸鱼优化算法-附代码", Retrieved from the Internet <URL:https://blog.csdn.net/u011835903/article/details/126197160> *
王鑫恒: "电力负荷预测与优化算法的研究", 中国优秀硕士学位论文全文数据库 工程科技II辑, 15 February 2023 (2023-02-15), pages 042 - 2339 *
纪广月;: "基于改进的混沌鲸鱼算法优化DBN的广东人口数量预测研究", 模糊系统与数学, no. 02, 15 April 2020 (2020-04-15) *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116884623A (en) * 2023-09-06 2023-10-13 西南医科大学附属医院 Medical rehabilitation prediction system based on laser scanning imaging
CN116884623B (en) * 2023-09-06 2023-12-15 西南医科大学附属医院 Medical rehabilitation prediction system based on laser scanning imaging
CN117028874A (en) * 2023-09-12 2023-11-10 辽宁石油化工大学 Method and system for detecting leakage of fire-fighting pipeline
CN117028874B (en) * 2023-09-12 2025-10-10 辽宁石油化工大学 Fire protection pipe leakage detection method and system
CN117150374A (en) * 2023-10-27 2023-12-01 国网江西省电力有限公司电力科学研究院 A transformer fault identification method and system based on feature importance ranking
CN117518780A (en) * 2023-12-04 2024-02-06 陕西旭氢时代科技有限公司 Fuel cell cogeneration system control method based on simulation model
CN117518780B (en) * 2023-12-04 2024-04-09 陕西旭氢时代科技有限公司 Fuel cell cogeneration system control method based on simulation model
CN118332922A (en) * 2024-05-06 2024-07-12 西南石油大学 Oil and gas pipe inner corrosion rate prediction method based on IWOA-SVM
CN118332922B (en) * 2024-05-06 2025-03-04 西南石油大学 Oil and gas pipe inner corrosion rate prediction method based on IWOA-SVM

Similar Documents

Publication Publication Date Title
CN116468181A (en) Improved whale-based optimization method
CN111371607B (en) A Network Traffic Prediction Method Based on Decision Grey Wolf Algorithm to Optimize LSTM
CN112116144B (en) Regional power distribution network short-term load prediction method
CN104636801B (en) A kind of prediction transmission line of electricity audible noise method based on Optimized BP Neural Network
CN116542382A (en) Sewage treatment dissolved oxygen concentration prediction method based on mixed optimization algorithm
CN111416797B (en) Intrusion detection method for optimizing regularization extreme learning machine by improving longicorn herd algorithm
CN111061959B (en) A crowd-intelligent software task recommendation method based on developer characteristics
CN111105045A (en) Method for constructing prediction model based on improved locust optimization algorithm
CN118350513B (en) ISWO-LSTM model-based carbon emission prediction method and system
CN113300884B (en) A step-by-step network traffic prediction method based on GWO-SVR
CN117234703A (en) Differential disturbance-based dung beetle optimization algorithm cloud resource scheduling method
CN111242270A (en) Time series prediction model based on improved multi-objective differential optimal echo state network
CN110334869A (en) A training method for mangrove ecological health prediction based on dynamic group optimization algorithm
CN117114915A (en) Aquaculture PH value prediction method based on improved particle swarm optimization
Turgut et al. Artificial intelligence approaches to estimate the transport energy demand in Turkey
CN114780879B (en) An interpretable link prediction method for knowledge hypergraphs
CN116842354A (en) Feature selection method based on quantum artificial jellyfish search mechanism
CN112085144A (en) Adaptive covariance learning to guide artificial bee colonies
CN116245146A (en) Ranking learning method, system and application for generating countermeasure network based on evolution condition
Lu et al. Dynamic evolution analysis of desertification images based on BP neural network
CN111563614A (en) Load prediction method based on adaptive neural network and TLBO algorithm
Ma et al. A novel plant root foraging algorithm for image segmentation problems
CN116739139A (en) Chaotic harris eagle optimization method based on sine and cosine disturbance
CN114120367B (en) Pedestrian re-identification method and system based on circle loss metric under meta-learning framework
Tan et al. Time Series Prediction using Backpropagation Network Optimized by Hybrid K-means-Greedy 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
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载