Laboratorio Matlab

Da Bioingegneria Elettronica e Informatica.

Reti Neurali Feed-Forward

Esempio di applicazione di reti neurali artificiali.

  1. clear all, close all
  2.  
  3. load cancer_dataset.mat
  4. x = cancerInputs;
  5. t = cancerTargets(1,:);
  6.  
  7. temp = [x;t];
  8. rng(0)
  9. p = randperm(size(temp,2));
  10.  
  11. train_size = floor(size(temp,2)*.8);
  12. p_train = p(1:train_size);
  13. p_test = p(train_size+1:end);
  14.  
  15. x_train = temp(1:9,p_train);
  16. t_train = temp(10,p_train);
  17.  
  18. x_test = temp(1:9,p_test);
  19. t_test = temp(10,p_test);
  20.  
  21. save('dataset2.mat','x_train','t_train','x_test','t_test')