how to test svm classifier with new data set

4 ビュー (過去 30 日間)
ANANDHI
ANANDHI 2013 年 9 月 30 日
回答済み: Sameer 2025 年 5 月 29 日
I have trained svm classier to classify two classes . How should I give new data set as test input to svm classifier?I am beginer to matlab please help me with matlab code.
Thank you

回答 (1 件)

Sameer
Sameer 2025 年 5 月 29 日
If an SVM classifier has been trained using the "fitcsvm" function, new test data can be classified using the "predict" function.
Assuming the model is stored in a variable called "SVMModel" and the new test data is in a matrix called "TestData", the syntax would look like this:
predictedLabels = predict(SVMModel, TestData);
Here, "TestData" should have the same number of columns (features) as the training data. The result "predictedLabels" will contain the predicted class labels for each row of the test data.
For more information please refer to the following MathWorks documnetation :
Hope this helps!

カテゴリ

Help Center および File ExchangeStatistics and Machine Learning Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by