A Course Summary: Introduction to Machine Learning by Andrew Ng

Salem Alqahtani
4 min readJun 9, 2022

In this series of articles, I will summarize the course materials that were taught by Andrew Ng. The course is available online and I will make it easy and short to follow.

To start, let me define what is machine learning(ML)? It is a computer program that learns from experience E with respect to some task T and some performance measure P, if its performance on T, as measured by P, improves with E. For instance, the spam algorithm is one real example of ML. The classification of emails to be either spam or non-spam according to the definition is T; labeling the email either spam or non-spam is E; the number of emails that are classified correctly is P.

After we know what ML is, the ML algorithms are divided into three major types called:

  1. supervised learning
  2. Unsupervised learning
  3. Reinforcement learning

Supervised learning works with data that has a correct output. Basically, the data with labels. Supervised learning problems are categorized into regression and classification problems. The regression problem predicts results within a continuous output. In the figure below, the learning algorithm represents blue and pink lines. The input variables are price and size.

Before starting the example, let me define what is the regression. Regression searches for relationships among variables. For example, you can observe several employees of some companies and try to understand how their salaries depend on their features, such as experience, education level, role, city of employment, and so on. This is a regression problem where data related to each employee represents one observation. The presumption is that the experience, education, role, and city are the independent features, while the salary depends on them.

The classification problem predicts results in a discrete output. In the figure below, the learning algorithm represents the black line. The input variables are age and tumor size.

Unsupervised learning uses machine learning algorithms to analyze and cluster unlabeled datasets. These algorithms discover hidden patterns or data groupings without the need for human intervention. Its ability to discover similarities and differences in information makes it the ideal solution for exploratory data analysis, customer segmentation, and image recognition.

The course starts with linear regression on a set of housing data. The data set, linear model, and output(hypothesis) form all parts needed for machine learning application. For illustration, take a look at the figure below.

The linear algorithm component is the key. The figure below summarizes the whole algorithm.

If the figure above seems hard to digest, here is another one that breaks the linear algorithm into mini-components.

For minimizing the parameters, look for the figure below. Every time we tune the hyperparameters of the learning algorithm, the cost function goes toward a minimum curve.

Here is my simple implementation of simple linear regression.

The next post is about gradient descent.

Reference:

--

--