Weight optimization using genetic algorithm in MATLAB -


i new genetic algorithm , hoping guys can me out.

i have dataset:

dataset = [[3 4 4 4]           ;[2 3 2 3]           ;[1 1 3 2]           ;[3 2 4 3]           ;[0 3 1 0]]; 

where last column [4, 3, 2, 3, 0] represents actual labels; , first 3 columns represent feature vector [x1 x2 x3].

i want use genetic algorithm optimize weights [w1 w2 w3].

how can achieve ??

your weights optimization variables. basic optimization:

w = [w1 w2 w3]; x = [x1 x2 x3]; wopt = ga(@fitnessfunc(w, x), length(w))  function y = fitnessfunc(w,x)     y = w(1) * x(1) + w(2) * x(2) + w(3) * x(3); 

see matlab documentation on ga more options on ga function call , passing parameters how construct program.

remember weights variables you're optimizing. dataset x values parameters.


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -