Borrar filtros
Borrar filtros

What is fitness function?

16 visualizaciones (últimos 30 días)
priya
priya el 31 de Mayo de 2012
Comentada: Walter Roberson el 30 de Mzo. de 2023
What is fitness function?
my prob is multiclass classification what ll be its fitness function

Respuestas (2)

Thomas
Thomas el 31 de Mayo de 2012
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 el 22 de Mzo. de 2023
[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 comentario
Walter Roberson
Walter Roberson el 30 de Mzo. de 2023
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.

Iniciar sesión para comentar.

Categorías

Más información sobre Genetic Algorithm en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by