What is fitness function?
이전 댓글 표시
What is fitness function?
my prob is multiclass classification what ll be its fitness function
댓글 수: 1
Walter Roberson
2012년 5월 31일
편집: Walter Roberson
2023년 3월 30일
답변 (2개)
Thomas
2012년 5월 31일
0 개 추천
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
2023년 3월 22일
0 개 추천
[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
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.
카테고리
도움말 센터 및 File Exchange에서 Genetic Algorithm에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!