Book Image

MATLAB for Machine Learning - Second Edition

By : Giuseppe Ciaburro
Book Image

MATLAB for Machine Learning - Second Edition

By: Giuseppe Ciaburro

Overview of this book

Discover why the MATLAB programming environment is highly favored by researchers and math experts for machine learning with this guide which is designed to enhance your proficiency in both machine learning and deep learning using MATLAB, paving the way for advanced applications. By navigating the versatile machine learning tools in the MATLAB environment, you’ll learn how to seamlessly interact with the workspace. You’ll then move on to data cleansing, data mining, and analyzing various types of data in machine learning, and visualize data values on a graph. As you progress, you’ll explore various classification and regression techniques, skillfully applying them with MATLAB functions. This book teaches you the essentials of neural networks, guiding you through data fitting, pattern recognition, and cluster analysis. You’ll also explore feature selection and extraction techniques for performance improvement through dimensionality reduction. Finally, you’ll leverage MATLAB tools for deep learning and managing convolutional neural networks. By the end of the book, you’ll be able to put it all together by applying major machine learning algorithms in real-world scenarios.
Table of Contents (17 chapters)
Free Chapter
1
Part 1: Getting Started with Matlab
4
Part 2: Understanding Machine Learning Algorithms in MATLAB
9
Part 3: Machine Learning in Practice

Training and testing an ANN model in MATLAB

In the previous section, we saw the architecture of an ANN. It imposes two layers, input and output, which cannot be altered. Consequently, the critical factor lies in the number of hidden layers we consider. The size of a neural network is defined by the number of hidden neurons. Determining the optimal size of the network remains an ongoing challenge, as no analytical solution has been discovered to date. One approach to tackle this problem is to employ a heuristic method: creating various networks with increasing complexity, using a subset of the training data, and monitoring the error on a validation subset simultaneously. After completing the training process, the network with the lowest validation error is chosen as the preferred one.

How to train an ANN

Let’s discuss the process of choosing the number of layers. The number of input nodes is fixed based on the number of features in the input data, while the number of output...