Hi Noushin,
The classification learner app does not have a built-in feature to export all models at once with a single command. However, there is alternative method you can consider to streamline this process.You can automate the process using a loop to train and export each model iteratively. This approach saves time and effort compared to exporting models one by one manually.Here is snippet code as an example.
% Load your dataset
data = readtable('your_dataset.csv');
% Define your features and labels
X = data(:, 1:end-1);
Y = data(:, end);
% Loop through each model and export
for i = 1:34
% Train your model using the ith model
model = fitctree(X, Y); % Example model, replace with your model
% Export the model
save(sprintf('model_%d.mat', i), 'model');
end
So, the above code is basically loading your example dataset into Matlab. Ensure that your dataset is in the correct format and adjust the code accordingly.Extract the features (X) and labels (Y) from the dataset. Modify this part based on your dataset structure, use a loop that iterates from 1 to 34, representing the 34 models. Inside the loop:Train your model using the current iteration number (ith model). Replace fitctree with the appropriate function for your model.Save the trained model using save function with a unique filename based on the iteration number.Each model is saved as a .mat file with a unique name (e.g., model_1.mat, model_2.mat, ...).
By running this code, you can automatically train and export all 34 models without the need for manual intervention, streamlining the process and improving efficiency.