What is fitness function?

16 次查看(过去 30 天)
priya
priya 2012-5-31
What is fitness function?
my prob is multiclass classification what ll be its fitness function

回答(2 个)

Thomas
Thomas 2012-5-31
Fitness function is used in Genetic Algorithm in each iteration of the algorithm to evaluate the quality of all the proposed solutions to your problem in the current population. The fitness function evaluates how good a single solution in a population is, e.g. if you are trying to find for what x-value a function has it's y-minimum with a Genetic algorithm, the fitness function for a unit might simply be the negative y-value (the smaller the value higher the fitness function).

soso
soso 2023-3-22
[F(i),SOC] = fitness(X(i,:),loads,wind_output,solar_output,SOC_init,SOC_min,SOC_max,eta_ch,eta_dis,C_rate,t);
find error please
  1 个评论
Walter Roberson
Walter Roberson 2023-3-30
Mathworks does not provide any function named fitness
Generally speaking, you would pass the handle to a fitness function to one of the minimizers such as fmincon or ga . Those provided minimizers generally expect to be passed a vector of trial values, and they are expected to return a real scalar measure of how "good" that set of trial values is, with lower value being "more fit". The Mathworks minimizers only expect a single output from the fitness function.
If you need to pass a number of constant parameters to the fitness function, then see http://www.mathworks.com/help/matlab/math/parameterizing-functions.html
The mimizers can return a number of different outputs. Most often, the first output of the minimizer is a vector of the model parameters that returned that smallest fitness (and was within the constraint tolerances). Most often, the second output is the fitness value at that set of model parameters.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Genetic Algorithm 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by