Problem with GA function
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello,
I am trying to apply genetric algorithm to select the features. I follow the code as suggested in this link: https://ch.mathworks.com/help/bioinfo/ug/genetic-algorithm-search-for-features-in-mass-spectrometry-data.html. However when I used my data the feat = ga(FitnessFcn,nVars,options) showng below error:
Error using rankfeatures (line 206)
Number of output
indices must be a
scalar between 1 and
number of features.
Error in biogacreate (line 17)
ranked_features = rankfeatures(Y,id,'NumberOfIndices',npop,'NWeighting',.5);
Error in makeState (line 34)
state.Population = feval(options.CreationFcn,GenomeLength,FitnessFcn,options,options.CreationFcnArgs{:});
Error in gaunc (line 47)
state = makeState(GenomeLength,FitnessFcn,Iterate,output.problemtype,options);
Error in ga (line 411)
[x,fval,exitFlag,output,population,scores] = gaunc(FitnessFcn,nvars, ...
Please help regarding this error. thanks !
댓글 수: 0
답변 (1개)
Khalid
2022년 11월 15일
Hi,
I understand that you are facing the error in ga function when you are trying to run code from https://ch.mathworks.com/help/bioinfo/ug/genetic-algorithm-search-for-features-in-mass-spectrometry-data.html.
When I tried to reproduce the error on my end, I didn't face any errors.
One possible reason for the error could be because of some issue in preprocessing step. Make sure that the data is preprocessed as mentioned and that the variables MZ, Y and grp are of same dimensions as shown in the article.
Hope it helps.
Regards,
Khalid
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Genetic Algorithm에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!