CN109344994A - A kind of prediction model method based on improvement moth optimization algorithm - Google Patents
A kind of prediction model method based on improvement moth optimization algorithm Download PDFInfo
- Publication number
- CN109344994A CN109344994A CN201810991600.7A CN201810991600A CN109344994A CN 109344994 A CN109344994 A CN 109344994A CN 201810991600 A CN201810991600 A CN 201810991600A CN 109344994 A CN109344994 A CN 109344994A
- Authority
- CN
- China
- Prior art keywords
- moth
- fitness
- value
- flame
- formula
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/004—Artificial life, i.e. computing arrangements simulating life
- G06N3/006—Artificial 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]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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/00—Administration; Management
- G06Q10/04—Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
Abstract
The present invention provides a kind of prediction model method based on improvement moth optimization algorithm, including is loaded into data set and is standardized to sample data;Moth flame optimization algorithm is improved using Gaussian mutation strategy and chaos agitation treatment and utilizes improved moth optimization algorithm building supporting vector machine model and/or building extreme learning machine model.Implement the present invention, not only can increase population diversity, enhance the search capability of algorithm, moreover it is possible to prevent algorithm from falling into local optimum, be quickly found out globally optimal solution.
Description
Technical field
The present invention relates to field of computer technology more particularly to a kind of prediction model sides based on improvement moth optimization algorithm
Method.
Background technique
Swarm Intelligent Algorithm is that the social action of a kind of pair of nature difference biocenose and foraging behavior carry out
The random search algorithm of simulation and modeling.It is different from traditional random algorithm, and with the progress of search process, which can searched
All direction searching and after search process reaches certain phase is carried out in rope space, algorithm can carry out deeper around optimal solution
The search of level is to obtain the solution of more high quality.The above intelligent algorithm more it is famous such as: particle swarm algorithm, grey wolf optimization
Algorithm, ant group algorithm etc..
Moth flame optimization algorithm is a kind of novel intelligent optimization algorithm proposed by Mirjalili et al. in 2015.It should
Algorithm simulation moth searches for optimal solution by the behavior that located lateral mechanism flies around light source.It is excellent in moth flame
Change in algorithm, moth is candidate solution, and moth collection shares Metzler matrix expression, and another core component is flame, and F indicates flame collection
It closes.Flame and moth are all solutions in the algorithm, the difference is that treating in iterative process different with update mode.Moth
It is the main body actually moved in search space, and flame is moth up to the present obtained optimal location.When the light source (moon
It is bright) it is far when, moth is advanced with straight line, and when light source (artificial light) is closer, and moth carries out screw.The algorithm is because having
Swarm Intelligence Algorithm search speed is very fast, adjustment parameter is few, easy the advantages that jumping out local minimum, in many optimization problems
To extensive use.
However, the algorithm is easily fallen into when handling complicated optimum problem (such as there are a large amount of locally optimal solutions)
Local optimum is difficult to find globally optimal solution.For this problem, we introduce Gaussian mutation mechanism and chaotic disturbance mechanism
Moth flame optimization algorithm.On the one hand, since the tail portion of Gaussian Profile is relatively narrow, Gaussian mutation is added and makes it more likely in father
In generation, nearby generates new offspring, therefore, selects the Gaussian mutation mechanism of small step-length that moth can be allowed preferably to search
The every nook and cranny in space scans for, to increase population diversity, enhances the search capability of algorithm;On the other hand chaos is introduced
Disruption and recovery carries out chaotic disturbance mechanism by position of the mechanism to the current optimal solution obtained so far, prevents algorithm
Fall into local optimum.
Summary of the invention
The technical problem to be solved by the embodiment of the invention is that providing a kind of based on the prediction for improving moth optimization algorithm
Model method not only can increase population diversity, enhance the search capability of algorithm, moreover it is possible to prevent algorithm from falling into local optimum, fastly
Speed finds globally optimal solution.
In order to solve the above-mentioned technical problem, the embodiment of the invention provides one kind based on improvement moth flame optimization algorithm come
The method for constructing prediction model, the described method comprises the following steps:
Step S1: parameter initialization;Wherein, the parameter of initialization include: maximum number of iterations T, moth population quantity L,
Search space [the C of penalty coefficient Cmin, Cmax] and the wide γ of core search space [γmin, γmax];T and L is positive integer;
Step S2: the position of L moth of initialization, and following formula (1)-(2) are used, the position of all moths is included into
Into specified search range, updated L moth position X is obtainedm=(xM, 1, xM, 2) (m=1,2 ..., L);Wherein, described
Specified search range refers to the search range [C of penalty coefficient Cmin, Cmax] and the wide γ of core search range [γmin, γmax],
Random number of the rand between [0,1];CmaxFor the penalty coefficient maximum value of moth, CminFor the penalty coefficient maximum value of moth,
γmaxFor the wide maximum value of core of moth, γminFor the wide maximum value of core of moth;
xM, 1=(Cmax-Cmin)*rand+CminM=1,2 ... n (1);
xM, 2=(γmax-γmin)*rand+γminM=1,2 ... n (2);
Step S3: pass through moth body position XmPenalty coefficient C and the wide γ of core, it is corresponding to calculate each moth individual m
Moth fitness fm;
Step S4: it is ranked up the fitness of whole moth individuals is descending, by all moth positions according to correspondence
Fitness size is ranked up, and the moth after the fitness referring to all moths individual obtained after sequence and corresponding sequence
Position updates flame location fsWith fitness ff;Wherein, if current iteration number is 1, by flame location fsInitial value make
For the fitness f of all flamesfValue, and using the moth position after corresponding sequence as the position of whole flames;Otherwise, will work as
Moth fitness group merging obtained in moth fitness and a upper the number of iterations is obtained in preceding the number of iterations to sort in descending order,
And take preceding L value as flame fitness value, and take preceding L moth corresponding with flame fitness positions as flame position
It sets, and is arranged that flame fitness value is maximum is denoted as Fbest。
Step S5: according to updated flame location to all moth position XlIt is updated, obtains updated all
Moth position X 'l;
Step S6: variation processing is carried out to the updated position of each moth using Gaussian mutation strategy, is obtained each
A moth body position X through variation processingmG, and according to the updated position of each moth and each processing institute that made a variation
The moth body position X obtainedmG, calculate the corresponding fitness value in the updated position of each moth individual and its through variation at
The position X of reasonmGCorresponding fitness value, and calculated two fitness values of institute in further screening each moth individual
In maximum as the corresponding fitness value in its updated position;
Step S7: the fitness value of each moth individual obtained in step S6 is ranked up in descending order, retains row
The highest moth body position X ' of fitness value after sequencebest, and by the moth body position X ' of reservationbestFitness value and most
Big flame fitness value FbestIt is compared, and takes the maximum value in the two to update maximum flame fitness value FbestAnd maximum
Flame corresponding position, further using chaotic maps function to the moth body position X ' that will retainbestIt carries out at chaotic disturbance
Reason, exports optimal moth fitness value FbestCorresponding position Xbest=(xBest, 1, xBest, 2);
Step S8: judge whether to reach maximum number of iterations T;If when, by the resulting moth position X of step S7best=
(xBest, 1, xBest, 2) in xBest, 1And xBest, 2Respectively as final penalty coefficient C and the wide γ output of core;Otherwise, return step
S3 is operated into next iteration;
Step S9: by the step S8 optimal penalty coefficient C obtained the and wide γ of core, for constructing optimal classification function formula
(3) with Support Vector Machines Optimized model and/or for constructing optimal classification function formula (4) to optimize extreme learning machine model;
In formula (3) and (4), K (xi, yj)=exp (- γ | | xi-xj| |), aiFor Lagrange coefficient, b is threshold value, xiFor
Sample (i=1 ... n) to be tested, n are individual of sample number, yjIndicate label corresponding with training sample, yi(j=1 ... n) value
For 1 and -1, indicate that current individual of sample is negative class sample wherein 1 indicates that current individual of sample is positive class sample, -1;ΩELMFor symbol
The kernel function of Mercer theorem construction is closed, T indicates object vector, T=[t1, t2..., tn]。
Wherein, the step S3 is specifically included:
Step S3.1: each moth individual X is traversedm=(xM, 1, xM, 2), with xM, 1It is m-th of moth individual in current location
When penalty coefficient value C, with xM, 2The wide γ of core for being m-th of moth individual at current location, the parameter of simulative prediction model;
Step S3.2: being standardized sample data, and the sample data after standardization is divided into K folding,
And each folding sample data is input in the disaggregated model, it is all to calculate the corresponding machine learning model of each folding sample data
The accuracy acc of such as core extreme learning machine model or support vector machines modelkTo calculate being averaged for K model accuracy
Value, and the fitness f as the corresponding moth of moth mm;Wherein, it is kth folding that k, which is one of K folding intersection folding,;Model is quasi-
Exactness acckWhat is indicated is with moth body position XmIn xM, 1And xM, 2The prediction mould simulated by penalty coefficient C and the wide γ of core
Type acquired classification accuracy on kth folding cross validation;Average value ACC is indicated with moth body position XmIn xM, 1And xM, 2
Accuracy namely the corresponding moth fitness f of moth m by penalty coefficient C and the wide γ of the core disaggregated model simulatedm, this is flat
Mean value ACC passes through formulaIt calculates and obtains;
Step S3.3: being carried out above-mentioned steps S3.1 and step S3.2 to all m individuals, obtains each moth individual
The fitness f of the corresponding moth of mm。
Wherein, the step S5 is specifically included:
Step S5.1: according to the distance of formula (5) m-th of moth of calculating to j-th of flame;
Dmj=| Fj-Xm| (5);
In formula (5), XmFor the position of m-th of moth, FjFor j-th of flame, DM, jFor m-th of moth to j-th flame
Distance;
Step S5.2: the X of moth is updated according to formula (6)mPosition;
S(Xm, Fj)=DM, j·ebt·cos(2πt)+Fj(6);
In formula (6), b is the constant of defined logarithmic spiral shape, and coefficient t is the random number in [- 1,1];
Step S5.3: being carried out above-mentioned steps S5.1 and step S5.2 to all L moth individuals, is flown with updating each
Moth body position.
Wherein, " Gaussian mutation strategy position X updated to each moth is used in the step S6m∈X′lIt carries out
Variation processing " specific steps include:
Traverse each updated moth body position Xm, updated moth position is carried out by formula (7) high
This variation obtains XmG;
XmG=Xm[1+N (0,1)] (7);
In formula (7), XmIt is the current location of m-th of moth individual, N (0,1) is to obey the height that mean value is 0 and variance is 1
The random vector of this distribution.
Wherein, " using chaotic maps function to the moth body position X ' that will retain in the step S7bestCarry out chaos
The specific steps of disturbance treatment " include:
Step S7.1: the highest moth body position X ' of fitness is obtainedbest=(x 'bestC, x 'bestC), then utilize public affairs
Formula (8) generates Logistic Chaos Variable Ci;
Ci+1=μ * C* (1-Ci) i=1 ..., K (8);
In formula (8), μ is the controling parameter of chaotic maps function, and as μ=4, Logistic mapping is in Complete Chaos shape
State, CiFor equally distributed random number in [0,1], and Ci≠ 0.25,0.5,0.75,1;K be chaos sequence length and K=L,
Middle L is moth population at individual number;
Step S7.2: by formula (9), by Chaos Variable CiMapping becomes the chaos vector C ' in domain [lb, ub]i;
C′i=lb+Ci* (ub-lb) i=1 ..., K (9);
In formula (9), lb indicates that the lower limit vector of domain, ub indicate the upper limit vector of domain;
Step S7.3: it utilizes formula (10), by chaos vector C 'iWith optimal moth position X 'bestLinear combination is generated and is waited
Select optimal flame Ti;
Ti=(1-setCan) * Fbest+setCan*C 'iI=1 ..., K (10);
In formula (10), contraction factor setCan=exp (- iteration/Max_iteraition), Max_
Iteraition indicates the maximum number of iterations of algorithm, and iteration indicates the current iteration number of algorithm;
Step S7.4: if TiFitness function be better than Fbest, then by ViIt is recorded as X 'bestC, local search terminates;
Otherwise,
If chaos sequence length reaches K, local search also terminates;If chaos sequence length is less than K, step is jumped to
Rapid S7.1 is continued to execute.
The implementation of the embodiments of the present invention has the following beneficial effects:
The present invention introduces new improvement strategy, including Gaussian mutation mechanism and chaotic disturbance in moth flame optimization algorithm
Mechanism, and Gaussian mutation mechanism and chaotic disturbance mechanism is added in the suitable position in optimization process, prevents moth flame from optimizing
Algorithm falls into local extremum, can obtain more efficient accurately model of mind, not only increase population diversity, enhance searching for algorithm
Suo Nengli, moreover it is possible to prevent algorithm from falling into local optimum, be quickly found out globally optimal solution, so as to obtain more accurately predict and/
Or classifying quality and more effectively aid decision person carries out scientific and reasonable decision.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention, for those of ordinary skill in the art, without any creative labor, according to
These attached drawings obtain other attached drawings and still fall within scope of the invention.
Fig. 1 is the flow chart provided in an embodiment of the present invention based on the prediction model method for improving moth optimization algorithm.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, the present invention is made into one below in conjunction with attached drawing
Step ground detailed description.
As shown in Figure 1, in the embodiment of the present invention, a kind of prediction model side based on improvement moth optimization algorithm of proposition
Method the described method comprises the following steps:
Step S1: parameter initialization;Wherein, the parameter of initialization include: maximum number of iterations T, moth population quantity L,
Search space [the C of penalty coefficient Cmin, Cmax] and the wide γ of core search space [γmin, γmax];T and L is positive integer;
Step S2: the position of L moth of initialization, and following formula (1)-(2) are used, the position of all moths is included into
Into specified search range, the position X of updated L moth is obtainedm=(xM, 1, xM, 2) (m=1,2 ..., L);Wherein, institute
State the search range [C that specified search range refers to penalty coefficient Cmin, Cmax] and the wide γ of core search range [γmin,
γmax], random number of the rand between [0,1];CmaxFor the penalty coefficient maximum value of moth, CminFor moth penalty coefficient most
Big value, γmaxFor the wide maximum value of core of moth, γminFor the wide maximum value of core of moth;
xM, 1=(Cmax-Cmin)*rand+CminM=1,2 ... n (1);
xM, 2=(γmax-γmin)*rand+γminM=1,2 ... n 2);
Detailed process is,
Step S3: pass through moth body position XmPenalty coefficient C and the wide γ of core, it is corresponding to calculate each moth individual m
Moth fitness fm;
Step S4: it is ranked up the fitness of whole moth individuals is descending, by all moth positions according to correspondence
Fitness size is ranked up, and the moth after the fitness referring to all moths individual obtained after sequence and corresponding sequence
Position updates flame location fsWith fitness ff;Wherein, if current iteration number is 1, by flame location fsInitial value make
For the fitness f of all flamesfValue, and using the moth position after corresponding sequence as the position of whole flames;Otherwise, will work as
Moth fitness group merging obtained in moth fitness and a upper the number of iterations is obtained in preceding the number of iterations to sort in descending order,
And take preceding L value as flame fitness value, and take preceding L moth corresponding with flame fitness positions as flame position
It sets, and is arranged that flame fitness value is maximum is denoted as Fbest。
Step S5: according to updated flame location to all moth position XlIt is updated, obtains updated all
Moth position X 'l;
Step S6: variation processing is carried out to the updated position of each moth using Gaussian mutation strategy, is obtained each
A moth body position X through variation processingmG, and according to the updated position of each moth and each processing institute that made a variation
The moth body position X obtainedmG, calculate the corresponding fitness value in the updated position of each moth individual and its through variation at
The position X of reasonmGCorresponding fitness value, and calculated two fitness values of institute in further screening each moth individual
In maximum as its updated position XmCorresponding fitness value;
Step S7: the fitness value of each moth individual obtained in step S6 is ranked up in descending order, retains row
The highest moth body position X ' of fitness value after sequencebest, and by the moth body position X ' of reservationbestFitness value and most
Big flame fitness value FbestIt is compared, and takes the maximum value in the two to update maximum flame fitness value FbestAnd maximum
Flame corresponding position, further using chaotic maps function to the moth body position X ' that will retainbestIt carries out at chaotic disturbance
Reason, exports optimal moth fitness value FbestCorresponding position Xbest=(xBest, 1, xBest, 2);
Step S8: judge whether to reach maximum number of iterations T;If when, by the resulting moth position X of step S7best=
(xBest, 1, xBest, 2) in xBest, 1And xBest, 2Respectively as final penalty coefficient C and the wide γ output of core;Otherwise, return step
S3 is operated into next iteration;
Step S9: by the step S8 optimal penalty coefficient C obtained the and wide γ of core, for constructing optimal classification function formula
(3) with Support Vector Machines Optimized model and/or for constructing optimal classification function formula (4) to optimize extreme learning machine model;
In formula (3) and (4), K (xi, yj)=exp (- γ | | xi-xj| |), aiFor Lagrange coefficient, b is threshold value, xiFor
Sample (i=1 ... n) to be tested, n are individual of sample number, yjIndicate label corresponding with training sample, yi(j=1 ... n) value
For 1 and -1, indicate that current individual of sample is negative class sample wherein 1 indicates that current individual of sample is positive class sample, -1;ΩELMFor symbol
The kernel function of Mercer theorem construction is closed, T indicates object vector, T=[t1, t2..., tn]。
Detailed process is, in step S1 and step S2, to the position of parameter and moth in moth flame algorithm into
Row initialization, in order to the progress of subsequent algorithm.
In step s3, step S3.1 is used first, traverses each moth individual Xm=(xM, 1, xM, 2), with xM, 1For m
Penalty coefficient value C of a moth individual at current location, with xM, 2The wide γ of core for being m-th of moth individual at current location,
The parameter of simulative prediction model;
Secondly, being standardized using step S3.2 to sample data, the sample data after standardization is drawn
It is divided into K folding, and each folding sample data is input in the disaggregated model, calculates the corresponding engineering of each folding sample data
Practise the accuracy acc of the models such as model core extreme learning machine model or support vector machineskTo calculate K model accuracy
Average value, and the fitness f as the corresponding moth of moth mm;Wherein, it is kth folding that k, which is one of K folding intersection folding,;
Model accuracy acckWhat is indicated is with moth body position XmIn xM, 1And xM, 2It is simulated by penalty coefficient C and the wide γ of core
Prediction model acquired classification accuracy on kth folding cross validation;Average value ACC is indicated with moth body position XmIn
xM, 1And xM, 2Accuracy namely the corresponding moth fitness of moth m by penalty coefficient C and the wide γ of the core disaggregated model simulated
fm, average value ACC passes through formulaIt calculates and obtains;
Finally, being carried out above-mentioned steps S3.1 and step S3.2 to all m individuals, each m pairs of moth individual is obtained
The fitness f of the moth answeredm。
It should be noted that the specific steps of sample data standardization include: to be obtained first wait grind in step S3.2
The related data of problem is studied carefully as sample data, and is standardized to the sample data;
Herein, sample data may include: medical field (for the data such as colorectal cancer/breast cancer/pulmonary nodule) or
Single sample property distribution in financial field (being directed to business failure risk profile data) equal samples data is as shown in table 1 below:
Table 1
In table 1, the attribute value of sample data is divided into two classes i.e. sample attribute x1-x5With sample class x6.Wherein sample category
Property x1-x5The association attributes for data such as medical field/financial fields are illustrated, as financial field is directed to business failure data
Relevant financial index (attribute) such as working capital, profit etc. before tax ceases.Sample class x6Illustrate the class of the sample data
Distinguishing label.If medical field is directed to the sample label of colorectal cancer disease, if individual of sample illness: sample class x6Value is 1, if sample
This individual health: being worth is -1.For another example financial field is directed to the data sample of business failure risk profile, if judging the enterprise two
There is clean risk of liquidation in year: sample class x6Value is 1, if the enterprise is in two years without clean risk of liquidation: being worth is -1.Summary: for not
The intelligent decision problem of same domain, sample data format is mostly are as follows: ATTRIBUTE INDEX and class label composition in field.
Secondly, utilizing formulaSample data is standardized, wherein SiAttribute in representative sample
Feature original value, S 'iIt is SiBy the value after the obtained standardization of formula, SminIndicate the minimum in corresponding sample data
Value, SmaxIndicate the maximum value in corresponding sample data.In embodiments of the present invention, being standardized to sample will own
The variate-value (characteristic value) of attribute is all transformed into specified numberical range, to avoid gap between characteristic value it is excessive and influence classification
As a result.
In step s 4, the fitness of whole moth individuals and moth position are ranked up processing to update flame location
fsWith fitness ff.If current iteration number is 1, by flame location fsFitness f of the initial value as all flamesfValue,
And using the moth position after corresponding sequence as the position of whole flames;Otherwise, moth will be obtained in current iteration number to fit
Moth fitness group obtained merging is sorted in descending order in response and a upper the number of iterations, and L value is fitted as flame before taking
Angle value is answered, and takes preceding L moth corresponding with flame fitness positions as flame location.
In step s 5, use step S5.1 first: according to formula (5) calculate m-th of moth to j-th flame away from
From;
DM, j=| Fj-Xm| (5);
In formula (5), XmFor the position of m-th of moth, FjFor j-th of flame, DM, jFor m-th of moth to j-th flame
Distance;
Secondly, using step S5.2: updating the X of moth according to formula (6)mPosition;
S(Xm, Fj)=DM, j·ebt·cos(2πt)+Fj(6);
In formula (6), b is the constant of defined logarithmic spiral shape, and coefficient t is the random number in [- 1,1];
Finally, passing through step S5.3: above-mentioned steps S5.1 and step S5.2 are carried out to all L moth individuals, with more
Each new moth body position.
In step s 6, " Gaussian mutation strategy position X updated to each moth is usedm∈X′lIt carries out at variation
The specific steps of reason " include: to traverse each updated moth body position Xm, by formula (7) to updated moth
Position carries out Gaussian mutation and obtains XmG;
XmG=Xm[1+N (0,1)] (7);
In formula (7), XmIt is the current location of m-th of moth individual, N (0,1) is to obey the height that mean value is 0 and variance is 1
The random vector of this distribution;
Secondly, according to the updated position of each moth and each resulting moth body position of processing that made a variation
XmG, calculate the corresponding fitness value in the updated position of each moth individual and its position X through variation processingmGIt is corresponding
Fitness value, and in further screening each moth individual maximum in calculated two fitness values as it
Updated position XmCorresponding fitness value;
Finally, above-mentioned steps are carried out to all L moth individuals with obtain all updated moth body positions and
Fitness.
In the step s 7, the fitness value of each moth individual obtained in step S6 is ranked up in descending order, is protected
Stay the highest moth body position X ' of fitness value after sortingbest, and by the moth body position X ' of reservationbestFitness value
With maximum flame fitness value FbestIt is compared, and takes the maximum value in the two to update maximum flame fitness value Fbest, into
One step is using chaotic maps function to the moth body position X ' that will retainbestChaotic disturbance processing is carried out, optimal moth is exported
Fitness value FbestCorresponding position Xbest=(xBest, 1, xBest, 2);Wherein,
Using chaotic maps function to the moth body position X ' that will retainbestCarry out the specific steps of chaotic disturbance processing
Include:
Step S7.1: the highest moth body position X ' of fitness is obtainedbest=(x 'bestC, x 'bestC), then utilize public affairs
Formula (8) generates Logistic Chaos Variable Ci;
Ci+1=μ * C* (1-Ci) i=1 ..., K (8);
In formula (8), μ is the controling parameter of chaotic maps function, and as μ=4, Logistic mapping is in Complete Chaos shape
State, CiFor equally distributed random number in (0,1), and Ci≠ 0.25,0.5,0.75,1;K be chaos sequence length and K=L,
Middle L is moth population at individual number;
Step S7.2: by formula (9), by Chaos Variable CiMapping becomes the chaos vector C ' in domain [lb, ub]i;
C′i=lb+Ci* (ub-lb) i=1 ..., K (9);
In formula (9), lb indicates that the lower limit vector of domain, ub indicate the upper limit vector of domain;
Step S7.3: it utilizes formula (10), by chaos vector C 'iWith optimal moth position X 'bestLinear combination is generated and is waited
Select optimal flame Ti;
Ti=(1-setCan) * Fbest+setCan*C 'iI=1 ..., K (10);
In formula (10), contraction factor setCan=exp (- iteration/Max_iteraition), Max_
Iteraition indicates the maximum number of iterations of algorithm, and iteration indicates the current iteration number of algorithm;
Step S7.4: if TiFitness function be better than Fbest, then by ViIt is recorded as X 'bestC, local search terminates;
Otherwise,
If chaos sequence length reaches K, local search also terminates;If chaos sequence length is less than K, step is jumped to
Rapid S7.1 is continued to execute.
In step s 8, the iterative algorithm for repeating step S3 to step S7, until iterative algorithm is fully completed, output
Final moth position Xbest=(xBest, 1, xBest, 2), and by xBest, 1And xBest, 2Respectively as final penalty coefficient C and core
Wide γ output.
In step s 9, on the one hand, utilize the punishment of improved moth flame optimization algorithm Support Vector Machines Optimized model
Coefficient C and the wide γ parameter of core obtain wide with the optimal penalty coefficient C of the most matched supporting vector machine model of current sample data and core
γ value, and the optimal penalty coefficient C of acquisition and the wide γ of core are used to construct optimal classification function formula (3) to optimize supporting vector
Machine model.
Slack variable is introduced under old termsFormula (3) is changed into following formula
In formula (11) and (12), penalty factor is bigger to indicate bigger to the punishment of error sample, and C is smaller, then error sample
Punishment it is smaller.The problem is solved here by Lagrangian Arithmetic, available formula (13), wherein constraint condition are as follows: 0≤
ai≤ C, i=1,2 ... n,
After solving above-mentioned all kinds of coefficients, obtaining categorised decision function such as formula (14) is
On the other hand, the penalty coefficient C and core of improved moth flame optimization algorithm optimization extreme learning machine model are utilized
Wide γ parameter, obtain with the optimal penalty coefficient C of the most matched extreme learning machine model of current sample data and the wide γ value of core, and will
The optimal penalty coefficient C and the wide γ of core obtained is for constructing optimal classification function formula (4) to optimize extreme learning machine model.
In formula (4), K (xi, yj)=exp (- γ | | xi-xj| |), xiFor sample to be tested (i=1 ... n), n is individual of sample
Number, ΩELMFor the kernel function for meeting Mercer theorem construction, T indicates object vector, T=[t1, t2..., tn]。
The implementation of the embodiments of the present invention has the following beneficial effects:
The present invention introduces new improvement strategy, including Gaussian mutation mechanism and chaotic disturbance in moth flame optimization algorithm
Mechanism, and Gaussian mutation mechanism and chaotic disturbance mechanism is added in the suitable position in optimization process, prevents moth flame from optimizing
Algorithm falls into local extremum, and obtains more efficient accurately model of mind, not only increases population diversity, enhances the search of algorithm
Ability, moreover it is possible to prevent algorithm from falling into local optimum, be quickly found out globally optimal solution, so as to more accurately being classified and/or
Prediction effect and more effectively aid decision person carries out scientific and reasonable decision.
Those of ordinary skill in the art will appreciate that implement the method for the above embodiments be can be with
Relevant hardware is instructed to complete by program, the program can be stored in a computer readable storage medium,
The storage medium, such as ROM/RAM, disk, CD.
Above disclosed is only a preferred embodiment of the present invention, cannot limit the power of the present invention with this certainly
Sharp range, therefore equivalent changes made in accordance with the claims of the present invention, are still within the scope of the present invention.
Claims (5)
1. a kind of based on the prediction model method for improving moth optimization algorithm, which is characterized in that the described method comprises the following steps:
Step S1: parameter initialization;Wherein, the parameter of initialization includes: maximum number of iterations T, moth population quantity L, punishment
Search space [the C of coefficient Cmin, Cmax] and the wide γ of core search space [γmin, γmax];T and L is positive integer;
Step S2: the position of L moth of initialization, and following formula (1)-(2) are used, finger is included into the position of all moths
In fixed search range, updated L moth position X is obtainedm=(xM, 1, xM, 2) (m=1,2 ..., L);Wherein, described specified
Search range refer to the search range [C of penalty coefficient Cmin, Cmax] and the wide γ of core search range [γmin, γmax], rand
For the random number between [0,1];CmaxFor the penalty coefficient maximum value of moth, CminFor the penalty coefficient maximum value of moth, γmax
For the wide maximum value of core of moth, γminFor the wide maximum value of core of moth;
xM, 1=(Cmax-Cmin)*rand+CmimM=1,2 ... n (1);
xM, 2=(γmax-γmin)*rand+γminM=1,2 ... n (2);
Step S3: pass through moth body position XmPenalty coefficient C and the wide γ of core, calculate the corresponding moth of each moth individual m
Fitness fm;
Step S4: being ranked up the fitness of whole moth individuals is descending, and all moth positions are adapted to according to corresponding
Degree size is ranked up, and the moth position after the fitness referring to all moths individual obtained after sequence and corresponding sequence
To update flame location fsWith fitness ff;Wherein, if current iteration number is 1, by flame location fsInitial value as institute
There is the fitness f of flamefValue, and using the moth position after corresponding sequence as the position of whole flames;Otherwise, it will currently change
Moth fitness group merging obtained in moth fitness and a upper the number of iterations is obtained in generation number to sort in descending order, and is taken
Preceding L value is used as flame fitness value, and takes preceding L moth corresponding with flame fitness positions as flame location, and
Flame fitness value is maximum is denoted as F for settingbest;
Step S5: according to updated flame location to all moth position XlIt is updated, obtains updated all moth positions
Set X 'l;
Step S6: variation processing is carried out to the updated position of each moth using Gaussian mutation strategy, obtains each warp
Make a variation the moth body position X handledmG, and it is resulting according to the updated position of each moth and each processing that made a variation
Moth body position XmG, calculate the corresponding fitness value in the updated position of each moth individual and its through variation processing
Position XmGCorresponding fitness value, and in further screening each moth individual in calculated two fitness values
Maximum is as the corresponding fitness value in its updated position;
Step S7: the fitness value of each moth individual obtained in step S6 is ranked up in descending order, after retaining sequence
The highest moth body position X ' of fitness valuebest, and by the moth body position X ' of reservationbestFitness value and most high fire
Flame fitness value FbestIt is compared, and takes the maximum value in the two to update maximum flame fitness value FbestWith maximum flame
Corresponding position, further using chaotic maps function to the moth body position X ' that will retainbestChaotic disturbance processing is carried out, it is defeated
Optimal moth fitness value F outbestCorresponding position Xbest=(xBest, 1, xBest, 2);
Step S8: judge whether to reach maximum number of iterations T;If when, by the resulting moth position X of step S7best=
(xBest, 1, xBest, 2) in xBest, 1And xBest, 2Respectively as final penalty coefficient C and the wide γ output of core;Otherwise, return step
S3 is operated into next iteration;
Step S9: by the step S8 optimal penalty coefficient C obtained the and wide γ of core, for construct optimal classification function formula (3) with
Support Vector Machines Optimized model and/or for constructing optimal classification function formula (4) to optimize extreme learning machine model;
In formula (3) and (4), K (xi, yj)=exp (- γ | | xi-xj| |), aiFor Lagrange coefficient, b is threshold value, xiIt is to be measured
Sample sheet (i=1 ... n), n are individual of sample number, yjIndicate label corresponding with training sample, yj(j=1 ... n) value is 1
With -1, indicate that current individual of sample is negative class sample wherein 1 indicates that current individual of sample is positive class sample, -1;ΩELMTo meet
The kernel function of Mercer theorem construction, T indicate object vector, T=[t1, t2..., tn]。
2. as described in claim 1 based on the prediction model method for improving moth optimization algorithm, which is characterized in that the step
S3 is specifically included:
Step S3.1: each moth individual X is traversedm=(xM, 1, xM, 2), with xM, 1For m-th of moth individual at current location
Penalty coefficient value C, with xM, 2The wide γ of core for being m-th of moth individual at current location, the parameter of simulative prediction model;
Step S3.2: being standardized sample data, the sample data after standardization is divided into K folding, and will
Each folding sample data is input in the disaggregated model, calculates the corresponding machine learning model such as core of each folding sample data
The accuracy acc of the models such as extreme learning machine model or support vector machineskCalculate the average value of K model accuracy, and
Fitness f as the corresponding moth of moth mm;Wherein, it is kth folding that k, which is one of K folding intersection folding,;Model accuracy
acckWhat is indicated is with moth body position XmIn xM, 1And xM, 2Existed by penalty coefficient C and the wide γ of the core prediction model simulated
Kth rolls over acquired classification accuracy on cross validation;Average value ACC is indicated with moth body position XmIn xM, 1And xM, 2To punish
The accuracy for the disaggregated model that penalty factor C and the wide γ of core are simulated namely the corresponding moth fitness f of moth mm, the average value
ACC passes through formulaIt calculates and obtains;
Step S3.3: above-mentioned steps S3.1 and step S3.2 are carried out to all m individuals, obtain each m pairs of moth individual
The fitness f of the moth answeredm。
3. as described in claim 1 based on the method for constructing prediction model into moth flame optimization algorithm changed, feature
It is, the step S5 is specifically included:
Step S5.1: according to the distance of formula (5) m-th of moth of calculating to j-th of flame;
DM, j=| Fj-Xm| (5);
In formula (5), XmFor the position of m-th of moth, FjFor j-th of flame, DM, jFor m-th of moth to the distance of j-th of flame;
Step S5.2: the X of moth is updated according to formula (6)mPosition;
S(Xm, Fj)=DM, j·ebt·cos(2πt)+Fj(6);
In formula (6), b is the constant of defined logarithmic spiral shape, and coefficient t is the random number in [- 1,1];
Step S5.3: being carried out above-mentioned steps S5.1 and step S5.2 to all L moth individuals, to update each moth
Body position.
4. as described in claim 1 based on the prediction model method for improving moth optimization algorithm, which is characterized in that the step
" Gaussian mutation strategy position X updated to each moth is used in S6m∈X′iCarry out variation processing " specific steps packet
It includes:
Traverse each updated moth body position Xm, Gaussian mutation is carried out to updated moth position by formula (7)
Obtain XmG;
XmG=Xm[1+N (0,1)] (7);
In formula (7), XmIt is the current location of m-th of moth individual, N (0,1) is to obey the Gaussian Profile that mean value is 0 and variance is 1
Random vector.
5. as described in claim 1 based on the prediction model method for improving moth optimization algorithm, which is characterized in that the step
" using chaotic maps function to the moth body position X ' that will retain in S7bestThe specific steps packet of progress chaotic disturbance processing "
It includes:
Step S7.1: the highest moth body position X ' of fitness is obtainedbest=(x 'bestC, x 'bestC), then utilize formula (8)
Generate Logistic Chaos Variable Ci;
Ci+1=μ * C* (1-Ci) i=1 ..., K (8);
In formula (8), μ is the controling parameter of chaotic maps function, and as μ=4, Logistic mapping is in Complete Chaos state, Ci
For equally distributed random number in [0,1], and Ci≠ 0.25,0.5,0.75,1;K be chaos sequence length and K=L, wherein L be
Moth population at individual number;
Step S7.2: by formula (9), by Chaos Variable CiMapping becomes the chaos vector C ' in domain [lb, ub]i;
C′i=lb+Ci* (ub-lb) i=1 ..., K (9);
In formula (9), lb indicates that the lower limit vector of domain, ub indicate the upper limit vector of domain;
Step S7.3: it utilizes formula (10), by chaos vector C 'iWith optimal moth position X 'bestLinear combination generates candidate most
Excellent flame Ti;
Ti=(1-setCan) * Fbest+setCan*C 'iI=1 ..., K (10);
In formula (10), contraction factor setCan=exp (- iteration/Max_iteraition), Max_iteraition table
Show the maximum number of iterations of algorithm, iteration indicates the current iteration number of algorithm;
Step S7.4: if TiFitness function be better than Fbest, then by ViIt is recorded as X 'bestC, local search terminates;Otherwise,
If chaos sequence length reaches K, local search also terminates;If chaos sequence length is less than K, step is jumped to
S7.1 is continued to execute.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810991600.7A CN109344994A (en) | 2018-08-28 | 2018-08-28 | A kind of prediction model method based on improvement moth optimization algorithm |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810991600.7A CN109344994A (en) | 2018-08-28 | 2018-08-28 | A kind of prediction model method based on improvement moth optimization algorithm |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109344994A true CN109344994A (en) | 2019-02-15 |
Family
ID=65292054
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810991600.7A Pending CN109344994A (en) | 2018-08-28 | 2018-08-28 | A kind of prediction model method based on improvement moth optimization algorithm |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109344994A (en) |
Cited By (10)
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 |
CN110109350A (en) * | 2019-03-29 | 2019-08-09 | 广东工业大学 | A kind of power capture optimization method of wave-power device that catching flame algorithm based on chaos moth |
CN110147627A (en) * | 2019-05-24 | 2019-08-20 | 福州大学 | Go to the spring self weight optimum design method of fiery algorithm based on improvement moth |
CN110619144A (en) * | 2019-08-08 | 2019-12-27 | 杭州电子科技大学 | Microstrip antenna design method based on improved moth fire-fighting algorithm |
CN111122532A (en) * | 2020-01-10 | 2020-05-08 | 安徽理工大学 | Spectrum detection method for honey-doped syrup |
CN111950696A (en) * | 2020-06-29 | 2020-11-17 | 燕山大学 | Short-term power load prediction method based on dimension reduction and improved neural network |
CN112099765A (en) * | 2020-09-10 | 2020-12-18 | 湖北烽火平安智能消防科技有限公司 | Fire fighting research and judgment fighting system based on private big data cloud platform |
CN112200224A (en) * | 2020-09-23 | 2021-01-08 | 温州大学 | Medical image feature processing method and device |
CN112215259A (en) * | 2020-09-17 | 2021-01-12 | 温州大学 | Gene selection method and apparatus |
CN117314700A (en) * | 2023-11-27 | 2023-12-29 | 朗朗教育科技股份有限公司 | Dual-teacher teaching management method and system for preschool education |
-
2018
- 2018-08-28 CN CN201810991600.7A patent/CN109344994A/en active Pending
Cited By (14)
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 |
CN110109350A (en) * | 2019-03-29 | 2019-08-09 | 广东工业大学 | A kind of power capture optimization method of wave-power device that catching flame algorithm based on chaos moth |
CN110147627A (en) * | 2019-05-24 | 2019-08-20 | 福州大学 | Go to the spring self weight optimum design method of fiery algorithm based on improvement moth |
CN110619144B (en) * | 2019-08-08 | 2024-03-05 | 杭州电子科技大学 | Microstrip antenna design method based on improved moth fire suppression algorithm |
CN110619144A (en) * | 2019-08-08 | 2019-12-27 | 杭州电子科技大学 | Microstrip antenna design method based on improved moth fire-fighting algorithm |
CN111122532A (en) * | 2020-01-10 | 2020-05-08 | 安徽理工大学 | Spectrum detection method for honey-doped syrup |
CN111950696A (en) * | 2020-06-29 | 2020-11-17 | 燕山大学 | Short-term power load prediction method based on dimension reduction and improved neural network |
CN112099765A (en) * | 2020-09-10 | 2020-12-18 | 湖北烽火平安智能消防科技有限公司 | Fire fighting research and judgment fighting system based on private big data cloud platform |
CN112099765B (en) * | 2020-09-10 | 2024-04-12 | 湖北烽火平安智能消防科技有限公司 | Fire control research and judgment combat system based on private big data cloud platform |
CN112215259A (en) * | 2020-09-17 | 2021-01-12 | 温州大学 | Gene selection method and apparatus |
CN112215259B (en) * | 2020-09-17 | 2023-12-01 | 温州大学 | Gene selection method and apparatus |
CN112200224B (en) * | 2020-09-23 | 2023-12-01 | 温州大学 | Medical image feature processing method and device |
CN112200224A (en) * | 2020-09-23 | 2021-01-08 | 温州大学 | Medical image feature processing method and device |
CN117314700A (en) * | 2023-11-27 | 2023-12-29 | 朗朗教育科技股份有限公司 | Dual-teacher teaching management method and system for preschool education |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109344994A (en) | A kind of prediction model method based on improvement moth optimization algorithm | |
Piri et al. | An analytical study of modified multi-objective Harris Hawk Optimizer towards medical data feature selection | |
Hemeida et al. | Nature-inspired algorithms for feed-forward neural network classifiers: A survey of one decade of research | |
CN106355192B (en) | Support vector machine method based on chaos grey wolf optimization | |
CN108334949A (en) | A kind of tachytelic evolution method of optimization depth convolutional neural networks structure | |
CN108985010B (en) | Gene classification method and apparatus | |
CN106023195A (en) | BP neural network image segmentation method and device based on adaptive genetic algorithm | |
Myronenko et al. | Accounting for dependencies in deep learning based multiple instance learning for whole slide imaging | |
CN106650314A (en) | Method and system for predicting amino acid mutation | |
CN103207910A (en) | Image retrieval method based on hierarchical features and genetic programming relevance feedback | |
CN109472318A (en) | For the method and device of the machine learning model selected characteristic of building | |
CN111061959B (en) | Group intelligent software task recommendation method based on developer characteristics | |
Azhir et al. | An efficient automated incremental density-based algorithm for clustering and classification | |
Reformat et al. | Software quality analysis with the use of computational intelligence | |
CN111105045A (en) | Method for constructing prediction model based on improved locust optimization algorithm | |
McCormack et al. | Deep learning of individual aesthetics | |
CN112308115A (en) | Multi-label image deep learning classification method and equipment | |
CN109345007A (en) | A kind of Favorable Reservoir development area prediction technique based on XGBoost feature selecting | |
Abdel-Baset et al. | Cuckoo search and genetic algorithm hybrid schemes for optimization problems | |
Gupta et al. | Image enhancement using ant colony optimization | |
Rahmani et al. | Plant competition optimization: A novel metaheuristic algorithm | |
CN108763418A (en) | A kind of sorting technique and device of text | |
CN111292062B (en) | Network embedding-based crowd-sourced garbage worker detection method, system and storage medium | |
Zhang et al. | Research on borrower's credit classification of P2P network loan based on LightGBM algorithm | |
CN109492746A (en) | Deepness belief network parameter optimization method based on GA-PSO Hybrid 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 |