How to test using Matlab IDE?

조회 수: 2 (최근 30일)
Zulfiqar Khan
Zulfiqar Khan 2018년 12월 1일
댓글: Alok Nimrani 2019년 1월 2일
Hi,
I have got a training data. I have used the 'train' option to tain the SVM kernel. Now I have a test data also. How i can test SVM kernel using test data. Please guide me.
Is there a test option or not in Matlab IDE?
Please guide me how to test using the test data through Matlab IDE using SVM Kernel (Guassian).
Zulfi.
  댓글 수: 4
madhan ravi
madhan ravi 2018년 12월 1일
Please don't use the answer section for commenting use comment section instead. Thank you for understanding.
Zulfiqar Khan
Zulfiqar Khan 2018년 12월 1일
Hi,
Sorry for using answer section for commenting. In the above post, I confused Editor with workspace. Now I found my model uploaded in the workspace. I have clicked the link "How to predict using an exported model". It tells me to use:
yfit = GTM_ACC62p8.predictFcn(T)
where T is the data.
Should I write the above statement in the Editor? Editor is showing property & value (image attached). What does it mean?
Also I dont know how to import 'T' because at this point I can't see the import option. This is because "variable" tab is activated. Should i click on Home tab to import data & then click on the App tab and then click on run.
Some body please guide me.
Zulfi.

댓글을 달려면 로그인하십시오.

답변 (1개)

Alok Nimrani
Alok Nimrani 2018년 12월 7일
Hi Zulfiqar,
If you want to train a SVM kernel and use it later for testing, please have a look at the following link which describes the use of a Gaussian kernel for training a classificaiton model and then using 'predict' function to test the kernel: Gaussian Kernel Classification Model
However, if your goal is to perform regression, the following link might be helpful which describes the use of Gaussian kernel training for a regression model and then testing this model using 'predict' function: Gaussian Kernel Regression Model
Kindly go through the examples in these links. Hope this helps.
Regards,
Alok
  댓글 수: 2
Zulfiqar Khan
Zulfiqar Khan 2018년 12월 11일
Hi,
Thanks my friend for your response. Your solution is not working. I tried the following:
Label = predict(trainedModel, testdata);
Error using predict (line 84)
No valid system or dataset was specified.
I already have dataset "testdata" imported in my workspace. Why its saying its not valid?
Please guide me.
Zulfi.
Alok Nimrani
Alok Nimrani 2019년 1월 2일
Hi,
Sorry for the delayed response. Please note that the predict function can be used with either a RegressionKernel model object or a ClassificationKernel model object as specified in the input arguments of the links shared in the above answer. So, the error that you are getting is probably because your model is not belonging to one of these types.
Try creating a RegressionKernel or a ClassificationKernel model object and then use the predict function. If this does not resolve the issue, please share a sample code so that I can reproduce the issue.
Regards,
Alok

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Code Generation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by