How To Export Test Data From classificationLearner

4 ビュー (過去 30 日間)
Lama Moualla
Lama Moualla 2023 年 6 月 18 日
回答済み: Nandini 2023 年 6 月 18 日
Dear all,
I used the classificationLearner to train a model and I checked the test set option to evaluate the model using hidden samples chosen by the classificationLearner itself.
I need to export these test data to Matlab workspace. Is there a way to export it please?.
Many thanks.

回答 (1 件)

Nandini
Nandini 2023 年 6 月 18 日
Yes, you can export the test data from the ClassificationLearner app to the MATLAB workspace. Here's how you can do it:
  1. After training the model and evaluating it using the hidden test set, go to the "ClassificationLearner" tab in the MATLAB app.
  2. In the "Apps" section of the tab, click on the "Export" button and select "Export Test Data".
  3. A dialog box will appear asking you to choose the destination workspace variable. Enter a variable name for the test data and click "OK".
  4. The test data will be exported to the MATLAB workspace as a table, and you can access it using the variable name you specified.
Here's a sample code snippet that demonstrates the process:
% Load the ClassificationLearner app
classificationLearner
% Train and evaluate the model using the hidden test set
% After evaluating the model, go to the "ClassificationLearner" tab
% Click on "Export" -> "Export Test Data"
% Enter a variable name for the test data and click "OK"
variableName = 'testData';
% Access the test data in the MATLAB workspace
testData = evalin('base', variableName);
% Now you can use the test data in your MATLAB code
disp(testData);
Make sure to replace 'testData' with the variable name you entered when exporting the test data.
By following these steps, you can export the test data from the ClassificationLearner app to the MATLAB workspace for further analysis or processing.

カテゴリ

Help Center および File ExchangeTesting Frameworks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by