Reader small image

You're reading from  MATLAB for Machine Learning - Second Edition

Product typeBook
Published inJan 2024
Reading LevelIntermediate
PublisherPackt
ISBN-139781835087695
Edition2nd Edition
Languages
Tools
Right arrow
Author (1)
Giuseppe Ciaburro
Giuseppe Ciaburro
author image
Giuseppe Ciaburro

Giuseppe Ciaburro holds a PhD and two master's degrees. He works at the Built Environment Control Laboratory - Università degli Studi della Campania "Luigi Vanvitelli". He has over 25 years of work experience in programming, first in the field of combustion and then in acoustics and noise control. His core programming knowledge is in MATLAB, Python and R. As an expert in AI applications to acoustics and noise control problems, Giuseppe has wide experience in researching and teaching. He has several publications to his credit: monographs, scientific journals, and thematic conferences. He was recently included in the world's top 2% scientists list by Stanford University (2022).
Read more about Giuseppe Ciaburro

Right arrow

Preface

MATLAB is a comprehensive programming environment used by many researchers and math experts for machine learning. This book will help you learn the basic concepts in machine learning and deep learning using MATLAB, and then refine your basic skills with advanced applications.

You’ll start by exploring the tools that the MATLAB environment offers for machine learning and see how to easily interact with the MATLAB workspace. We’ll then move on to data cleansing, mining, and analyzing various types of data in machine learning, and you’ll see how to visualize data values on a graph. Then, you’ll learn about the different types of classification and regression techniques and how to apply them to your data, using MATLAB functions. Further, you will understand the basic concepts of neural networks and perform data fitting, pattern recognition, and clustering analysis. You will also explore feature selection and extraction techniques for dimensionality reduction for performance improvement. Finally, you’ll learn how to leverage MATLAB tools for deep learning and managing convolutional neural networks.

By the end of the book, you’ll learn how to put it all together in real-world cases, covering major machine learning algorithms, and you’ll feel confident as you delve into machine learning with MATLAB.

Who this book is for

This book is suitable for machine learning engineers, data scientists, deep learning engineers, and CV/NLP engineers who want to use MATLAB for machine learning and deep learning. You should have a fundamental understanding of programming concepts.

What this book covers

Chapter 1, Exploring MATLAB for Machine Learning, covers machine learning, which is a branch of artificial intelligence that is based on the development of algorithms and mathematical models, capable of “learning” from data and autonomously adapting to improve their performance according to the objectives set. Thanks to this learning ability, machine learning is used in a wide range of applications, such as data analysis, CV, text translation, speech recognition, medical diagnosis, and financial risk prediction. Machine learning is an ever-evolving area of research and is revolutionizing many fields of science and industry. The aim of this chapter is to provide some introduction, background information, and a basic knowledge of MATLAB tools. In addition, the basic concepts of machine learning will be introduced.

Chapter 2, Working with Data in MATLAB, looks at how to import and organize our data in MATLAB. Today, the amount of data generated is enormous; smartphones, credit cards, televisions, computers, home appliances, sensors, domestic systems, public and private transport, and so on are just a few examples of devices that generate data seamlessly. Such data is stored and then used for various purposes. One of these is data analysis using machine learning algorithms. To import and organize our data in MATLAB, you should familiarize yourself with the MATLAB workspace to make the operations as simple as possible. Then, we will analyze the different formats available for the data collected and how to move data in and out of MATLAB. We will also explore datatypes to work with grouping variables and categorical data and how to export data from the workspace, including cell array, structure array, and tabular data, and save it in a MATLAB-supported file format. Finally, we will understand how to organize data in the correct format for the next phase of data analysis.

Chapter 3, Prediction Using Classification and Regression, shows us how to classify an object using nearest neighbors and how to perform an accurate regression analysis in a MATLAB environment. Classification algorithms return accurate predictions based on our observations. Starting from a set of predefined class labels, the classifier assigns each input data a class label, according to the training model. Regression relates a set of independent variables to a dependent variable. Through this technique, it is possible to understand how the value of the dependent variable changes as the independent variable varies.

Chapter 4, Clustering Analysis and Dimensionality Reduction, explores clustering methods, which are designed to find hidden patterns or groupings in a dataset. These algorithms identify a grouping without any label to learn from through the selection of clusters, based on the similarity between the elements. Dimensionality reduction is the process of converting a set of data with many variables into data with lesser dimensions but ensuring similar information. Feature selection approaches try to find a subset of the original variables. Feature extraction reduces the dimensionality of the data by transforming it into new features. This chapter shows us how to divide the data into clusters, or groupings of similar items. We’ll also learn how to select a feature that best represents the dataset.

Chapter 5, Introducing Artificial Neural Networks Modeling, delves into artificial neural networks (ANNs), which include data structures and algorithms for the learning and classification of data. Through the neural network techniques, a program can learn by example and create an internal structure of rules to classify different inputs. MATLAB provides algorithms, pretrained models, and apps to create, train, visualize, and simulate ANNs. In this chapter, we will see how to use MATLAB to build an ANN-based model to predict values and classify data.

Chapter 6, Deep Learning and Convolutional Neural Networks, examines deep learning, which is a machine learning technology based on multilayer ANNs and has allowed many applications to reach a high degree of accuracy. Deep neural networks are capable of modeling complex relationships between input and output data. Among the most successful applications is computer vision, with tasks that include classification, image regression, and object detection. For example, a deep neural network is able to generate a layered representation of objects in which each object is identified by a set of characteristics that has the form of visual primitives, such as particular edges, oriented lines, textures, and recurring patterns. Convolutional networks are characterized by convolutional layers, which use filters to analyze data in a local region and produce an activation map. These activation maps are then processed by pooling layers, which aggregate the low-resolution data to reduce the dimensionality of the representation and make processing more computationally efficient. The convolutional and pooling layers are then alternated several times until an image is represented by a low-resolution activation map. In this chapter, we will learn the basic concepts of deep learning and discover how to implement an algorithm based on convolutional networks in the MATLAB environment.

Chapter 7, Natural Language Processing Using MATLAB, explores natural language processing (NLP), which automatically processes information conveyed through spoken or written language. This task is fraught with difficulty and complexity, largely due to the innate ambiguity of human language. To enable machine learning and interaction with the world in ways typical of humans, it is essential not only to store data but also to teach machines how to translate it simultaneously into meaningful concepts. As natural language interacts with the environment, it generates predictive knowledge. In this chapter, we will learn the basic concepts of NLP and how to build a model to label sentences.

Chapter 8, MATLAB for Image Processing and Computer Vision, covers computer vision, which is a field that studies how to process, analyze, and understand the contents of visual data. In image content analysis, we use a lot of computer vision algorithms to build our understanding of the objects in an image. Computer vision covers various aspects of image analysis, such as object recognition, shape analysis, pose estimation, 3D modeling, and visual search. Humans are good at identifying and recognizing things around them! The goal of computer vision is to accurately model the human vision system using computers. In this chapter, we will understand the basic concepts of computer vision and how to implement a model for object recognition, using MATLAB.

Chapter 9, Time Series Analysis and Forecasting with MATLAB, delves into time series data, which is basically a sequence of measurements that are collected over time. These measurements are taken with respect to a predetermined variable and at regular time intervals. One of the main characteristics of time series data is that the ordering matters. The list of observations that we collect is ordered on a timeline, and the order in which they appear says a lot about underlying patterns. If you change the order, this will totally change the meaning of the data. Sequential data is a generalized notion that encompasses any data that comes in a sequential form, including time series data. In this chapter, we will learn the basic concepts of sequential data and how to build a model that describes the pattern of the time series or any sequence in general.

Chapter 10, MATLAB Tools for Recommender Systems, examines the recommendation engine, which is a model that can predict what a user may be interested in. When we apply this to the context of movies, for example, this becomes a movie recommendation engine. We filter items in our database by predicting how the current user might rate them. This helps us in connecting the user to the right content in our dataset. Why is this relevant? If you have a massive catalog, then the user may or may not find all the content that is relevant to them. By recommending the right content, you increase consumption. Companies such as Netflix heavily rely on recommendations to keep the user engaged. In this chapter, we will learn the basic concepts of recommender systems and how to build a movie recommendations system, using MATLAB.

Chapter 11, Anomaly Detection in MATLAB, teaches you the basic concepts of an anomaly detection system and how to implement one in MATLAB. A physical system, in its life cycle, can be subject to failures or malfunctions that can compromise its normal operation. It is, therefore, necessary to introduce an anomaly detection system within the capability of preventing critical interruptions. This is called a fault diagnosis system and can identify the possible presence of a malfunction within the monitored system. The search for the fault is one of the most important and qualifying maintenance intervention phases, and it is necessary to act in a systematic and deterministic way. To carry out a complete search for the fault, it is necessary to analyze all the possible causes that may have determined it.

To get the most out of this book

In this book, machine learning algorithms are implemented in the MATLAB environment. So, to reproduce the many examples in this book, you need a new version of MATLAB (R2023b is recommended) and the following toolboxes – a statistics and machine learning toolbox, a neural network toolbox, a deep learning toolbox, and a fuzzy logic toolbox.

Software/hardware covered in the book

Operating system requirements

MATLAB

Windows, macOS, or Linux

If you are using the digital version of this book, we advise you to type the code yourself or access the code from the book’s GitHub repository (a link is available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.

Download the example code files

You can download the example code files for this book from GitHub at https://github.com/PacktPublishing/MATLAB-for-Machine-Learning-second-edition. If there’s an update to the code, it will be updated in the GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Conventions used

There are a number of text conventions used throughout this book.

Code in text: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: “To create a classification tree, we can utilize the fitctree() function.”

A block of code is set as follows:

gscatter(meas(:,3), meas(:,4), species,'rgb','osd');
xlabel('Petal length');
ylabel('Petal width');

Bold: Indicates a new term, an important word, or words that you see on screen. For instance, words in menus or dialog boxes appear in bold. Here is an example: “Now, we can train the network just by clicking on the train button of the app. After a few seconds, the ANN will be trained and ready for use.”

Tips or important notes

Appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, email us at customercare@packtpub.com and mention the book title in the subject of your message.

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata and fill in the form.

Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at copyright@packt.com with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Share Your Thoughts

Once you’ve read MATLAB for Machine Learning, we’d love to hear your thoughts! Please click here to go straight to the Amazon review page for this book and share your feedback.

Your review is important to us and the tech community and will help us make sure we’re delivering excellent quality content.

Download a free PDF copy of this book

Thanks for purchasing this book!

Do you like to read on the go but are unable to carry your print books everywhere?

Is your eBook purchase not compatible with the device of your choice?

Don’t worry, now with every Packt book you get a DRM-free PDF version of that book at no cost.

Read anywhere, any place, on any device. Search, copy, and paste code from your favorite technical books directly into your application.

The perks don’t stop there, you can get exclusive access to discounts, newsletters, and great free content in your inbox daily

Follow these simple steps to get the benefits:

  1. Scan the QR code or visit the link below

https://packt.link/free-ebook/9781835087695

  1. Submit your proof of purchase
  2. That’s it! We’ll send your free PDF and other benefits to your email directly
lock icon
The rest of the chapter is locked
You have been reading a chapter from
MATLAB for Machine Learning - Second Edition
Published in: Jan 2024Publisher: PacktISBN-13: 9781835087695
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Giuseppe Ciaburro

Giuseppe Ciaburro holds a PhD and two master's degrees. He works at the Built Environment Control Laboratory - Università degli Studi della Campania "Luigi Vanvitelli". He has over 25 years of work experience in programming, first in the field of combustion and then in acoustics and noise control. His core programming knowledge is in MATLAB, Python and R. As an expert in AI applications to acoustics and noise control problems, Giuseppe has wide experience in researching and teaching. He has several publications to his credit: monographs, scientific journals, and thematic conferences. He was recently included in the world's top 2% scientists list by Stanford University (2022).
Read more about Giuseppe Ciaburro