MATLAB for Machine Learning
eBook - ePub

MATLAB for Machine Learning

  1. 382 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

MATLAB for Machine Learning

About this book

Extract patterns and knowledge from your data in easy way using MATLABAbout This Book• Get your first steps into machine learning with the help of this easy-to-follow guide• Learn regression, clustering, classification, predictive analytics, artificial neural networks and more with MATLAB• Understand how your data works and identify hidden layers in the data with the power of machine learning.Who This Book Is ForThis book is for data analysts, data scientists, students, or anyone who is looking to get started with machine learning and want to build efficient data processing and predicting applications. A mathematical and statistical background will really help in following this book well.What You Will Learn• Learn the introductory concepts of machine learning.• Discover different ways to transform data using SAS XPORT, import and export tools, • Explore the different types of regression techniques such as simple & multiple linear regression, ordinary least squares estimation, correlations and how to apply them to your data.• Discover the basics of classification methods and how to implement Naive Bayes algorithm and Decision Trees in the Matlab environment.• Uncover how to use clustering methods like hierarchical clustering to grouping data using the similarity measures.• Know how to perform data fitting, pattern recognition, and clustering analysis with the help of MATLAB Neural Network Toolbox.• Learn feature selection and extraction for dimensionality reduction leading to improved performance.In DetailMATLAB is the language of choice for many researchers and mathematics experts for machine learning. This book will help you build a foundation in machine learning using MATLAB for beginners.You'll start by getting your system ready with t he MATLAB environment for machine learning and you'll see how to easily interact with the Matlab workspace. We'll then move on to data cleansing, mining and analyzing various data types in machine learning and you'll see how to display data values on a plot. Next, you'll get to know about the different types of regression techniques and how to apply them to your data using the MATLAB functions.You'll understand the basic concepts of neural networks and perform data fitting, pattern recognition, and clustering analysis. Finally, you'll explore feature selection and extraction techniques for dimensionality reduction for performance improvement.At the end of the book, you will learn to put it all together into real-world cases covering major machine learning algorithms and be comfortable in performing machine learning with MATLAB.Style and approachThe book takes a very comprehensive approach to enhance your understanding of machine learning using MATLAB. Sufficient real-world examples and use cases are included in the book to help you grasp the concepts quickly and apply them easily in your day-to-day work.

Tools to learn more effectively

Saving Books

Saving Books

Keyword Search

Keyword Search

Annotating Text

Annotating Text

Listen to it instead

Listen to it instead

Pattern Recognition through Classification Algorithms

Classification algorithms study how to automatically learn to make accurate predictions based on observations. Starting from a set of predefined class labels, the algorithm gives each piece of data input a class label in accordance with the training model. If there are just two distinction classes, we talk about binary classification; otherwise, we go for multi-class classification. In more detail, each category corresponds to a different label; the algorithm attaches a label to each instance, which simply indicates which class the data belongs to. A procedure that can perform this function is commonly called a classifier.
Classification has some analogy with regression, which we studied in Chapter 4, Finding Relationships between Variables - Regression Techniques. As well as regression, classification uses known labels of a training dataset to predict the response of the new test dataset. The main difference between regression and classification is that regression is used to predict continuous values, whereas classification works with categorical data.
For example, regression can be used to predict the future price of oil based on prices over the last 10 years. However, we should use the classification method to predict whether the price of oil will grow or decrease in the near future. In the first case, we use continuous data as a prediction and choose a continuous data response (the precise price of oil). In the second case, starting with continuous values ​​(the price of oil over the last 10 years), we begin by classifying the various phases where a growth/diminution of price has been recorded, and then we use that classification to predict a relative trend in the near future.
This chapter shows how to classify an object using several algorithms such as nearest neighbors, discriminant analysis, decision trees, and Naive Bayes. You'll understand how to use the principles of probability for classification. We'll also cover classification techniques using decision trees.
So, we will cover the following topics:
  • Decision trees
  • Naive Bayes algorithms
  • Discriminant analysis
  • k-Nearest Neighbors (KNN)
At the end of the chapter, we will be able to perform different types of classification techniques, understand the basic concepts of classification methods, and how to implement them in the MATLAB environment. We'll see how to prepare data for classification analyses and how to perform a KNN analysis. We'll understand the Naive Bayes algorithm and decision tree learners.

Predicting a response by decision trees

A decision tree is the graphic demonstration of a choice made or proposed. What seems most interesting is not always useful, and not always are things so clear that you can choose between two solutions immediately. Often, a decision is determined by a series of waterfall conditions. Expressing this concept with tables and numbers is difficult, and even if a table formally represents the phenomenon, it can confuse the reader because the justification of the choice is not immediately apparent.
A tree structure helps us extract the same information with greater readability by putting the right emphasis on the branch we have entered to determine the choice or evaluation. Decision tree technology is useful in identifying a strategy or pursuing a goal by creating a model with probable results. The decision tree graph immediately orients the reading of the result. A plot is much more eloquent than a table full of numbers. The human mind prefers to see the solution first and then go back to understand the justification of the solution, instead of a series of algebraic descriptions, percentages, and data to describe a result.
A decision tree consists of:
  • Nodes containing the names of independent variables
  • Branches labeled with the possible values of independent variables
  • Leaf nodes representing the classes, that is, collections of observations grouped according to the values of one independent variable and joined to nodes via branches
Through these tools, we assign a label to our data and classes to represent the confidence level of the classification itself. The tree thus provides the class's probability, that is, the level of belonging to the class. The following figure shows an example of a decision tree:
Figure 5.1: An example of a decision tree
Starting from already classified sets of data (training set), we try to define some rules that characterize the various classes. After testing the model with a test set, the resulting descriptions (classes) are generalized (inference or induction) and used to classify records whose membership class is unknown.
Decision trees are the simplest way of classifying objects into a finite number of classes. They are constructed by repeatedly dividing records into homogeneous subsets with respect to the target attribute, which must be categorical.
There are cases where classification rules are univariate, in the sense that they consider a single predictor (target attribute) at a time. However, there are multivariate algorithms too, in which the predictor is represented by a linear combination of variables.
The subdivision produces a hierarchy tree, where the subsets are called nodes, and the final or terminal are called leaf nodes. Specifically, nodes are labeled with the attribute name, branches are labeled with the possible values of the above attribute, and leaf nodes are labeled with the different values of the target attribute. I mean, the values that describe the membership classes.
An object is classified by following a path along the tree that leads from the root to a leaf. The paths represent the rules of classification or production rules. The branches are the values assumed by the different attributes. The leaves are the classifications. The rule is written along the tree from the node to the different leaves. All possible paths repres...

Table of contents

  1. Title Page
  2. Copyright
  3. Credits
  4. About the Author
  5. About the Reviewers
  6. www.PacktPub.com
  7. Customer Feedback
  8. Preface
  9. Getting Started with MATLAB Machine Learning
  10. Importing and Organizing Data in MATLAB
  11. From Data to Knowledge Discovery
  12. Finding Relationships between Variables - Regression Techniques
  13. Pattern Recognition through Classification Algorithms
  14. Identifying Groups of Data Using Clustering Methods
  15. Simulation of Human Thinking - Artificial Neural Networks
  16. Improving the Performance of the Machine Learning Model - Dimensionality Reduction
  17. Machine Learning in Practice

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn how to download books offline
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 990+ topics, we’ve got you covered! Learn about our mission
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more about Read Aloud
Yes! You can use the Perlego app on both iOS and Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app
Yes, you can access MATLAB for Machine Learning by Giuseppe Ciaburro in PDF and/or ePUB format, as well as other popular books in Computer Science & Artificial Intelligence (AI) & Semantics. We have over one million books available in our catalogue for you to explore.