Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

error : "Argument to dynamic structure reference must evaluate to a valid field name" using Genetic Algorithms

1 Ansicht (letzte 30 Tage)
Hi,
I am using a genetic algorithm to minimize the single output of a decision tree, which I succesfully trained previously, for just one of the inputs. And i get the error : "Argument to dynamic structure reference must evaluate to a valid field name". And I don't know what I am doing wrong.
Thanks for your help.
Find attached the code:
%Define Constants
ds=5;
v=100;
optDT = zeros(length(ds),length(v));
fvalDT = zeros(length(ds),length(v));
for q = 1:length(ds)
for t = 1:length(v)
FitnessfunDT = @(y) modelfunT(y,ds(q),v(t),net);
[optDT(q,t),fvalDT(q,t)] = ga(FitnessfunDT,1,[],[],[],[],1,60,[],1);
end
end
%%%%%%
function berDT = modelfunT(y,ds,v,tree)
berDT = tree.predict([y,ds,v]);
end

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by