To Create mean squared error as a Function handle for input to genetic algorithm
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Little Flower
le 12 Avr 2022
Modifié(e) : Little Flower
le 12 Avr 2022
I am working on machine learning algorithms namely svm, knn, nb, elm etc. I wish to use ga for feature selection. The input matrix is of size 1250*36 where 36 is the number of features. I have the predicted output and original target matrix. The size of the matrix is 1250*5 since the number of classes is 5. Now I need to give the input matrix as input and to find the mean squared error between the predicted output and target matrix which should be formed as function handle which will be given as input to ga(genetic algorithm). Please help and share your points. Thanks in advance
0 commentaires
Réponse acceptée
David Hill
le 12 Avr 2022
targetMatrix=50*rand(1250,5);
predictedOutput=50*rand(1250,5);
mse=@(t,p)mean((t-p).^2,'all');
MSE=mse(targetMatrix,predictedOutput);
1 commentaire
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Genetic Algorithm dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!