Doubt in labelling data for machine learning in MATLAB.

4 visualizaciones (últimos 30 días)
charu shree
charu shree el 19 de Jul. de 2023
Respondida: Divyam el 19 de Nov. de 2024 a las 8:33
Hello all, I am trying to do classification task of Mrandom -1 and 1 symbols using SVM in MATLAB. The input feature vector is based on energy levels and is shown as and and the correspnding training labels are given as .
I am able to compute the input feature vectors but not getting how to construct the training labels.
Any help in this regard will be highly appreciated.

Respuestas (1)

Divyam
Divyam el 19 de Nov. de 2024 a las 8:33
Assuming that the SVM is used here to map the feature vectors and with their corresponding class labels and 1, the training label vector y can be created as follows:
M_minus = size(E_minus, 1);
M_plus = size(E_plus, 1);
% Create the label vector
labels_minus = -1 * ones(M_minus, 1);
labels_plus = 1 * ones(M_plus, 1);
% Combine the labels
y = [labels_minus; labels_plus];
% Combine the feature vectors
features = [E_minus; E_plus];
% Train SVM model
SVMModel = fitcsvm(features, y);
Using the attached script "SVMTest.m" you can test the code and check out the accuracy and predictions of the SVM.

Categorías

Más información sobre Statistics and Machine Learning Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by