What is fitness function?

22 ビュー (過去 30 日間)
priya
priya 2012 年 5 月 31 日
コメント済み: Walter Roberson 2023 年 3 月 30 日
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 Center および File ExchangeGenetic Algorithm についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by