Types of machine learning algorithms

Regardless of whether the learner is a human or machine, the basic learning process is similar. It can be divided into four interrelated components:

  • Data storage utilizes observation, memory, and recall to provide a factual basis for further reasoning.
  • Abstraction involves the translation of stored data into broader representations and concepts.
  • Generalization uses abstracted data to create knowledge and inferences that drive action in new contexts.
  • Evaluation provides a feedback mechanism to measure the utility of learned knowledge and inform potential improvements.

Machine learning algorithms are divided into categories according to their purpose.

Main categories are

  • Supervised learning (predictive model, “labeled” data)
    • classification (Logistic Regression, Decision Tree, KNN, Random Forest, SVM, Naive Bayes, etc)
    • numeric prediction (Linear Regression, KNN, Gradient Boosting & AdaBoost, etc)
  • Unsupervised learning (descriptive model, “unlabeled” data)
    • clustering (K-Means)
    • pattern discovery
  • Semi-supervised learning (mixture of “labeled” and “unlabeled” data).
  • Reinforcement learning. Using this algorithm, the machine is trained to make specific decisions. It works this way: the machine is exposed to an environment where it trains itself continually using trial and error. This machine learns from past experience and tries to capture the best possible knowledge to make accurate business decisions. Example of Reinforcement Learning: Markov Decision Process.

There are lots of overlaps in which ML algorithms are applied to a particular problem. As a result, for the same problem, there could be many different ML models possible. So, coming out with the best ML model is an art that requires a lot of patience and trial and error. Following figure provides a brief of all these learning types with sample use cases.

The supervised learning algorithms are a subset of the family of machine learning algorithms which are mainly used in predictive modeling. A predictive model is basically a model constructed from a machine learning algorithm and features or attributes from training data such that we can predict a value using the other values obtained from the input data. Supervised learning algorithms try to model relationships and dependencies between the target prediction output and the input features such that we can predict the output values for new data based on those relationships which it learned from the previous data sets. The main types of supervised learning algorithms include:

  • Classification algorithms: These algorithms build predictive models from training data which have features and class labels. These predictive models in-turn use the features learnt from training data on new, previously unseen data to predict their class labels. The output classes are discrete. Types of classification algorithms include decision treesrandom forestssupport vector machines, and many more.
  • Regression algorithms: These algorithms are used to predict output values based on some input features obtained from the data. To do this, the algorithm builds a model based on features and output values of the training data and this model is used to predict values for new data. The output values in this case are continuous and not discrete. Types of regression algorithms include linear regressionmultivariate regressionregression trees, and lasso regression, among many others.

Some application of supervised learning are speech recognition, credit scoring, medical imaging, and search engines.

The unsupervised learning algorithms are the family of machine learning algorithms which are mainly used in pattern detection and descriptive modeling. However, there are no output categories or labels here based on which the algorithm can try to model relationships. These algorithms try to use techniques on the input data to mine for rulesdetect patterns, and summarize and group the data points which help in deriving meaningful insights and describe the data better to the users. The main types of unsupervised learning algorithms include:

  • Clustering algorithms: The main objective of these algorithms is to cluster or group input data points into different classes or categories using just the features derived from the input data alone and no other external information. Unlike classification, the output labels are not known beforehand in clustering. There are different approaches to build clustering models, such as by using meansmedoidshierarchies, and many more. Some popular clustering algorithms include k-meansk-medoids, and hierarchical clustering.
  • Association rule learning algorithms: These algorithms are used to mine and extract rules and patterns from data sets. These rules explain relationships between different variables and attributes, and also depict frequent item sets and patterns which occur in the data. These rules in turn help discover useful insights for any business or organization from their huge data repositories. Popular algorithms include Apriori and FP Growth.

Some applications of unsupervised learning are customer segmentation in marketing, social network analysis, image segmentation, climatology, and many more.

Semi-Supervised Learning. In the previous two types, either there are no labels for all the observation in the dataset or labels are present for all the observations. Semi-supervised learning falls in between these two. In many practical situations, the cost to label is quite high, since it requires skilled human experts to do that. So, in the absence of labels in the majority of the observations but present in few, semi-supervised algorithms are the best candidates for the model building. These methods exploit the idea that even though the group memberships of the unlabeled data are unknown, this data carries important information about the group parameters.

The reinforcement learning method aims at using observations gathered from the interaction with the environment to take actions that would maximize the reward or minimize the risk. Reinforcement learning algorithm (called the agent) continuously learns from the environment in an iterative fashion. In the process, the agent learns from its experiences of the environment until it explores the full range of possible states.

In order to produce intelligent programs (also called agents), reinforcement learning goes through the following steps:

  1. Input state is observed by the agent.
  2. Decision making function is used to make the agent perform an action.
  3. After the action is performed, the agent receives reward or reinforcement from the environment.
  4. The state-action pair information about the reward is stored.

Some applications of the reinforcement learning algorithms are computer played board games (Chess, Go), robotic hands, and self-driving cars.

Predictive model

predictive model is used for tasks that involve the prediction of one value using other values in the dataset. The learning algorithm attempts to discover and model the relationship between the target feature (the feature being predicted) and the other features. Despite the common use of the word “prediction” to imply forecasting, predictive models need not necessarily foresee events in the future. For instance, a predictive model could be used to predict past events, such as the date of a baby’s conception using the mother’s present-day hormone levels. Predictive models can also be used in real time to control traffic lights during rush hours.

Because predictive models are given clear instruction on what they need to learn and how they are intended to learn it, the process of training a predictive model is known as supervised learning. The supervision does not refer to human involvement, but rather to the fact that the target values provide a way for the learner to know how well it has learned the desired task. Stated more formally, given a set of data, a supervised learning algorithm attempts to optimize a function (the model) to find the combination of feature values that result in the target output.

So, supervised learning consist of a target / outcome variable (or dependent variable) which is to be predicted from a given set of predictors (independent variables). Using these set of variables, we generate a function that map inputs to desired outputs. The training process continues until the model achieves a desired level of accuracy on the training data. Examples of Supervised Learning: Regression, Decision Tree, Random Forest, KNN, Logistic Regression etc.

The often used supervised machine learning task of predicting which category an example belongs to is known as classification. It is easy to think of potential uses for a classifier. For instance, you could predict whether:

  • An e-mail message is spam
  • A person has cancer
  • A football team will win or lose
  • An applicant will default on a loan

In classification, the target feature to be predicted is a categorical feature known as the class, and is divided into categories called levels. A class can have two or more levels, and the levels may or may not be ordinal. Because classification is so widely used in machine learning, there are many types of classification algorithms, with strengths and weaknesses suited for different types of input data.

Supervised learners can also be used to predict numeric data such as income, laboratory values, test scores, or counts of items. To predict such numeric values, a common form of numeric prediction fits linear regression models to the input data. Although regression models are not the only type of numeric models, they are, by far, the most widely used. Regression methods are widely used for forecasting, as they quantify in exact terms the association between inputs and the target, including both, the magnitude and uncertainty of the relationship.

Descriptive model

descriptive model is used for tasks that would benefit from the insight gained from summarizing data in new and interesting ways. As opposed to predictive models that predict a target of interest, in a descriptive model, no single feature is more important than any other. In fact, because there is no target to learn, the process of training a descriptive model is called unsupervised learning. Although it can be more difficult to think of applications for descriptive models, what good is a learner that isn’t learning anything in particular – they are used quite regularly for data mining.

So, in unsupervised learning algorithm, we do not have any target or outcome variable to predict / estimate. It is used for clustering population in different groups, which is widely used for segmenting customers in different groups for specific intervention. Examples of Unsupervised Learning: Apriori algorithm, K-means.

For example, the descriptive modeling task called pattern discovery is used to identify useful associations within data. Pattern discovery is often used for market basket analysis on retailers’ transactional purchase data. Here, the goal is to identify items that are frequently purchased together, such that the learned information can be used to refine marketing tactics. For instance, if a retailer learns that swimming trunks are commonly purchased at the same time as sunglasses, the retailer might reposition the items more closely in the store or run a promotion to “up-sell” customers on associated items.

The descriptive modeling task of dividing a dataset into homogeneous groups is called clustering. This is sometimes used for segmentation analysis that identifies groups of individuals with similar behavior or demographic information, so that advertising campaigns could be tailored for particular audiences. Although the machine is capable of identifying the clusters, human intervention is required to interpret them. For example, given five different clusters of shoppers at a grocery store, the marketing team will need to understand the differences among the groups in order to create a promotion that best suits each group.

Lastly, a class of machine learning algorithms known as meta-learners is not tied to a specific learning task, but is rather focused on learning how to learn more effectively. A meta-learning algorithm uses the result of some learnings to inform additional learning. This can be beneficial for very challenging problems or when a predictive algorithm’s performance needs to be as accurate as possible.

The following table lists only a fraction of the entire set of machine learning algorithms.

ModelLearning task
Supervised Learning Algorithms
Nearest NeighborClassification
Naive BayesClassification
Decision TreesClassification
Classification Rule LearnersClassification
Linear RegressionNumeric prediction
Model TreesNumeric prediction
Regression Trees
Neural NetworksDual use
Support Vector MachinesDual use
Unsupervised Learning Algorithms
Association RulesPattern detection
k-means clusteringClustering
Meta-Learning Algorithms
BaggingDual use
BoostingDual use
Random ForestsDual use

To begin applying machine learning to a real-world project, you will need to determine which of the four learning tasks your project represents: classification, numeric prediction, pattern detection, or clustering. The task will drive the choice of algorithm. For instance, if you are undertaking pattern detection, you are likely to employ association rules. Similarly, a clustering problem will likely utilize the k-means algorithm, and numeric prediction will utilize regression analysis or regression trees.

Torsten Hothorn maintains an exhaustive list of packages available in R for implementing machine learning algorithms.

Model evaluation

Whenever we are building a model, it needs to be tested and evaluated to ensure that it will not only work on trained data, but also on unseen data and can generate results with accuracy. A model should not generate a random result though some noise is permitted. If the model is not evaluated properly then the chances are that the result produced with unseen data is not accurate. Furthermore, model evaluation can help select the optimum model, which is more robust and can accurately predict responses for future subjects.

There are various ways by which a model can be evaluated:

  • Split test. In a split test, the dataset is divided into two parts, one is the training set and the other is test dataset. Once data is split the algorithm will use the training set and a model is created. The accuracy of a model is tested using the test dataset. The ratio of dividing the dataset in training and test can be decided on basis of the size of the dataset. It is fast and great when the dataset is of large size or the dataset is expensive. It can produce different result on how the dataset is divided into the training and test dataset. If the date set is divided in 80% as a training set and 20% as a test set, 60% as a training set and 40%, both will generate different results. We can go for multiple split tests, where the dataset is divided in different ratios and the result is found and compared for accuracy.
  • Cross validation. In cross validation, the dataset is divided in number of parts, for example, dividing the dataset in 10 parts. An algorithm is run on 9 subsets and holds one back for test. This process is repeated 10 times. Based on different results generated on each run, the accuracy is found. It is known as k-fold cross validation is where k is the number in which a dataset is divided. Selecting the k is very crucial here, which is dependent on the size of dataset.
  • Bootstrap. We start with some random samples from the dataset, and an algorithm is run on dataset. This process is repeated for n times until we have all covered the full dataset. In aggregate, the result provided in all repetition shows the model performance.
  • Leave One Out Cross Validation. As the name suggests, only one data point from the dataset is left out, an algorithm is run on the rest of the dataset and it is repeated for each point. As all points from the dataset are covered it is less biased, but it requires higher execution time if the dataset is large.

Model evaluation is a key step in any machine learning process. It is different for supervised and unsupervised models. In supervised models, predictions play a major role; whereas in unsupervised models, homogeneity within clusters and heterogeneity across clusters play a major role.

Some widely used model evaluation parameters for regression models (including cross validation) are as follows:

  • Coefficient of determination
  • Root mean squared error
  • Mean absolute error
  • Akaike or Bayesian information criterion

Some widely used model evaluation parameters for classification models (including cross validation) are as follows:

  • Confusion matrix (accuracy, precision, recall, and F1-score)
  • Gain or lift charts
  • Area under ROC (receiver operating characteristic) curve
  • Concordant and discordant ratio

Some of the widely used evaluation parameters of unsupervised models (clustering) are as follows:

  • Contingency tables
  • Sum of squared errors between clustering objects and cluster centers or centroids
  • Silhouette value
  • Rand index
  • Matching index
  • Pairwise and adjusted pairwise precision and recall (primarily used in NLP)

Bias and variance are two key error components of any supervised model; their trade-off plays a vital role in model tuning and selection. Bias is due to incorrect assumptions made by a predictive model while learning outcomes, whereas variance is due to model rigidity toward the training dataset. In other words, higher bias leads to underfitting and higher variance leads to overfitting of models.

In bias, the assumptions are on target functional forms. Hence, this is dominant in parametric models such as linear regression, logistic regression, and linear discriminant analysis as their outcomes are a functional form of input variables.

Variance, on the other hand, shows how susceptible models are to change in datasets. Generally, target functional forms control variance. Hence, this is dominant in non-parametric models such as decision trees, support vector machines, and K-nearest neighbors as their outcomes are not directly afunctional form of input variables. In other words, the hyperparameters of non-parametric models can lead to overfitting of predictive models.

A Guide to 4 Important Types of Machine learning With Use Cases

Artificial Intelligence (AI) has seen explosive growth in recent years, and the development of different types of Machine Learning (ML) has been a driving force behind it. The numbers speak for themselves: According to McKinsey, private equity and venture-capital funding in AI companies increased nearly fivefold from $16 billion in 2015 to $79 billion in 2022. It’s clear that businesses are eager to adopt AI/ML and explore its potential. However, with so many different types of machine learning available, it can be challenging to understand which one is best suited for a particular application. In this article, let’s take a closer look at the four main types of machine learning and their respective applications: supervised learning, unsupervised learning, semi-supervised learning, and reinforcement learning.

1. Supervised Learning

Supervised learning involves using labeled datasets to train algorithms for accurate classification or outcome prediction. During training, machines use labeled data to predict output in the future. The labeled data helps set a strategic path for machines as they map inputs to the output. Additionally, analysts use test datasets to check the accuracy of the analysis after training continuously. Various industries such as healthcare, finance, and marketing widely use supervised learning

Types of Supervised Learning

Supervised machine learning can be classified into two types of problems: classification and regression. Classification algorithms are utilized when the output variable is binary or categorical, making them ideal for identifying whether emails are spam or legitimate. On the other hand, regression algorithms are utilized to make predictions like weather and market conditions for problems that involve a linear relationship between the input and output variables.

Applications of Supervised Learning

  • Medical diagnosis 
  • Fraud detection 
  • Spam detection 
  • Speech recognition

2. Unsupervised Learning

Unsupervised learning is one of the four main types of machine learning techniques. It utilizes unlabeled and unclassified datasets to make predictions without human intervention. This method is useful for categorizing or grouping unsorted data based on similarities and differences, as well as discovering hidden patterns and trends in the input data. Unlike supervised learning, unsupervised learning algorithms learn from the data without any fixed output variable, making them suitable for complex tasks. They identify hidden patterns or groupings in the data; this makes them ideal for clustering, anomaly detection, and exploratory data analysis. 

Types of Unsupervised Learning 

Types of machine learning

Unsupervised learning can be classified into two main techniques: clustering and association. Cluster analysis is an unsupervised learning technique that involves grouping data points based on their similarities, differences, or features without prior knowledge or labels. Businesses commonly use this technique in applications such as retail marketing, email marketing, and streaming services to identify similarities and patterns.On the other hand, association is an unsupervised learning technique where machines discover interesting relations and connections among variables in large input datasets. Businesses commonly use associations for applications such as web usage mining, plagiarism checking, developing recommendations, and continuous production.

Applications of Unsupervised Learning   

  • Anomaly detection to identify fraud transactions
  • Forecasting and predictive modeling
  • Identifying and targeting market segments 
  • Recommendation systems to suggest products or services

3. Semi-Supervised Learning

Semi-supervised learning is a highly efficient and cost-effective machine learning technique combining labeled and unlabeled data during training. It allows machines to learn from all the available data by utilizing both supervised and unsupervised learning advantages. This method first uses unsupervised learning algorithms to group similar data. Thereafter, this labels previously unlabeled data, making the dataset more robust for training. Additionally, semi-supervised learning enables machines to improve their accuracy and performance.

Types of Semi-Supervised Learning

Semi-supervised machine learning includes self-supervised learning and multiple-instance learning. The self-supervised learning technique frames the problem as a supervised learning task to generate labeled data from unlabeled data. This approach is particularly useful when obtaining labeled data is relatively inexpensive. Additionally, it has shown impressive results in various applications. Notably, Google and Facebook utilize self-supervised techniques in computer vision and natural language processing.On the other hand, multiple-instance learning provides weakly supervised learning where bags containing training instances are labeled instead of individual instances.  This approach allows leveraging weakly labeled data often present in business problems due to the high cost of labeling. Furthermore, it is useful in scenarios where only partial information is available and has been applied in various fields, including medical diagnosis, image classification, and natural language processing.

Applications of Semi-Supervised Learning 

  • Medical image analysis
  • Speech recognition and natural language processing 
  • Text classification and sentiment analysis
  • Fraud detection in finance

4. Reinforcement Learning

Reinforcement learning is a machine learning technique where an agent learns to take optimal actions through environmental feedback. Unlike other types of machine learning, this technique does not rely on labeled data. Instead, it utilizes a trial-and-error approach with a feedback-based process that allows the agent to learn from its experiences. One of the main advantages of reinforcement learning is its ability to learn from experience and improve performance over time.

Types of Reinforcement Learning

Reinforcement learning includes positive reinforcement learning and negative reinforcement learning. Positive reinforcement learning is a type of learning where the agent is rewarded for taking actions that lead to positive outcomes. The reward can be a numerical value, such as a score or a probability, or a symbolic value, such as a label or a tag. Negative reinforcement learning, on the other hand, is a type of learning where the agent is punished for taking actions that lead to negative outcomes. Here, the agent learns to avoid actions that result in punishment and instead takes actions that lead to positive outcomes.

Applications of Reinforcement Learning

  • Types of machine learningBuilding intelligent robotics
  • Developing personalized treatment plans for patients
  • Autonomous vehicles 
  • Game playing 

ALSO READ: What is Classification in Machine Learning and Why is it Important?

Frequently Asked Questions 

How Does Reinforcement Learning Differ from Supervised and Unsupervised Learning?

Reinforcement learning involves an agent learning to take actions that maximize a reward signal provided by the environment. Therefore, this learning process enables the agent to develop a policy that maps states to actions to achieve its goal. In contrast, supervised learning requires labeled data to learn how to make predictions, while unsupervised learning attempts to find patterns or structures in unlabeled data without any feedback signal.

What Types of Algorithms Fall Under the Category of Supervised Learning?

Common supervised learning algorithms include Linear Regression, Logistic Regression, Random Forest, Decision Trees, Naive Bayes, and Neural Networks. These perform various tasks such as regression, classification, and prediction, using labeled data for training.

What is Deep Learning, and How Does it Fit into the Different Types of Machine Learning?

Machine learning and deep learning are forms of AI. Specifically, machine learning is an AI that can learn and adapt automatically with minimal human intervention. On the other hand, deep learning is a subcategory of machine learning that uses artificial neural networks to imitate the human brain’s learning process. 

ALSO READ: How AI is Changing Cybersecurity: New Threats & Opportunities 

To conclude, it is evident that these types of machine learning are crucial components of the ever-growing digital world. As technology advances, the demand for professionals specializing in machine learning will only increase. If you’re interested in pursuing a career in this field, explore the machine learning and artificial intelligence courses Emeritus offers in collaboration with some of the world’s best universities.

Introduction to Machine Learning and Three Common Algorithms

Imagine asking a computer to identify a picture of a cat or a dog without any supporting data; the computer has a 50/50 chance of being correct in this scenario. Now, imagine writing a program that teaches a computer how to actively learn the difference between the animals by analyzing photos of both. 

This is the essence of machine learning. As humans, we learn from experience while machines generally follow our instructions. However, with machine learning, we can train computers to learn from data and perform high-level analyses and predictions. Machine learning is one of modern technology’s most promising concepts, one with boundless applications across most industries.

If you’re interested in a technology-related career, there’s a good chance that a working knowledge of machine learning will make you more marketable. In fact, some jobs focus specifically on incorporating machine learning advancements in order to help businesses gain a competitive advantage



What Is Machine Learning?

The simplest machine learning definition is this: the science of teaching computers how to learn like humans. Machine learning requires algorithms to examine huge datasets, find patterns within that data, and then make assessments and predictions based on those patterns. Essentially, it is a branch of artificial intelligence (AI) that shifts the rules of programming as we conventionally understand them. 

Normally, programmers write programs where they input data and rules and the computer follows those rules to produce an answer. With machine learning, programmers input the data and the answer, and the computer determines the rules for producing that answer. In the earlier pet picture example, programmers would input the answer (“This is a photo of a cat”), the data (photos of cats and dogs), and the computer would use an algorithm to learn the difference.

Machine learning is applied in many familiar ways. Your favorite streaming service uses machine learning to recommend movies and shows based on your viewing habits; financial institutions use it to spot fraud in billions of transactions and devise ways to prevent it; self-driving cars use it to learn directional commands; and phones use it to enact accurate facial recognition.

According to a 2020 study, the global size of the machine learning market was valued at $6.9 billion in 2018. It is projected to increase nearly 44 percent through 2025 as companies seek to optimize their supply chains and use more digital resources to reach customers.

To be effective, machine learning needs detailed pieces of data from diverse sources. Algorithms learn best when they can apply vast amounts of data to a specific model. For example, the more photos of dogs and cats you input, the better the algorithm will become in identifying the differences between the animals.

The term “machine learning” is often used synonymously with artificial intelligence and, while these concepts share similarities, they are generally used for different purposes. AI is the broad science of training machines to perform human tasks, while machine learning is one of many AI-based methods of accomplishing that training.

Machine Learning Algorithm Types

Algorithms are the procedures that computers use to perform pattern recognition on data models and create an output. Many types of algorithms exist, and they fall into four primary groups: supervised learning, unsupervised learning, semi-supervised learning, and reinforcement learning. 

a chart comparing algorithm types within machine learning.

Supervised Learning

Supervised learning is a process where labeled input data and the correct answers are both given to a computer so that it can learn how to reach the correct answer on its own. The correct answer, or output, can refer to an object, a situation, or a problem that needs to be solved.

There are two types of supervised learning: classification and regression. Classification is simply the process of sorting identified data into groups. To illustrate, let’s apply classification to our cats and dogs example: The programmer inputs labeled photos of cats and dogs so the computer knows which photo shows which type of animal. Using that training data set to learn how to identify the pictures, the computer can then apply its knowledge to a new data set and label them correctly. The more photos the computer analyzes, the faster and more accurate it becomes at classifying the data. 

The second type of supervised learning is regression, which enables the computer to forecast likely future or desirable outcomes from a labeled data set. Different types of regression are used to forecast future sales, anticipated stock performanced, or the impact of financial events on the global economy. However, regression can be used for far more than financial analysis.

Here are some other examples: 

Social Media

Facebook offers you a friend suggestion because it recognizes your friend in a photo album of tagged pictures.

Streaming Suggestions

Netflix recommends movies for you to watch based on your past viewing choices, ratings, and the viewing habits of subscribers with similar tastes.

Predicting Home Prices

Realtors use machine learning to analyze housing data (location, square footage, number of bedrooms, added features like pools, etc.) in comparison to other properties to understand not only how to best price a property, but also how that price will impact days on the market and likely closing dates for their clients.

Suggesting Further Purchases

When you check out a cart full of items at the grocery store, those purchases become data. Retailers use that data in many ways — such as predicting future purchases, making suggestions, or offering coupons as incentives.

Unsupervised Learning

Unsupervised learning refers to the process in which a computer finds nonintuitive patterns in unlabeled data. It’s different from supervised learning because the datasets are not labeled and the computer is not given a specific question to answer. 

There are many different types of unsupervised learning including K-means clustering, hierarchical clustering, anomaly detection, and principal component analysis to name a few. The most commonly discussed uses are clustering and anomaly detection.

Clustering is used to find natural groups, or clusters, within a dataset. These clusters can be analyzed to group like customers together (e.g, customer segmentation), identify products that are purchased at the same time (e.g., peanut butter and jelly), or better understand the attributes of successful executives (e.g., technical skills, personality profile, education).

In our dogs and cats example, assume you input pictures of dogs and cats but don’t label them. Using clustering, the computer will look for common traits (body types, floppy ears, whiskers, etc.) and group the photos. However, while you may expect the computer to group the photos by dogs vs. cats, it could group them by fur color, coat length, or size. The benefit of clustering is that the computer will find nonintuitive ways of looking at data which enable the discovery of new data trends (e.g., there are twice as many long-coated animals as short-coated) which allow for new marketing opportunities (e.g., dry pet shampoo and brush marketing increases).

In anomaly detection, however, the computer looks for rare differences rather than commonalities. For example, if we used anomaly detection on our dog and cat photos, the computer might flag the photo of a Sphynx cat because it is hairless or an albino dog due to its lack of color.

Here are some other applications of anomaly detection.

Finding Fraud

Banks analyze all sorts of transactions: deposits, withdrawals, loan repayments, etc. Unsupervised learning can group these data points and flag outlier transactions (e.g., transactions that don’t align with the majority of data points) that may indicate fraud.

Consumer Studies

Companies use anomaly detection to identify and understand actions competitors may take in the marketplace. For example, a retailer may expect to take three share points in every new market they open a store during the first month of operations; however, they may notice certain new stores are underperforming and don’t know why. Anomaly detection can be used to identify likely competitive activity which is preventing share growth. Specifically, the anomaly of common products not being found in their shoppers’ baskets (e.g., bread, milk, eggs, chicken breast) which may indicate covert competitor incentives that are successfully impacting the retailer’s shopper frequency and average order size.

Image Recognition

Computers use unsupervised learning to perform all sorts of image recognition tasks including  facial recognition to open your mobile phone and healthcare imaging where identifying cell-structure anomalies can assist in cancer diagnosis and treatment.

Semi-Supervised Learning

Semi-supervised learning is essentially a combination of supervised and unsupervised learning techniques. It merges a small amount of manually labeled data (a supervised learning element) as a basis for autonomously defining a large amount of unlabeled data (an unsupervised element). Through data clustering, this method makes it possible to train a machine learning algorithm (ML algorithm) on data annotation (e.g., the labeling or classification of data) without manually labeling all of the training data first, potentially increasing efficiency without sacrificing quality or accuracy. 

For example, if you have a large data set consisting of dogs and cats, a semi-supervised approach would allow you to manually label a small portion of that data (identifying a few pictures as “dogs” and a few others as “cats”), and the ML algorithm would then be equipped to properly define the remaining data. This blends the benefits of supervised and unsupervised learning by nudging the algorithm to make strong autonomous decisions with less initial human oversight. 

Image Classification

While higher-level image classification often requires a fully supervised approach (due to the necessary labeling of a large amount of initial training data), specific image classification scenarios can benefit from semi-supervised learning. For example, to annotate images of handwritten numbers, training data must be clustered to include the most representative variations of the written numbers and can then be used to inform the ML algorithm. In turn, the algorithm should be able to identify unlabeled images of handwritten numbers with relatively high accuracy, yielding the intended outcome with less initial oversight. 

Document Classification

Similarly, semi-supervised learning can be useful in document classification, eliminating the need for human workers to read through numerous text documents just to broadly classify them. A semi-supervised approach allows the algorithm to learn from a relatively small amount of text data so that it can identify and classify the larger amount of unlabeled documents. 

Reinforcement Learning

Reinforcement learning is the process by which  a computer learns how to behave in a certain environment by performing an action and seeing a specific result. In this process, the key terms to know are agents and environments. Agents interact with the environment through actions and receive feedback regarding those actions. Consider it similar to the first time you (the agent) touched a hot stove (the environment) — the feedback from the action (e.g., pain of touching the stove) reinforced the idea that you shouldn’t touch a hot stove again.

Reinforcement can also be applied to our cats and dogs scenario. If you input an image of a dog and the computer says it’s a cat, you can then correct that answer. The computer will learn from that correction, or reinforcement, and increase its ability to properly identify the image over time and through repetition of the process.

Reinforcement is a growing method of machine learning because of its applications in robotics and automation. Consider these examples:

Self-Driving Cars

Autonomous vehicles interpret a huge amount of data through cameras, sensors, and radar that monitor their surroundings. Reinforcement learning contributes to the real-time decision-making process. 

Industry Automation

Companies automate tasks in warehouses and production facilities through robotics that operate on reinforcement learning models.

Healthcare

Reinforcement learning is becoming more common in medicine because its methodology (e.g., learning from interactions in an environment) often mirrors that of diagnosis and treating diseases.

Gaming

Reinforcement learning algorithms are popular for video games because they learn quickly and can mimic human performance. Reinforcement is one way computers learn how to master games from chess to complex video games, allowing bot players to engage with human players in a realistic way.

Machine Learning Jobs

As we look to automate more processes at work and in our daily lives, machine learning will become more valuable. Machine learning is important to data science, artificial intelligence, and robotics (among many other fields). 

Where can knowledge of machine learning take you? Here are a few potential careers to consider. 

a graphic breaking down the projected employment growth for machine learning jobs according to the U.S. Bureau of Labor Statistics.
  • Machine Learning Engineer: Though coding is required, this role is a bit different than that of a computer programmer. Machine learning engineers build programs that teach computers how to identify patterns and perform tasks based on those patterns. This is an ideal career path for those who want to get into robotics.
  • Machine Learning Data Scientist: Data scientists combine statistics, programming, and data analysis to generate insight from data — a skill that is in high demand. According to the U.S. Bureau of Labor Statistics (BLS), the demand for computer and information research scientists is expected to grow by 15 percent through 2029. Machine learning is an important component of becoming a data scientist.
  • NLP Scientist: When you ask Siri or Alexa a question, they answer because of natural language processing (NLP). NLP scientists work in a unique world of textual data analysis, linguistics, and computer programming to facilitate communication between humans and machines.
  • Business Intelligence Developer: Companies need ways to harness, assess, and report all the data they collect, and business intelligence (BI) provides that framework. BI developers work with data warehouses, visualization software, and other tools to explain what is happening. BI is also vital in generating ways to benefit from consumer data.
  • Data Analyst: Want to help companies and organizations make sense of their data? Then you may want to consider becoming a data analyst. You’ll learn how to mix statistics, business knowledge, and communication skills to bring data to life. As data generation grows, so do the job prospects for analysts. The BLS projects a 25 percent increase by 2029.

Want to learn more about the function of machine learning in data science? Check out this guide to understanding data science roles.

Machine Learning FAQs

What is machine learning like for beginners?

Machine learning requires a solid foundation in fields like math, statistics, and programming. Calculus and linear algebra are important starting points, as is the ability to code. A great way to learn about machine learning, and other data science skills, is to enroll in a data science boot camp.

What is a good introduction to machine learning?

What is an example of machine learning?

Ready to take the next step in a career that involves machine learning? Consider a bootcamp in data science and analytics. The 24-week online program at Georgia Tech Data Science and Analytics Boot Camp is a great way to learn in-demand skills to get you ready for your job search. Contact us today to get started.

Machine learning algorithms

Machine learning (ML) is a type of algorithm that automatically improves itself based on experience, not by a programmer writing a better algorithm. The algorithm gains experience by processing more and more data and then modifying itself based on the properties of the data.

Types of machine learning

There are many varieties of machine learning techniques, but here are three general approaches:

  • reinforcement learning: The algorithm performs actions that will be rewarded the most. Often used by game-playing AI or navigational robots.
  • unsupervised machine learning: The algorithm finds patterns in unlabeled data by clustering and identifying similarities. Popular uses include recommendation systems and targeted advertising.
  • supervised machine learning: The algorithm analyzes labeled data and learns how to map input data to an output label. Often used for classification and prediction.

Let’s dive into one of the most common approaches to understand more about how a machine learning algorithm works.

Neural networks

An increasingly popular approach to supervised machine learning is the neural network. A neural network operates similarly to how we think brains work, with input flowing through many layers of “neurons” and eventually leading to an output.

Diagram of a neural network, with circles representing each neuron and lines representing connections between neurons. The network starts on the left with a column of 3 neurons labeled "Input". Those neurons are connected to another column of 4 neurons, which itself connects to another column of 4, and those neurons are labeled "Hidden layers". The second hidden layer of neurons is connected to a column of 3 neurons labeled "Output".

Diagram of a neural network, with circles representing each neuron and lines representing connections between neurons. The network starts on the left with a column of 3 neurons labeled “Input”. Those neurons are connected to another column of 4 neurons, which itself connects to another column of 4, and those neurons are labeled “Hidden layers”. The second hidden layer of neurons is connected to a column of 3 neurons labeled “Output”.

Training a network

Computer programmers don’t actually program each neuron. Instead, they train a neural network using a massive amount of labeled data.

The training data depends on the goal of the network. If its purpose is to classify images, a training data set could contain thousands of images labeled as “bird”, “airplane”, etc.

A grid of images in 10 categories (airplane, automobile, bird, cat, deer, dog, frog, horse, ship, truck).

A grid of images in 10 categories (airplane, automobile, bird, cat, deer, dog, frog, horse, ship, truck).

Images from the CIFAR10 training data set. Image source: CIFAR10

The goal of the training phase is to determine weights for the connections between neurons that will correctly classify the training data.

A diagram of a neural network classifying an image of a plane. Parts of the image are fed into the first layer of neurons, those neurons lead to a middle layer, and those neurons lead to a final layer of neurons. Each edge between neurons is labeled with a question mark, denoting an unknown weight.

A diagram of a neural network classifying an image of a plane. Parts of the image are fed into the first layer of neurons, those neurons lead to a middle layer, and those neurons lead to a final layer of neurons. Each edge between neurons is labeled with a question mark, denoting an unknown weight.

The weights between the neurons are unknown (labeled with a “?” here), and the neural network wants to find weights that will result in classifying each image correctly.

The neural network starts off with all the weights set to random values, so its initial classifications are way off. It learns from its mistakes, however, and eventually comes up with a set of weights that do the best job at classifying all of the training data.

A diagram of a neural network classifying an image of a plane. Parts of the image are fed into the first layer of neurons, those neurons lead to a middle layer, and those neurons lead to a final layer of neurons. Each neuron has a weight (from 0 to 1). In the final layer, the neuron labeled "plane" has the highest weight.

A diagram of a neural network classifying an image of a plane. Parts of the image are fed into the first layer of neurons, those neurons lead to a middle layer, and those neurons lead to a final layer of neurons. Each neuron has a weight (from 0 to 1). In the final layer, the neuron labeled “plane” has the highest weight.

Each of the connections between neurons is assigned a weight (represented by shades of green). A neuron multiplies each connection weight by the value of the input neuron, and sums up all of those to come up with a single number (shown on each neuron). The neuron will only send its value to the next layer if it’s above a threshold.

Using the network

When the neural network is asked to classify an image, it uses the learned weights and outputs the possible classes and their probabilities.

Diagram of a neural network, with circles representing each neuron and lines representing connections between neurons. The network starts on the left with an image of a fox. The image is broken into 4 parts, and those parts are connected to column of 4 neurons, which itself connects to another column of 4. The second column is connected to 3 possible outputs: "Fox (0.85)", "Dog (0.65)", and "Cat (0.25)".

Diagram of a neural network, with circles representing each neuron and lines representing connections between neurons. The network starts on the left with an image of a fox. The image is broken into 4 parts, and those parts are connected to column of 4 neurons, which itself connects to another column of 4. The second column is connected to 3 possible outputs: “Fox (0.85)”, “Dog (0.65)”, and “Cat (0.25)”.

Accuracy

The accuracy of a neural network is highly dependent on its training data, both the amount and diversity. Has the network seen the object from multiple angles and lighting conditions? Has it seen the object against many different backgrounds? Has it really seen all varieties of that object? If we want a neural network to truly understand the world, we need to expose it to the huge diversity of our world.

Companies, governments, and institutions are increasingly using machine learning to make decisions for them. They often call it “artificial intelligence,” but a machine learning algorithm is only as intelligent as its training data. If the training data is biased, then the algorithm is biased. And unfortunately, training data is biased more often than it’s not.

In the following articles, we’ll explore the ramifications of letting machines make decisions for us based on biased data.

AI Engineering 101: A Brief Guide to Intelligent Systems

Artificial intelligence is rapidly advancing and becoming more prevalent in our daily lives. From chatbots to autonomous vehicles, AI is changing the way we interact with technology. 

But creating AI-powered systems is not a simple task. It requires a specialized skill set to build AI platforms. 

That’s where AI engineering comes in. 

Defining AI Engineering

AI engineering is the process of designing and developing intelligent systems and applications that can learn and adapt from data. AI engineers use various techniques such as machine learning, deep learning, natural language processing, and reinforcement learning to build intelligent systems that can perform complex tasks, such as image recognition, speech recognition, text analysis, and decision-making.

Machine Learning vs AI Engineering

You might be wondering, “Wait, isn’t that just machine learning?” Fair question. Because AI is an evolving field, the exact definitions of and relationship between the machine learning and AI engineering disciplines can be confusing.

Generally speaking, machine learning and AI engineering are two related but distinct fields within the broader field of artificial intelligence. You can also think of machine learning as an important tool used by AI engineers to build intelligent systems, making it one part of the broader field of AI engineering.

Machine learning is a subfield of AI that focuses on developing algorithms that can learn from and make predictions or decisions on data without being explicitly programmed to do so. In other words, it is a set of techniques that enable machines to learn from data and improve their performance on specific tasks over time. Machine learning techniques include supervised learning, unsupervised learning, reinforcement learning, and deep learning.

AI engineering, on the other hand, is the broader field that encompasses the development, deployment, and maintenance of AI systems. It involves applying the principles of software engineering to build robust, scalable, and maintainable AI systems. AI engineering includes designing and implementing AI models, deploying them in production environments, and managing the data infrastructure needed to support the models. It also involves ensuring that the AI system is secure, reliable, and efficient.

In essence, machine learning is a subfield of AI that focuses on the development of algorithms that enable machines to learn from data, while AI engineering is the application of software engineering principles to build and deploy AI systems. 

How AI Engineering Works

The process of AI engineering typically involves the following stages:

Problem identification: The purpose of any AI model is to solve a business or consumer problem. To develop a successful AI model, engineers start by identifying the exact pain point the AI will solve. For example, many knowledge workers have trouble keeping up with tight production schedules. Conversational AI models like ChatGPT solve this problem by automating labor intensive tasks like coding, writing, and research.

Data collection: AI engineering begins with the collection of relevant data from various sources. The data can be in different formats such as text, images, audio, or video. The quality of the data is crucial as it affects the accuracy of the AI-powered system.

Data preprocessing: The collected data needs to be cleaned and preprocessed to remove any noise or inconsistencies. The data is then transformed into a format that can be used for training and building AI models.

Algorithm Development: AI engineers use various machine learning algorithms such as regression, clustering, classification, and neural networks to build intelligent systems. The choice of algorithm depends on the nature of the problem and the type of data being used.

Model Training: Once the algorithm is selected, the next stage involves training the model using the preprocessed data. The model is trained using various optimization techniques to improve its accuracy and performance.

Model Evaluation: After the model is trained, it needs to be evaluated to ensure that it performs well on new data. AI engineers use various evaluation metrics such as precision, recall, and F1 score to assess the performance of the model.

Deployment: The final stage of AI engineering involves deploying the model in a production environment. The model needs to be integrated with other systems and tested to ensure that it works correctly.

AI Engineering Skills

AI engineering is a multidisciplinary field that requires expertise in various areas such as computer science, mathematics, statistics, and domain knowledge. Here are some of the essential skills required to become an AI engineer.

Programming

AI engineers need to have a good understanding of programming languages such as Python, R, and Java, as well as machine learning libraries like TensorFlow and PyTorch.

Mathematics and Statistics

A strong foundation in mathematics and statistics is essential for AI engineering. AI engineers need to be proficient in calculus, linear algebra, probability, and statistics.

Machine Learning

AI engineers need to have a deep understanding of machine learning algorithms and techniques such as deep learning, supervised and unsupervised learning, reinforcement learning, and neural networks.

Data Analysis and Management

AI engineers need to be skilled in data analysis and management, including data cleansing, pre-processing, feature extraction, and data visualization.

Problem-Solving Skills

AI engineers must be adept at problem-solving and troubleshooting. They need to be able to analyze complex problems, identify potential solutions, and test and implement the best approach.

Communication Skills

AI engineers need to be able to communicate technical concepts and ideas to both technical and non-technical stakeholders.

Creativity

AI engineers must be creative and have a strong imagination to come up with innovative solutions to complex problems.

Domain Knowledge

AI engineers must have domain knowledge in the area they are working on. For example, a healthcare AI engineer would have knowledge of healthcare processes and regulations.

Continuous Improvement

AI is a fast-evolving field, so AI engineers need to be committed to continuous learning to keep up with new technologies and techniques.

Collaboration Skills

AI engineering is often a team effort, so AI engineers need to be able to work collaboratively with other team members, such as data scientists, product managers, and business stakeholders.

Conclusion

AI engineering is an exciting field that is rapidly evolving and has immense potential to transform various industries. It requires a multidisciplinary skill set, and AI engineers should be proficient in programming, machine learning, data management, deep learning, and deployment. With the increasing demand for AI-powered systems, AI engineering is set to become one of the world’s most sought-after skills.

How to Choose a Machine Learning Technique

Why are there so many machine learning techniques? The thing is that different algorithms solve various problems. The results that you get directly depend on the model you choose. That is why it is so important to know how to match a machine learning algorithm to a particular problem.

In this post, we are going to talk about just that. Let’s get started.

Variety of machine learning techniques

First of all, to choose an algorithm for your project, you need to know about what kinds of them exist. Let’s brush up your knowledge of different classifications.

Algorithms grouped by learning style

It’s possible to group the algorithms by their learning style.

Supervised learning

In the case of supervised learning, machines need a “teacher” who “educates” them. In this case, a machine learning specialist collects a set of data and labels it. Then, they need to communicate the training set and the rules to the machine. The next step is to watch how the machine manages to process the testing data. If there are some mistakes made, the programmer corrects them and repeats the action until the algorithm works accurately.

Unsupervised learning

This type of machine learning doesn’t require an educator. A computer is given a set of unlabeled data. It is supposed to find the patterns and come up with insights by itself. People can slightly guide the machine along the process by providing a set of labeled training data as well. In this case, it is called semi-supervised learning.

Reinforcement learning

Reinforcement learning happens in an environment where the computer needs to operate. The environment acts as the teacher providing the machine with positive or negative feedback that is called reinforcement.

List of Common AI algorithms

You can find a more detailed explanation about these techniques in our post on the difference between AI and machine learning.

Machine learning techniques grouped by problem type

Another way to divide the techniques into groups is based on the issues they solve.

In this section, we will talk about classification, regression, optimization, and other groups of algorithms. We are also going to have a look at their use in industry. For more detailed information about every common machine learning algorithm, check out our post about machine learning algorithm classification.

Common algorithms

Here are the most popular ML algorithms. Sometimes they belong to more than one group because they are effective at solving more than one problem.

  • Logistic Regression,
  • Linear Regression
  • Decision Tree
  • SVM
  • Naive Bayes
  • k-NN
  • K-Means
  • Neural networks
  • Random Forest
  • Dimensionality Reduction Algorithms
  • Gradient Boosting algorithms
AI algorithms

To help you orient yourself in the post, use this pic. It features common algorithms that we are going to talk about in this post.

Classification

Classification helps us to deal with a wide range of problems. It allows us to make more informed decisions, sort out spam, predict whether the borrower will return the loan, or tag friends in a Facebook picture.

ml classification applications

These algorithms predict discrete variable labels. A discrete variable has a countable number of possible values and can be classified. The accuracy of the prediction depends on the model that you choose.

Imagine that you develop an algorithm that predicts whether a person has or does not have cancer. In this case, the model that you choose should be very precise in predicting the result.

Typical classification algorithms are logistic regression, Naive Bayes, and SVM. More information about them and other algorithms you can find in our blog.

Clustering

Sometimes you need to divide things into categories but you don’t know what these categories are. Classification uses predefined classes to assign to objects. On the other hand, clustering allows to identify similarities between objects, and then group them according to the characteristics they have in common. This is the mechanics that lays behind detecting fraud, analyzing documents, grouping clients, and more. Clustering is widely used in sales and marketing for customer segmentation and personalized communication.

K-NN, k-means clustering, Decision trees, Random forest can all be used for clustering tasks.

Prediction

Trying to find out the relationship between two or more continuous variables is a typical regression task.

Note: If a variable can take on any value between its minimum value and its maximum value, it is called a continuous variable.

An example of such a task is predicting housing prices based on their size and location. The price of the house in this case is a continuous numerical variable.

Linear regression is the most common algorithm in this field. Multivariate regression algorithms, Ridge Regression, and LASSO regression are used when you need to model a relationship between more than two variables.

Optimization

Machine learning software enables you to provide a data-driven approach to continuous improvement in practically any field. You can apply product usage analytics in order to discover how the new product features affect demand. Sophisticated software equipped with empirical data helps to uncover ineffective measures, allowing you to avoid unsuccessful decisions.

For example, it is possible to use a heterarchical manufacturing control system in order to improve the capacity for a dynamic manufacturing system to adapt and self-manage. Machine learning techniques uncover the best behavior in various situations in real-time – which leads to continuous improvement of the system.

Gradient descent algorithms are generally used in ML to work with optimization.

Anomaly detection

Financial institutions lose about 5% of revenue each year to fraud. By building models based on historical transactions, social network information, and other sources of data, it is possible to spot anomalies before it’s too late. This helps detect and prevent fraudulent transactions in real-time, even for previously unknown types of fraud.

Typical anomaly detection algorithms are SVM, LOF, k-NN, k-means.

Ranking

You can apply machine learning to build ranking models. Machine learning ranking (MLR) usually involves the application of supervised, semi-supervised, or reinforcement algorithms. An example of a ranking task is search engine systems like SearchWiki by Google.

Examples of ranking algorithms are RankNet, RankBoost, RankSVM, and others.

Recommendation

Recommender systems offer valuable suggestions to users. This method brings utility to users and also benefits the companies because it motivates their clients to buy more or explore more content.

recommendation systems

Items are ranked according to their relevance. The most relevant ones are displayed to the user. The relevancy is determined based on historical data. You know how it works if you’ve ever watched anything on Youtube or Netflix. The systems offer you similar videos to what you have already watched.

The main algorithms used for recommender systems are collaborative filtering algorithms and content-based systems.

How to choose machine learning techniques to solve your problem

How to find the best machine learning algorithm for your problem? There are three basic approaches you can use.

Task-based learning

Categorize your problem. It’s possible to categorize tasks by input and by output.

By input:

  • If you have a set of labeled data or can prepare such a set, it is the domain of supervised learning.
  • If you still need to define a structure, it’s an unsupervised learning problem.
  • If you need the model to interact with an environment, you will apply a reinforcement learning algorithm.

By output:

  • If the output of the model is a number, it’s a regression problem.
  • If the output of the model is a class and the number of expected classes is known, it’s a classification problem.
  • If the output of the model is a class but the number of expected classes is unknown, it’s a clustering problem.
  • If you need to improve performance, it’s optimization.
  • If you want a system to offer options based on the history of actions, it’s a recommendation problem.
  • If you want to obtain insights from data, apply pattern recognition models.
  • If you want to detect problems, use anomaly detection algorithms.

Understand your data

The process of choosing the algorithm isn’t limited to categorizing the problem. You also need to have a closer look at your data because it plays an important role in the selection of the right algorithm for the problem. Some algorithms function normally with smaller sample sets while others require a huge number of samples. Certain algorithms work with categorical data while others only work with numerical input.

Understanding your data demands certain steps:

  • Processing. The components of data processing are pre-processing, profiling, cleansing, pulling together data from different internal and external sources.
  • Feature engineering. You need to transform raw data into features that can represent the underlying problem to the predictive models. It helps to improve accuracy and get the desired results faster.

Choosing the algorithm is a comprehensive task that demands the analysis of a variety of factors.

Other things that might affect the choice of a model:

  • Accuracy of the model;
  • Interpretability of the model;
  • Complexity of the model;
  • Scalability of the model;
  • Time it takes to build, train, and test the model;
  • Time it takes to make predictions using the model;
  • If the model meets your business goals.

Trial and error approach

Sometimes the problem is too complex and you do not know where to start. More than one model seems like a good fit, and it is difficult to predict which one will turn out the most effective. In this case, you can test a couple of models and assess them.

Set up a machine learning pipeline. It will compare the performance of each algorithm on the dataset based on your evaluation criteria. Another approach is to divide your data into subsets and use the same algorithm on different groups. The best solution for this is to do it once or have a service running that does this in intervals when new data is added.

Neural networks

Finally, the majority of tasks ML has to solve today can be solved with the help of neural networks. So, the final approach to choosing an ML model is just to always go for artificial neural networks.

However, these models are expensive and time-consuming to build, which is why other models still exist. Neural networks need extremely large databases in order to be accurate. Other types of ML techniques might not be as universal but solve assigned tasks effectively even when working with small datasets.

Moreover, they tend to overfit and are also hard to interpret – neural networks are basically black boxes, and researchers don’t know what’s happening inside.

So if you have a small budget, a small data sample, or aspire to get valuable insights that are easy to understand, NNs are not for you.

categorizing ml

Final thoughts

Your results depend on whether you manage to select and build a successful ML model. If you have a machine learning project in mind and are looking for solutions, Serokell provides machine learning development services that suit your business goals. Contact us to learn how we can assist you with your project.

What Is Machine Learning: Definition, Types, Applications And Examples

Machine Learning is defined as the study of computer programs that leverage algorithms and statistical models to learn through inference and patterns without being explicitly programed. Machine Learning field has undergone significant developments in the last decade.”

In this article, we explain machine learning, the types of machine learning and its applications in enterprise settings.

Table of Contents

What is Artificial Intelligence

What Is Machine Learning?

Types of Machine Learning

Supervised Learning

Unsupervised Learning

Reinforcement Learning

Applications of Machine Learning

Artificial Intelligence Vs. Machine Learning

Closing Thoughts for Techies

Machine Learning (ML) has proven to be one of the most game-changing technological advancements of the past decade. In the increasingly competitive corporate world, ML is enabling companies to fast-track digital transformation and move into an age of automation. Some might even argue that AI/ML is required to stay relevant in some verticals, such as digital payments and fraud detection in banking or product recommendations .

The eventual adoption of machine learning algorithms and its pervasiveness in enterprises is also well-documented, with different companies adopting machine learning at scale across verticals.

Today, every other app and software all over the Internet uses machine learning in some form or the other. Machine Learning has become so pervasive that it has now become the go-to way for companies to solve a bevy of problems.

In this article, we’ll dive deeper into what machine learning is, the basics of ML, types of machine learning algorithms, and a few examples of machine learning in action. We will also take a look at the difference between artificial intelligence and machine learning.

What Is Artificial Intelligence?

 Robot signifying the future of artificial intelligence

To understand what machine learning is, we must first look at the basic concepts of artificial intelligence (AI). AI is defined as a program that exhibits cognitive ability similar to that of a human being. Making computers think like humans and solve problems the way we do is one of the main tenets of artificial intelligence.

AI exists as an umbrella term that is used to denote all computer programs that can think as humans do. Any computer program that shows characteristics, such as self-improvement, learning through inference, or even basic human tasks, such as image recognition and language processing, is considered to be a form of AI.

The field of artificial intelligence includes within it the sub-fields of machine learning and deep learning. Deep Learning is a more specialized version of machine learning that utilizes more complex methods for difficult problems. One thing to note, however, is the difference between machine learning and artificial intelligence. While machine learning is probabilistic (output can be explained, thereby ruling out the black box nature of AI), deep learning is deterministic.

The process of self-learning by collecting new data on the problem has allowed machine learning algorithms to take over the corporate space.

Learn More: 10 Most Common Myths About AI

What Is Machine Learning?

Machine Learning applications in the industry

With machine learning algorithms, AI was able to develop beyond just performing the tasks it was programmed to do. Before ML entered the mainstream, AI programs were only used to automate low-level tasks in business and enterprise settings.

This included tasks like intelligent automation or simple rule-based classification. This meant that AI algorithms were restricted to only the domain of what they were processed for. However, with machine learning, computers were able to move past doing what they were programmed and began evolving with each iteration.

Machine learning is fundamentally set apart from artificial intelligence, as it has the capability to evolve. Using various programming techniques, machine learning algorithms are able to process large amounts of data and extract useful information. In this way, they can improve upon their previous iterations by learning from the data they are provided.

We cannot talk about machine learning without speaking about big data, one of the most important aspects of machine learning algorithms. Any type of AI is usually dependent on the quality of its dataset for good results, as the field makes use of statistical methods heavily.

Machine learning is no exception, and a good flow of organized, varied data is required for a robust ML solution. In today’s online-first world, companies have access to a large amount of data about their customers, usually in the millions. This data, which is both large in the number of data points and the number of fields, is known as big data due to the sheer amount of information it holds.

Big data is time-consuming and difficult to process by human standards, but good quality data is the best fodder to train a machine learning algorithm. The more clean, usable, and machine-readable data there is in a big dataset, the more effective the training of the machine learning algorithm will be.

As explained, machine learning algorithms have the ability to improve themselves through training. Today, ML algorithms are trained using three prominent methods. These are three types of machine learning: supervised learning, unsupervised learning, and reinforcement learning.

Learn More: Modern Machine Learning – Overview With Simple Examples

Types of Machine Learning

Infographic about machine learning

As with any method, there are different ways to train machine learning algorithms, each with their own advantages and disadvantages. To understand the pros and cons of each type of machine learning, we must first look at what kind of data they ingest. In ML, there are two kinds of data — labeled data and unlabeled data.

Labeled data has both the input and output parameters in a completely machine-readable pattern, but requires a lot of human labor to label the data, to begin with. Unlabeled data only has one or none of the parameters in a machine-readable form. This negates the need for human labor but requires more complex solutions.

There are also some types of machine learning algorithms that are used in very specific use-cases, but three main methods are used today.

Supervised Learning

Supervised learning is one of the most basic types of machine learning. In this type, the machine learning algorithm is trained on labeled data. Even though the data needs to be labeled accurately for this method to work, supervised learning is extremely powerful when used in the right circumstances.

In supervised learning, the ML algorithm is given a small training dataset to work with. This training dataset is a smaller part of the bigger dataset and serves to give the algorithm a basic idea of the problem, solution, and data points to be dealt with. The training dataset is also very similar to the final dataset in its characteristics and provides the algorithm with the labeled parameters required for the problem.

The algorithm then finds relationships between the parameters given, essentially establishing a cause and effect relationship between the variables in the dataset. At the end of the training, the algorithm has an idea of how the data works and the relationship between the input and the output.

This solution is then deployed for use with the final dataset, which it learns from in the same way as the training dataset. This means that supervised machine learning algorithms will continue to improve even after being deployed, discovering new patterns and relationships as it trains itself on new data.

Unsupervised Learning

Unsupervised machine learning holds the advantage of being able to work with unlabeled data. This means that human labor is not required to make the dataset machine-readable, allowing much larger datasets to be worked on by the program.

In supervised learning, the labels allow the algorithm to find the exact nature of the relationship between any two data points. However, unsupervised learning does not have labels to work off of, resulting in the creation of hidden structures. Relationships between data points are perceived by the algorithm in an abstract manner, with no input required from human beings.

The creation of these hidden structures is what makes unsupervised learning algorithms versatile. Instead of a defined and set problem statement, unsupervised learning algorithms can adapt to the data by dynamically changing hidden structures. This offers more post-deployment development than supervised learning algorithms.

Reinforcement Learning

 Reinforcement learning techniques in organizations

Reinforcement learning directly takes inspiration from how human beings learn from data in their lives. It features an algorithm that improves upon itself and learns from new situations using a trial-and-error method. Favorable outputs are encouraged or ‘reinforced’, and non-favorable outputs are discouraged or ‘punished’.

Based on the psychological concept of conditioning, reinforcement learning works by putting the algorithm in a work environment with an interpreter and a reward system. In every iteration of the algorithm, the output result is given to the interpreter, which decides whether the outcome is favorable or not.

In case of the program finding the correct solution, the interpreter reinforces the solution by providing a reward to the algorithm. If the outcome is not favorable, the algorithm is forced to reiterate until it finds a better result. In most cases, the reward system is directly tied to the effectiveness of the result.

In typical reinforcement learning use-cases, such as finding the shortest route between two points on a map, the solution is not an absolute value. Instead, it takes on a score of effectiveness, expressed in a percentage value. The higher this percentage value is, the more reward is given to the algorithm. Thus, the program is trained to give the best possible solution for the best possible reward.

Learn More: How Is AI Changing the Finance, Healthcare, HR, and Marketing Industries?

Applications of Machine Learning

Machine learning algorithms are used in circumstances where the solution is required to continue improving post-deployment. The dynamic nature of adaptable machine learning solutions is one of the main selling points for its adoption by companies and organizations across verticals.

Machine learning algorithms and solutions are versatile and can be used as a substitute for medium-skilled human labor given the right circumstances. For example, customer service executives in large B2C companies have now been replaced by natural language processing machine learning algorithms known as chatbots. These chatbots can analyze customer queries and provide support for human customer support executives or deal with the customers directly.

Machine learning algorithms also help to improve user experience and customization for online platforms. Facebook, Netflix, Google, and Amazon all use recommendation systems to prevent content glut and provide unique content to individual users based on their likes and dislikes.

Facebook utilizes recommendation engines for its news feed on both Facebook and Instagram, as well as for its advertising services to find relevant leads. Netflix collects user data and recommends various movies and series based on the preferences of the user. Google utilizes machine learning to structure its results and for YouTube’s recommendation system, among many other applications. Amazon uses ML to place relevant products in the user’s field of view, maximizing conversion rates by recommending products that the user actually wants to buy.

However, as ML continues to be applied in various fields and use-cases, it becomes more important to know the difference between artificial intelligence and machine learning.

Learn More: 10 Businesses Using Machine Learning In Innovative Ways

Artificial Intelligence Vs. Machine Learning

As American professor Douglas Hofstadter quotes, “AI is whatever hasn’t been done yet.” This is referred to as the AI Effect, wherein new techniques not only obsolete previous ones but also make the latter much more accessible and optimized for use. By this logic, artificial intelligence refers to any advancement in the field of cognitive computers, with machine learning being a subset of AI.

Today, the term ‘artificial intelligence’ has been used as more of an umbrella term to denote technology that exhibits human-like cognitive characteristics. As a rule of thumb, research in AI is moving towards a more generalized form of intelligence, similar to the way toddlers think and perceive the world around them. This could mark the evolution of AI from a program purpose-built for a single ‘narrow’ task to a solution deployed for ‘general’ solutions; the kind we can expect from humans.

Machine learning, on the other hand, is an exclusive subset of AI reserved only for algorithms that can dynamically improve on themselves. They are not statically programmed for one task like many AI programs are, and can be improved even after they are deployed. This not only makes them suitable for enterprise applications, but it is also a novel way to solve problems in an always-changing environment.

Machine learning also includes deep learning, a specialized discipline that holds the key to the future of AI. Deep learning features neural networks, a type of algorithm that is based on the physical structure of the human brain. Neural networks seem to be the most productive path forward for AI research, as it allows for a much closer emulation of the human brain than has ever been seen before.

Learn More: 10 Experts on the Future of AI

Closing Thoughts for Techies

Understanding the basics of machine learning and artificial intelligence is a must for anyone working in the tech domain today. Due to the pervasiveness of AI in today’s tech world, working knowledge of this technology is required to stay relevant.

Corporates are now in the middle of the adoption curve for artificial intelligence, mainly due to accessible cloud platforms and exponential advancements in the field. This makes AI an interesting career opportunity for those who have the capability and experience to take it up. Since this field functions as a combination of statistics, computer science, and logical thinking, it is varied in what it can offer to new entrants. Moreover, a variety of positions such as data scientists, machine learning engineers, and AI developers offer choices to aspirants across verticals.

Machine Learning Paradigms

Machine learning is commonly separated into three main learning paradigms: supervised learningunsupervised learning, and reinforcement learning. These paradigms differ in the tasks they can solve and in how the data is presented to the computer. Usually, the task and the data directly determine which paradigm should be used (and in most cases, it is supervised learning). In some cases though, there is a choice to make. Often, these paradigms can be used together in order to obtain better results. This chapter gives an overview of what these learning paradigms are and what they can be used for.

Supervised Learning

Supervised learning is the most common learning paradigm. In supervised learning, the computer learns from a set of inputoutput pairs, which are called labeled examples:

The goal of supervised learning is usually to train a predictive model from these pairs. A predictive model is a program that is able to guess the output value (a.k.a. label) for a new unseen input. In a nutshell, the computer learns to predict using examples of correct predictions. For example, let’s consider a dataset of animal characteristics (note that typical datasets are much larger):

Our goal is to predict the weight of an animal from its other characteristics, so we rewrite this dataset as a set of input-output pairs:

In[•]:=

The input variables (here, age and sex) are generally called features, and the set of features representing an example is called a feature vector. From this dataset, we can learn a predictor in a supervised way using the function Predict:

In[•]:=

Out[•]=

Now we can use this predictor to guess the weight of a new animal:

In[•]:=

Out[•]=

This is an example of a regression task (see Chapter 4, Regression) because the output is numeric. Here is another supervised learning example where the input is text and the output is a categorical variable (“cat” or “dog”):

In[•]:=

Out[•]=

Again, we can use the resulting model to make a prediction:

In[•]:=

Out[•]=

Because the output is categorical, this is an example of a classification task (see Chapter 3, Classification). The image identification example from the first chapter is another example of classification since the data consists of labeled examples such as:

As we can see, supervised learning is separated into two phases: a learning phase during which a model is produced and a prediction phase during which the model is used. The learning phase is called the training phase because the model is trained to perform the task. The prediction phase is called the evaluation phase or inference phase because the output is inferred (i.e. deduced) from the input.

Regression and classification are the main tasks of supervised learning, but this paradigm goes beyond these tasks. For example, object detection is an application of supervised learning for which the output consists of multiple classes and their corresponding box positions:

Text translation and speech recognition, for which the output is text, are also tackled in a supervised way:

In[•]:=

Out[•]=

In[•]:=

Out[•]=

We could imagine all sorts of other output types. As long as the training data consists of a set of input-output pairs, it is a supervised learning task.

Most of the applications that we showed in the first chapter are learned in a supervised way. Currently, the majority of machine learning applications that are developed are using a supervised learning approach. One reason for that is that the main supervised tasks (classification and regression) are useful and well defined and can often be tackled using simple algorithms. Another reason is that many tools have been developed for this paradigm. The main downside of supervised learning, though, is that we need to have labeled data, which can be hard to obtain in some cases.

Unsupervised Learning

Unsupervised learning is the second most used learning paradigm. It is not used as much as supervised learning, but it unlocks different types of applications. In unsupervised learning, there are neither inputs nor outputs, the data is just a set of examples:

Unsupervised learning can be used for a diverse range of tasks. One of them is called clustering (see Chapter 6, Clustering), and its goal is to separate data examples into groups called clusters:

An application of clustering could be to automatically separate customers of a company to create better marketing campaigns. Clustering is also simply used as an exploration tool to obtain insights about the data and make informed decisions.

Another classic unsupervised task is called dimensionality reduction (see Chapter 7, Dimensionality Reduction). The goal of dimensionality reduction is to reduce the number of variables in a dataset while trying to preserve some properties of the data, such as distances between examples. Here is an example of a dataset of three variables reduced to two variables:

Dimensionality reduction can be used for a variety of tasks, such as compressing the data, learning with missing labels, creating search engines, or even creating recommendation systems. Dimensionality reduction can also be used as an exploration tool to visualize an entire dataset in a reduced space (see Chapter 7):

Anomaly detection (see Chapter 7, Dimensionality Reduction, and Chapter 8, Distribution Learning) is another task that can be tackled in an unsupervised way. Anomaly detection concerns the identification of examples that are anomalous, a.k.a. outliers. Here is an example of anomaly detection performed on a simple numeric dataset:

This task could be useful for detecting fraudulent credit card transactions, to clean a dataset, or to detect when something is going wrong in a manufacturing process.

Another classic unsupervised task is called missing imputation (see Chapter 7 and Chapter 8), and the goal is to fill in the missing values in a dataset:

This task is extremely useful because most datasets have missing values and many algorithms cannot handle them. In some cases, missing imputation techniques can also be used for predictive tasks, such as recommendation engines (see Chapter 7).

Finally, the most difficult unsupervised learning task is probably to learn how to generate examples that are similar to the training data. This task is called generative modeling (see Chapter 8) and can, for example, be used to learn how to generate new faces from many example faces. Here are such synthetic faces generated by a neural network from random noise:

Such generation techniques can also be used to enhance resolution, denoise, or impute missing values.

Unsupervised learning is a bit less used than supervised learning, mostly because the tasks it solves are less common and are harder to implement than predictive tasks. However, unsupervised learning can be applied to a more diverse set of tasks than supervised learning. Nowadays, unsupervised learning is a key element of many machine learning applications and is also used as a tool to explore data. Moreover, many researchers believe that unsupervised learning is how humans learn most of their knowledge and will, therefore, be the key to developing future artificially intelligent systems.

Reinforcement Learning

The third most classic learning paradigm is called reinforcement learning, which is a way for autonomous agents to learn. Reinforcement learning is fundamentally different from supervised and unsupervised learning in the sense that the data is not provided as a fixed set of examples. Rather, the data to learn from is obtained by interacting with an external system called the environment. The name “reinforcement learning” originates from behavioral psychology, but it could just as well be called “interactive learning.”

Reinforcement learning is often used to teach agents, such as robots, to learn a given task. The agent learns by taking actions in the environment and receiving observations from this environment:

Typically, the agent starts its learning process by acting randomly in the environment, and then the agent gradually learns from its experience to perform the task better using a sort of trial-and-error strategy. The learning is usually guided by a reward that is given to the agent depending on its performance. More precisely, the agent learns a policy that maximizes this reward. A policy is a model predicting which action to make given previous actions and observations.

Reinforcement learning can, for example, be used by a robot to learn how to walk in a simulated environment. Here is an snapshot from the classic Ant-v2 environment:

In this case, the actions are the torque values applied to each leg joint; the observations are leg angles, external forces, etc.; and the reward is the speed of the robot. Learning in such a simulated environment can then be used to help a real robot walk. Such transfer from simulation to reality has, for example, been used by OpenAI to teach a robot how to manipulate a Rubik’s Cube:

It is also possible for a real robot to learn without a simulated environment, but real robots are slow compared to simulated ones and current algorithms have a hard time learning fast enough. A mitigation strategy consists of learning to simulate the real environment, a field known as model-based reinforcement learning, which is under active research.

Reinforcement learning can also be used to teach computers to play games. Famous examples include AlphaGo, which can beat any human player at the board game Go, or AlphaStar, which can do the same for the video game StarCraft:

Both of these programs were developed using reinforcement learning by having the agent play against itself. Note that the reward in such problems is only given at the end of the game (either you win or lose), which makes it challenging to learn which actions were responsible for the outcome.

Another important application of reinforcement learning is in the field of control engineering. The goal here is to dynamically control the behavior of a system (an engine, a building, etc.) for it to behave optimally. The prototypical example is to control a pole standing on a cart by moving the cart left or right (a.k.a. inverse pendulum):

In general, classic control methods are used for such problems, but reinforcement learning is entering this field. For example, reinforcement learning has been used to control the cooling system (fan speed, water flow, etc.) of Google data centers in a more efficient way:

One issue when applying reinforcement learning directly in such a real-world system is that during the learning phase, the agent might perform actions that can break the system or pose safety issues.

Reinforcement learning is probably the most exciting paradigm since the agent is learning by interacting, like a living being. Active systems have the potential to learn better than passive ones because they can decide by themselves what to explore in order to improve. We can imagine all sorts of applications using this paradigm, from a farmer robot that learns to improve crop production, to a program that learns to trade stocks, to a chatbot that learns by having discussions with humans. Unfortunately, current algorithms need a large amount of data to be effective, which is why most reinforcement learning applications use virtual environments. Also, reinforcement learning problems are generally more complicated to handle than supervised and unsupervised ones. For these reasons, reinforcement learning is less used than other paradigms in practical applications. As research is progressing, it is likely that algorithms will need less data to operate and that simpler tools will be developed. Reinforcement learning might then become a dominant paradigm.

Other Learning Paradigms

Supervised, unsupervised, and reinforcement learning are the three core learning paradigms. Nevertheless, there are other ways to learn that depend on the specificities of the problem to solve. Here are a few of these other learning paradigms worth mentioning, most of which are variations or hybrids of the core paradigms.

Semi-supervised Learning

In semi-supervised learning, a part of the data is in the form of input-output pairs, like in supervised learning:

Another part of the data only contains inputs:

The goal is generally to learn a predictive model from both of these datasets. Semi-supervised learning is thus a supervised learning problem for which some training labels are missing.

Typically, the unlabeled dataset is much bigger than the labeled dataset. One way to take advantage of this kind of data is to use a mix of unsupervised and supervised methods. Another way is to use a self-training procedure during which we train a model on the labeled data, predict the missing labels, then train on the full dataset, predict the missing labels again, and so on. Such a self-training procedure was used to obtain a state-of-the-art image identification neural network in 2019:

In[•]:=

Out[•]=

This network was trained with (only) 1.2 million labeled images but also with 300 million unlabeled images.

Overall, semi-supervised learning is an attractive paradigm because labeling data is often expensive. However, obtaining good results with this paradigm is a bit of an art and requires more work than supervised learning. Because of these difficulties, most machine learning users tend to stick to pure supervised approaches (which means discarding examples that do not have labels).

Online Learning

Online learning is a way to learn iteratively from a stream of data. In its pure form, the model updates itself after each example given:

The model can also update itself using batches of examples. This kind of learning could be used by a bank needing to continuously update its fraud detection system by learning from the numerous transactions made every day.Online learning is useful when the dataset is large and comes as a stream because it avoids having to retrain models from scratch. Also, we don’t necessarily need to store the training data in this setting. Online learning is also useful because it naturally gives more importance to more recent data than to older data (which is often less relevant). Another use of online learning is when the dataset is too large to fit into the fast memory of the computer and thus needs to be read in chunks, a procedure called out-of-core learning.Online learning is not really a paradigm in itself since the underlying problem can be both supervised (labeled examples) or unsupervised (unlabeled examples); it is more of a learning constraint. Not every machine learning method can learn online. As a rule of thumb, every method that uses a continuous optimization procedure (such as neural networks) can be used in an online learning setting.

Active Learning

Active learning is a way to teach a predictive model by interacting with an on-demand source of information. At the beginning of an active learning procedure, the data only consists of inputs:

During the learning procedure, the student model can request some of these unknown outputs from a teacher (a.k.a. oracle). A teacher is a system able to predict (sometimes not perfectly) the output from a given input:

Most of the time, the teacher is a human, but it could also be a program, such as a numeric simulation.

Active learning can, for example, be used to create an image classifier when training images are not labeled. In this case, humans would play the role of the teachers and the computer would decide which images should be sent for annotation.

Since the teacher is generally slow to respond, the computer must decide which example is the most informative in order to learn as fast as possible. For example, it might be smart to ask the teacher about inputs that the model cannot predict confidently yet.

Active learning can be seen as a subset of reinforcement learning since the student is also an active agent. The difference is that the agent cannot alter the environment here. Such active systems have the potential to learn much faster than passive systems, and this might be a key to creating intelligent systems.

Transfer Learning

Transfer learning deals with transferring knowledge from one learning task to another learning task. It is typically used to learn more efficiently from small datasets when we have access to a much larger dataset that is similar (but different). The strategy is generally to train a model on the large dataset and then use this pre-trained model to help train another model on the task that we really care about:

Let’s use a transfer learning procedure to train a new mushroom classifier on the same 16 examples used in the first chapter:

In[•]:=

Identifying images from scratch requires many more training examples. For example, the neural network behind the ImageIdentify function has been trained on about 10 million images:

In[•]:=

Out[•]=

This model can distinguish between about 4000 objects, but it is not detailed enough for our task:

In[•]:=

Out[•]=

It is possible to adapt it to our task though. This network has 24 layers that gradually improve the understanding of the image (see Chapter 11, Deep Learning Methods). In a nutshell, the first layers identify simple things, such as lines and simple shapes, while the last layers can recognize high-level concepts (although not necessarily human-understandable concepts such as “cap color” or “gills type”). We are going to use the first 22 layers of this network as a feature extractor. This means that we are going to preprocess each image with a truncated network to obtain features that are semantically richer than pixel values. We can then train a classifier on top of these new features:

In[•]:=

Out[•]=

The classifier can now recognize our mushrooms:

In[•]:=

Out[•]=

This classifier obtains about 85% accuracy on a test set constructed from a web image search:

In[•]:=

Out[•]=

This is not perfect, but if we were to train directly on the underlying pixel values, we would obtain about 50% accuracy, which is no better than random guessing:

In[•]:=

Out[•]=

This is a simple example of transfer learning. We used a network trained on a large dataset in order to extract a useful vector representation (a.k.a. latent features) for our related downstream task. There are other transfer learning techniques that are similar in spirit, and they generally also involve neural networks.

Transfer learning is heavily used to learn from image, audio, and text data. Without transfer learning, it would be hard to accomplish something useful in these domains. Transfer learning is not used much on typical structured data however (bank transactions, sales data, etc.). The reason for that is that structured datasets are somewhat unique, so it is harder to transfer knowledge from one to another. That might not always stay this way in the future; after all, our brains are doing some kind of transfer learning all the time, reusing already-learned concepts in order to learn new things faster.

Self-Supervised Learning

Self-supervised learning generally refers to a supervised learning problem for which the inputs and outputs can be obtained from the data itself, without needing any human annotation. For example, let’s say that we want to predict the next word after a given sequence of English words. To learn how to do this, we can use a dataset of sentences:

We can then transform this dataset into a supervised learning problem:

The input-output pairs are therefore obtained from the data itself. As another example, let’s say we want to learn how to colorize images. We can take images that are already in color and convert them to grayscale to obtain a supervised dataset:

In[•]:=

Out[•]=

Again, the prediction task is already present in the data. There are plenty of other applications like this (predicting missing pixel values, predicting the next frame from a video, etc.).

Self-supervised learning is not really a learning paradigm since it refers to how the data was obtained, but it is a useful term to represent this class of problems for which labeling is free. Typically, self-supervised learning is used to learn a representation (see Chapter 7, Dimensionality Reduction), which is then used to tackle a downstream task through a transfer learning procedure. The self-supervised task is then called the pretext task or auxiliary task. Both next-word prediction and image colorization are examples of such pretext tasks that are used for transfer learning.

Takeaways

Supervised learning is about learning to predict from examples of correct predictions.
Unsupervised learning is about modeling unlabeled data.
Clustering, dimensionality reduction, missing value synthesis, and anomaly detection are the typical tasks for unsupervised learning.
Reinforcement learning is about agents learning by themselves how to behave in their environments.
Different learning paradigms typically solve different kinds of tasks.
Supervised learning is more common than unsupervised learning, which is more common than reinforcement learning.
Learning paradigms can be used in conjunction.
Semi-supervised learning is about learning from supervised and unsupervised data.
Online learning is about continuously learning from a stream of data.
Active learning is about learning from a teacher by asking questions.
Transfer learning is about transferring knowledge from one learning task to another learning task.

Vocabulary

Supervised Learning

input-output pair
labeled example
data example consisting of an input part (the features) and an output part (the label)
featuresinput variables of a predictive model, sometimes called attributes
feature vectorset of features representing a data example
labeloutput part of an input-output pair
supervised learninglearning from a set of input-output pairs, usually to predict the output from the input
predictive modelmodel used to make predictions from an input
training phasephase during which a model is produced, also known as the learning phase
evaluation
inference phase
phase during which the learned model is used
unseen inputinput example that was not present in the data used to learn from
regression tasktask of predicting a numeric variable
classification tasktask of predicting a categorical variable

Unsupervised Learning

unsupervised learninglearning from data examples that do not have labels
clusteringseparating data examples into groups
dimensionality reductionreducing the number of variables in a dataset while preserving some properties of the data
anomaly detectionidentifying examples that are anomalous
anomaly
outlier
data example that substantially differs from other data examples
imputationfilling in missing values of a dataset
generative modelinglearning to generate synthetic data examples

Reinforcement Learning

reinforcement learninglearning by interacting with an environment
environmentexternal system that the reinforcement learning agent interacts with
actionsthings that the agent does in the environment
observationsfeedback given by the environment
rewardspecial observation given by the environment to inform the agent if the task is well done
policymodel predicting which action to make given previous actions and observations
model-based
reinforcement learning
reinforcement learning where a model is trained to simulate the real environment

Other Learning Paradigms

semi-supervised learningsupervised learning in which some training labels are missing
self-trainingprocedure to learn with missing labels by alternating model training and missing imputation using the trained model
online learninglearning iteratively from a stream of data
out-of-core learninglearning without loading the dataset into the fast memory of the computer
active learninglearning a predictive model by interacting with an on-demand source of information to obtain labels
student modelmodel learning from the teacher/oracle
teacher
oracle
system able to provide labels from a given input
transfer learningtransferring knowledge from one learning task to another learning task
pre-trained modelmodel trained on a similar task to the task of interest
feature extractormodel that extracts useful features from data
vector representation
latent features
feature vector extracted by a model or preprocessor
pretext task
auxiliary task
task used to obtain a pre-trained model to be used in a transfer learning procedure
downstream taskactual task of interest, as opposed to the pretext/auxiliary task and any other previous learning task

Unsupervised vs. Supervised

In this book, we define supervised learning as learning from input-output pairs and unsupervised learning as learning from unlabeled data. This distinction only concerns the form of the data and not the type of data (image, text, etc.) or the method used. Researchers and expert practitioners can have a slightly different (and more fuzzy) definition, which is more related to which method is used to solve the task. As an example, imagine the goal is to generate images given their class using a dataset such as:

Out[•]=

Technically, this is a supervised problem, but many would call it unsupervised because the labels have many degrees of freedom (the pixels), which means that the methods used to tackle such a task are very similar to the methods used in a pure unsupervised setting (such as learning the distribution of images without classes). Both definitions are useful depending on the context.

Machine learning methods

What are machine learning methods?

Machine learning methods
Source: eduCBA

Regression

Regression methods fall within the category of supervised ML. They help to predict or explain a particular numerical value based on a set of prior data, for example predicting the price of a property based on previous pricing data for similar properties.

The simplest method is linear regression where we use the mathematical equation of the line (y = m * x + b) to model a data set. We train a linear regression model with many data pairs (x, y) by calculating the position and slope of a line that minimizes the total distance between all of the data points and the line. In other words, we calculate the slope (m) and the y-intercept (b) for a line that best approximates the observations in the data.

Regression techniques run the gamut from simple (like linear regression) to complex (like regularized linear regression, polynomial regression, decision trees and random forest regressions, neural nets, among others). But don’t get bogged down: start by studying simple linear regression, master the techniques, and move on from there.

Classification

Another class of supervised ML, classification methods predict or explain a class value. For example, they can help predict whether or not an online customer will buy a product. The output can be yes or no: buyer or not buyer. But classification methods aren’t limited to two classes. For example, a classification method could help to assess whether a given image contains a car or a truck. In this case, the output will be 3 different values: 1) the image contains a car, 2) the image contains a truck, or 3) the image contains neither a car nor a truck.

The simplest classification algorithm is logistic regression — which makes it sounds like a regression method, but it’s not. Logistic regression estimates the probability of an occurrence of an event based on one or more inputs.

Clustering

With clustering methods, we get into the category of unsupervised ML because their goal is to group or cluster observations that have similar characteristics. Clustering methods don’t use output information for training, but instead let the algorithm define the output. In clustering methods, we can only use visualizations to inspect the quality of the solution.

The most popular clustering method is K-Means, where “K” represents the number of clusters that the user chooses to create. 

As you explore clustering, you’ll encounter very useful algorithms such as Density-Based Spatial Clustering of Applications with Noise (DBSCAN), Mean Shift Clustering, Agglomerative Hierarchical Clustering, Expectation–Maximization Clustering using Gaussian Mixture Models, among others.

Dimensionality Reduction

As the name suggests, we use dimensionality reduction to remove the least important information (sometime redundant columns) from a data set. In practice, I often see data sets with hundreds or even thousands of columns (also called features), so reducing the total number is vital. For instance, images can include thousands of pixels, not all of which matter to your analysis. Or when testing microchips within the manufacturing process, you might have thousands of measurements and tests applied to every chip, many of which provide redundant information. In these cases, you need dimensionality reduction algorithms to make the data set manageable.

The most popular dimensionality reduction method isPrincipal Component Analysis (PCA), which reduces the dimension of the feature space by finding new vectors that maximize the linear variation of the data. Another popular method is t-Stochastic Neighbor Embedding (t-SNE), which does non-linear dimensionality reduction. People typically use t-SNE for data visualization, but you can also use it for machine learning tasks like reducing the feature space and clustering, to mention just a few.

Ensemble Methods

Imagine you’ve decided to build a bicycle because you are not feeling happy with the options available in stores and online. You might begin by finding the best of each part you need. Once you assemble all these great parts, the resulting bike will outshine all the other options.

Ensemble methods use this same idea of combining several predictive models (supervised ML) to get higher quality predictions than each of the models could provide on its own. For example, the Random Forest algorithms is an ensemble method that combines many Decision Trees trained with different samples of the data sets. As a result, the quality of the predictions of a Random Forest is higher than the quality of the predictions estimated with a single Decision Tree.

Think of ensemble methods as a way to reduce the variance and bias of a single machine learning model. The great majority of top winners of Kaggle competitions use ensemble methods of some kind. The most popular ensemble algorithms are Random Forest, XGBoost and LightGBM.

Neural Networks and Deep Learning

In contrast to linear and logistic regressions which are considered linear models, the objective of neural networks is to capture non-linear patterns in data by adding layers of parameters to the model. 

In fact, the structure of neural networks is flexible enough to build our well-known linear and logistic regression. The term Deep learning comes from a neural net with many hidden layers (see next Figure) and encapsulates a wide variety of architectures.

It’s especially difficult to keep up with developments in deep learning, in part because the research and industry communities have doubled down on their deep learning efforts, spawning whole new methodologies every day.

In particular, deep learning techniques have been extremely successful in the areas of vision (image classification), text, audio and video. The most common software packages for deep learning are Tensorflow and PyTorch.

Transfer Learning

Transfer Learning refers to re-using part of a previously trained neural net and adapting it to a new but similar task. Specifically, once you train a neural net using data for a task, you can transfer a fraction of the trained layers and combine them with a few new layers that you can train using the data of the new task. By adding a few layers, the new neural net can learn and adapt quickly to the new task.

The main advantage of transfer learning is that you need less data to train the neural net, which is particularly important because training for deep learning algorithms is expensive in terms of both time and money (computational resources) — and of course it’s often very difficult to find enough labeled data for the training.

Transfer learning has become more and more popular and there are now many solid pre-trained models available for common deep learning tasks like image and text classification.

Reinforcement Learning

Reinforcement Learning is a machine learning method that helps an agent learn from experience. By recording actions and using a trial-and-error approach in a set environment, RL can maximize a cumulative reward. In our example, the mouse is the agent and the maze is the environment. The set of possible actions for the mouse are: move front, back, left or right. The reward is the cheese.

You can use RL when you have little to no historical data about a problem, because it doesn’t need information in advance (unlike traditional machine learning methods). In a RL framework, you learn from the data as you go. Not surprisingly, RL is especially successful with games, especially games of “perfect information” like chess and Go. With games, feedback from the agent and the environment comes quickly, allowing the model to learn fast. The downside of RL is that it can take a very long time to train if the problem is complex.

Natural Language Processing

Natural Language Processing (NLP) is not a machine learning method per se, but rather a widely used technique to prepare text for machine learning. Think of tons of text documents in a variety of formats (word, online blogs, ….). Most of these text documents will be full of typos, missing characters and other words that needed to be filtered out. At the moment, the most popular package for processing text is NLTK (Natural Language ToolKit), created by researchers at Stanford.

Word Embeddings

TFM and TFIDF are numerical representations of text documents that only consider frequency and weighted frequencies to represent text documents. By contrast, word embeddings can capture the context of a word in a document. With the word context, embeddings can quantify the similarity between words, which in turn allows us to do arithmetic with words.

Word representations allow finding similarities between words by computing the cosine similarity between the vector representation of two words. The cosine similarity measures the angle between two vectors.

We compute word embeddings using machine learning methods, but that’s often a pre-step to applying a machine learning algorithm on top. For instance, suppose we have access to the tweets of several thousand Twitter users. Also suppose that we know which of these Twitter users bought a house. To predict the probability of a new Twitter user buying a house, we can combine Word2Vec with a logistic regression.

You can train word embeddings yourself or get a pre-trained (transfer learning) set of word vectors. To download pre-trained word vectors in 157 different languages, take a look at FastText.

Machine Learning Models Explained

What Is a model?

The output from model training may be used for inference, which means making predictions on new data. A model is a distilled representation of what a machine learning system has learned. Machine learning models are akin to mathematical functions — they take a request in the form of input data, make a prediction on that input data, and then serve a response.

In supervised and unsupervised machine learning, the model describes the signal in the noise or the pattern detected from the training data.

In reinforcement learning, the model describes the best possible course of action given a specific situation.

The final set of trainable parameters (the information the model contains) depends on the specific type of model — in deep neural networks, a model is the final state of the trained weights of the network, in regression it contains coefficients, and in decision trees it contains the split locations.

Algorithms

Neural Networks

There are many different types of models such as GANs, LSTMs & RNNs, CNNs, Autoencoders, and Deep Reinforcement Learning models. Deep neural networks are used for object detection, speech recognition and synthesis , image processing, style transfer , and machine translation, and can replace most classical machine learning algorithms (see below) . This modern method can learn extremely complex patterns and is especially successful on unstructured datasets such as images, video, and audio.

Ensemble Methods

Ensemble techniques like Random Forests and Gradient Boosting can achieve superior performance over classical machine learning techniques by aggregating weaker models and learning non-linear relationships.

Classical Machine Learning

Popular ML algorithms include: linear regression, logistic regression, SVMs, nearest neighbor, decision trees, PCA, naive Bayes classifier, and k-means clustering. Classical machine learning algorithms are used for a wide range of applications.

Types of Supervised Learning Models

Classification

Deep neural networks, classification trees (ensembles), and logistic regression (classical machine learning) are all used to perform regression tasks.

Popular use cases: Spam filtering , language detection , a search of similar documents , sentiment analysis , recognition of handwritten characters, and fraud detection.

Binary Classification Goal: Predict a binary outcome.

Examples

  • “Is this email spam or not spam?”
  • “Is this user fraudulent or not?”
  • “Is this picture a cat or not?”

Multi-class Classification Goal: Predict one out of two or more discrete outcomes.

Examples

  • “Which genre does this user prefer?”
  • “Is this mail is spam or important or a promotion?”
  • “Is this picture a cat or a dog or a fox?”

Regression

Deep neural networks, regression trees (ensembles), and linear regression (classical machine learning) are all used to perform regression tasks.

Popular use cases: Forecasting stock prices, predicting sales volume, etc .

Goal: Predict a numeric value.

Examples

  • “What will the temperature be in NYC tomorrow?”
  • “What is the price of house in this specific neighborhood?”

Types of Unsupervised Learning models

Neural Networks

Deep neural network architectures such as autoencoders and GANs can be applied to a wide variety of unsupervised learning problems.

Clustering (Classical ML)

Popular use cases: For customer segmentation , labeling data , detecting anomalous behavior, etc .

Popular algorithms: K-means, Mean-Shift, DBSCAN

Goal: Group similar things together.

Examples

  • “Cluster different news articles into different types of news”

Association Rule (Classical ML)

Popular use cases: Helping stores cross-sell products , uncovering how items are related or complementary, and understanding which symptoms are likely to co-occur in a patient (comorbidity).

Popular algorithms: Apriori, Euclat, FP-growth

Goal: Infer patterns (associations) in data.

Examples

  • “If you bought a phone, you are likely to buy a phone case.”

Dimensionality Reduction (Classical ML)

Popular use-cases: Recommender systems, topic modeling, modeling semantics, document search, face recognition, and anomaly detection.

Popular algorithms: Principal Component Analysis (PCA), Singular Value Decomposition (SVD), Latent Dirichlet Allocation (LDA), Latent Semantic Analysis (LSA, pLSA, GLSA), and t-SNE.

Goal: To generalize data and distill the relevant information.

Examples

  • “Intelligently group and combine similar features into higher-level abstractions.”

Types of Reinforcement Learning Models

Popular use-cases: Robotic motion, recommender systems, autonomous transport, text mining, trade execution in finance, and optimization for treatment policies in healthcare.

Popular algorithms: Q-Learning, SARSA, DQN, A3C

Goal: Perform complex tasks without training data.

Examples

  • “Robotic motion control learned by trial and error.”

Imitation Learning is an exciting area in Reinforcement Learning, designed to overcome some of the challenges or shortcomings inherent in Reinforcement Learning techniques. These techniques are often used together.