Hi Sarath,
You can use the in-built MATLAB function 'crossval' for cross-validation to assess how well a model will generalize to unseen data. It helps to mitigate issues like overfitting, where a model performs well on the training data but poorly on new, unseen data. To set the number of epochs, batch size and many other parameters, you can use the 'trainingOptions' function in MATLAB.
To know more about the functions and their detailed use please refer to the following documentations:
- For 'crossval': https://www.mathworks.com/help/stats/classificationsvm.crossval.html
- For 'trainingOptions': https://www.mathworks.com/help/deeplearning/ref/trainingoptions.html
Hope this helps!