Machine Learning Algorithms: [With Essentials, Principles, Types & Examples covered]

In this article

  1. Why should you choose Machine Learning?
  2. Essentials of Machine Learning Algorithms
  3. What to consider before finalizing a Machine Learning algorithm?
  4. The Principle behind Machine Learning Algorithms
  5. Types of Machine Learning Algorithms
  6. Most Used Machine Learning Algorithms – Explained
  7. How to Choose Machine Learning Algorithms in Real Time
  8. How to Run Machine Learning Algorithms?
  9. Where do we stand in Machine Learning?
  10. Applications of Machine Learning
  11. Future of Machine Learning
  12. Conclusion

The advancements in Science and Technology are making every step of our daily life more comfortable. Today, the use of Machine learning systems, which is an integral part of Artificial Intelligence, has spiked and is seen playing a remarkable role in every user’s life.  

For instance, the widely popular, Virtual Personal Assistant being used for playing a music track or setting an alarm, face detection or voice recognition applications are awesome examples of the machine learning systems that we see every day. Here is an article on linear discriminant analysis for better understanding.  

Machine learning, a subset of artificial intelligence, is the ability of a system to learn or predict the user’s needs and perform an expected task without human intervention. The inputs for the desired predictions are taken from user’s previously performed tasks or from relative examples. These are an example of practical machine learning with Python that makes prediction better.

Why Should You Choose Machine Learning?

Wonder why one should choose Machine Learning? Simply put, machine learning makes complex tasks much easier.  It makes the impossible possible!

The following scenarios explain why we should opt for machine learning:

Why should you choose Machine Learning?
  1. During facial recognition and speech processing, it would be tedious to write the codes manually to execute the process, that’s where machine learning comes handy.
  2. For market analysis, figuring customer preferences or fraud detection, machine learning has become essential.
  3. For the dynamic changes that happen in real-time tasks, it would be a challenging ordeal to solve through human intervention alone.

Essentials of Machine Learning Algorithms

To state simply, machine learning is all about predictions – a machine learning, thinking and predicting what’s next. Here comes the question – what will a machine learn, how will a machine analyze, what will it predict.

You have to understand two terms clearly before trying to get answers to these questions:

  • Data
  • Algorithm
Essentials of Machine Learning Algorithms.

Data

Data is what that is fed to the machine. For example, if you are trying to design a machine that can predict the weather over the next few days, then you should input the past ‘data’ that comprise maximum and minimum air temperatures, the speed of the wind, amount of rainfall, etc. All these come under ‘data’ that your machine will learn, and then analyse later.

If we observe carefully, there will always be some pattern or the other in the input data we have. For example, the maximum and minimum ranges of temperatures may fall in the same bracket; or speeds of the wind may be slightly similar for a given season, etc. But, machine learning helps analyse such patterns very deeply. And then it predicts the outcomes of the problem we have designed it for.

Algorithm

 A graphical representation of an Algorithm

While data is the ‘food’ to the machine, an algorithm is like its digestive system. An algorithm works on the data. It crushes it; analyses it; permutates it; finds the gaps and fills in the blanks.

Algorithms are the methods used by machines to work on the data input to them. Learners must check if these concepts are being covered in the best data science courses they are enrolled in. 

What to Consider Before Finalizing a Machine Learning Algorithm?

Depending on the functionality expected from the machine, algorithms range from very basic to highly complex. You should be wise in making a selection of an algorithm that suits your ML needs. Careful consideration and testing are needed before finalizing an algorithm for a purpose.

For example, linear regression works well for simple ML functions such as speech analysis. In case, accuracy is your first choice, then slightly higher level functionalities such as Neural networks will do.

This concept is called ‘The Explainability- Accuracy Tradeoff’. The following diagram explains this better:

Explainability-accuracy tradeoff of Machine Learning

Image Source

Besides, with regards to commonly used machine learning algorithms, you need to remember the following aspects very clearly:No algorithm is an all-in-one solution to any type of problem; an algorithm that fits a scenario is not destined to fit in another one.

  • Comparison of algorithms mostly does not make sense as each one of it has its own features and functionality. Many factors such as the size of data, data patterns, accuracy needed, the structure of the dataset, etc. play a major role in comparing two algorithms.

The Principle Behind Machine Learning Algorithms

As we learnt, an algorithm churns the given data and finds a pattern among them. Thus, all machine learning algorithms, especially the ones used for supervised learning, follow one similar principle:

If the input variables or the data is X and you expect the machine to give a prediction or output Y, the machine will work on as per learning a target function ‘f’, whose pattern is not known to us.

Thus, Y= f(X) fits well for every supervised machine learning algorithm. This is otherwise also called Predictive Modeling or Predictive Analysis, which ultimately provides us with the best ever prediction possible with utmost accuracy.

Types of Machine Learning Algorithms

Diving further into machine learning, we will first discuss the types of algorithms it has. Machine learning algorithms can be classified as:

  • Supervised, and
  • Unsupervised
  • Semi-supervised algorithms
  • Reinforcement algorithms

A brief description of the types of  algorithms is given below:

1. Supervised machine learning algorithms

In this method, to get the output for a new set of user’s input, a model is trained to predict the results by using an old set of inputs and its relative known set of outputs. In other words, the system uses the examples used in the past.

A data scientist trains the system on identifying the features and variables it should analyze. After training, these models compare the new results to the old ones and update their data accordingly to improve the prediction pattern.

An example: If there is a basket full of fruits, based on the earlier specifications like color, shape and size given to the system, the model will be able to classify the fruits.

There are 2 techniques in supervised machine learning and a technique to develop a model is chosen based on the type of data it has to work on.

A) Techniques used in Supervised learning

Supervised algorithms use either of the following techniques to develop a model based on the type of data.

  1. Regression
  2. Classification

1. Regression Technique 

  • In a given dataset, this technique is used to predict a numeric value or continuous values (a range of numeric values) based on the relation between variables obtained from the dataset.
  • An example would be guessing the price of a house based after a year, based on the current price, total area, locality and number of bedrooms.
  • Another example is predicting the room temperature in the coming hours, based on the volume of the room and current temperature.

2. Classification Technique 

  • This is used if the input data can be categorized based on patterns or labels.
  • For example, an email classification like recognizing a spam mail or face detection which uses patterns to predict the output.

In summary, the regression technique is to be used when predictable data is in quantity and Classification technique is to be used when predictable data is about predicting a label.

B) Algorithms that use Supervised Learning

Some of the machine learning algorithms which use supervised learning method are:

  • Linear Regression
  • Logistic Regression
  • Random Forest
  • Gradient Boosted Trees
  • Support Vector Machines (SVM)
  • Neural Networks
  • Decision Trees
  • Naive Bayes

We shall discuss some of these algorithms in detail as we move ahead in this post.

2. Unsupervised machine learning algorithms

This method does not involve training the model based on old data, I.e. there is no “teacher” or “supervisor” to provide the model with previous examples.

The system is not trained by providing any set of inputs and relative outputs.  Instead, the model itself will learn and predict the output based on its own observations.

For example, consider a basket of fruits which are not labeled/given any specifications this time. The model will only learn and organize them by comparing Color, Size and shape.

A. Techniques used in unsupervised learning

We are discussing these techniques used in unsupervised learning as under:

  • Clustering
  • Dimensionality Reduction
  • Anomaly detection
  • Neural networks

1. Clustering

  • It is the method of dividing or grouping the data in the given data set based on similarities.
  • Data is explored to make groups or subsets based on meaningful separations.
  • Clustering is used to determine the intrinsic grouping among the unlabeled data present.
  • An example where clustering principle is being used is in digital image processing where this technique plays its role in dividing the image into distinct regions and identifying image border and the object.

2. Dimensionality reduction

  • In a given dataset, there can be multiple conditions based on which data has to be segmented or classified.
  • These conditions are the features that the individual data element has and may not be unique.
  • If a dataset has too many numbers of such features, it makes it a complex process to segregate the data.
  • To solve such type of complex scenarios, dimensional reduction technique can be used, which is a process that aims to reduce the number of variables or features in the given dataset without loss of important data.
  • This is done by the process of feature selection or feature extraction.
  • Email Classification can be considered as the best example where this technique was used.

3. Anomaly Detection

  • Anomaly detection is also known as Outlier detection.
  • It is the identification of rare items, events or observations which raise suspicions by differing significantly from the majority of the data.
  • Examples of the usage are identifying a structural defect, errors in text and medical problems.

4. Neural Networks

  • A Neural network is a framework for many different machine learning algorithms to work together and process complex data inputs.
  • It can be thought of as a “complex function” which gives some output when an input is given.
  • The Neural Network consists of 3 parts which are needed in the construction of the model.
    • Units or Neurons
    • Connections or Parameters.
    • Biases.

Neural networks are into a wide range of applications such as coastal engineering, hydrology and medicine where they are being used in identifying certain types of cancers.

B. Algorithms that use unsupervised learning

Some of the most common algorithms in unsupervised learning are:

  1. hierarchical clustering,
  2. k-means
  3. mixture models
  4. DBSCAN
  5. OPTICS algorithm
  6. Autoencoders
  7. Deep Belief Nets
  8. Hebbian Learning
  9. Generative Adversarial Networks
  10. Self-organizing map

We shall discuss some of these algorithms in detail as we move ahead in this post.

3.Semi Supervised Algorithms

In case of semi-supervised algorithms, as the name goes, it is a mix of both supervised and unsupervised algorithms. Here both labelled and unlabelled examples exist, and in many scenarios of semi-supervised learning, the count of unlabelled examples is more than that of labelled ones.

Classification and regression form typical examples for semi-supervised algorithms.

The algorithms under semi-supervised learning are mostly extensions of other methods, and the machines that are trained in the semi-supervised method make assumptions when dealing with unlabelled data.

Examples of Semi Supervised Learning:

Google Photos are the best example of this model of learning. You must have observed that at first, you define the user name in the picture and teach the features of the user by choosing a few photos. Then the algorithm sorts the rest of the pictures accordingly and asks you in case it gets any doubts during classification.

Comparing with the previous supervised and unsupervised types of learning models, we can make the following inferences for semi-supervised learning:

  • Labels are entirely present in case of supervised learning, while for unsupervised learning they are totally absent. Semi-supervised is thus a hybrid mix of both these two.
  • The semi-supervised model fits well in cases where cost constraints are present for machine learning modelling. One can label the data as per cost requirements and leave the rest of the data to the machine to take up.
  • Another advantage of semi-supervised learning methods is that they have the potential to exploit the unlabelled data of a group in cases where data carries important unexploited information.

4. Reinforcement Learning

In this type of learning, the machine learns from the feedback it has received. It constantly learns and upgrades its existing skills by taking the feedback from the environment it is in.

Markov’s Decision process is the best example of reinforcement learning.

In this mode of learning, the machine learns iteratively the correct output. Based on the reward obtained from each iteration,the machine knows what is right and what is wrong. This iteration keeps going till the full range of probable outputs are covered.

Process of Reinforcement Learning

The steps involved in reinforcement learning are as shown below:

  1. Input state is taken by the agent
  2. A predefined function indicates the action to be performed
  3. Based on the action, the reward is obtained by the machine
  4. The resulting pair of feedback and action is stored for future purposes

Examples of Reinforcement Learning Algorithms

  • Computer based games such as chess
  • Artificial hands that are based on robotics
  • Driverless cars/ self-driven cars

Most Used Machine Learning Algorithms – Explained

In this section, let us discuss the following most widely used machine learning algorithms in detail:

  1. Decision Trees
  2. Naive Bayes Classification
  3. The Autoencoder
  4. Self-organizing map
  5. Hierarchical clustering
  6. OPTICS algorithm

1. Decision Trees

  • This algorithm is an example of supervised learning.
  • A Decision tree is a pictorial representation or a graphical representation which depicts every possible outcome of a decision.
  • The various elements involved here are node, branch and leaf where ‘node’ represents an ‘attribute’, ‘branch’ representing a ‘decision’ and ‘leaf’ representing an ‘outcome’ of the feature after applying that particular decision.
  • A decision tree is just an analogy of how a human thinks to take a decision with yes/no questions.
  • The below decision tree explains a school admission procedure rule, where Age is primarily checked, and if age is < 5, admission is not given to them. And for the kids who are eligible for admission, a check is performed on Annual income of parents where if it is < 3 L p.a. the students are further eligible to get a concession on the fees.
Decision Trees in Machine Learning Algorithm

2. Naive Bayes Classification

  • This supervised machine learning algorithm is a powerful and fast classifying algorithm, using the Bayes rule in determining the conditional probability and to predict the results.
  • Its popular uses are, face recognition, filtering spam emails, predicting the user inputs in chat by checking communicated text and to label news articles as sports, politics etc.
  • Bayes Rule: The Bayes theorem defines a rule in determining the probability of occurrence of an “Event” when information about “Tests” is provided.
Bayes Rule
  • “Event” can be considered as the patient having a Heart disease while “tests” are the positive conditions that match with the event

3. The Autoencoder

  • It comes under the category of unsupervised learning using neural networking techniques.
  • An autoencoder is intended to learn or encode a representation for a given data set.
  • This also involves the process of dimensional reduction which trains the network to remove the “noise” signal.
  • In hand, with the reduction, it also works in reconstruction where the model tries to rebuild or generate a representation from the reduced encoding which is equivalent to the original input.
  • I.e. without the loss of important and needed information from the given input, an Autoencoder removes or ignores the unnecessary noise and also works on rebuilding the output.
 The Autoencoder

Pic source

  • The most common use of Autoencoder is an application that converts black and white image to color. Based on the content and object in the image (like grass, water, sky, face, dress) coloring is processed.

4. Self-organizing map

  • This comes under the unsupervised learning method.
  • Self-Organizing Map uses the data visualization technique by operating on a given high dimensional data.
  • The Self-Organizing Map is a two-dimensional array of neurons: M = {m1,m2,……mn}
  • It reduces the dimensions of the data to a map, representing the clustering concept by grouping similar data together.
  • SOM reduces data dimensions and displays similarities among data.
  • SOM uses clustering technique on data without knowing the class memberships of the input data where several units compete for the current object.
  • In short, SOM converts complex, nonlinear statistical relationships between high-dimensional data into simple geometric relationships on a low-dimensional display.

5. Hierarchical clustering

  • Hierarchical clustering uses one of the below clustering techniques to determine a hierarchy of clusters.
  • Thus produced hierarchy resembles a tree structure which is called a “Dendrogram”.
  • The techniques used in hierarchical clustering are:
    • K-Means,
    • DBSCAN,
    • Gaussian Mixture Models.
  • The 2 methods in finding hierarchical clusters are:
  1. Agglomerative clustering
  2. Divisive clustering
  • Agglomerative clustering
    • This is a bottom-up approach, where each data point starts in its own cluster.
    • These clusters are then joined greedily, by taking the two most similar clusters together and merging them.
  • Divisive clustering
    • Inverse to Agglomerative, this uses a top-down approach, wherein all data points start in the same cluster after which a parametric clustering algorithm like K-Means is used to divide the cluster into two clusters.
    • Each cluster is further divided into two clusters until a desired number of clusters are hit.

6. OPTICS algorithm

  • OPTICS is an abbreviation for ordering points to identify the clustering structure.
  • OPTICS works in principle like an extended DB Scan algorithm for an infinite number for a distance parameter which is smaller than a generating distance.
  • From a wide range of parameter settings, OPTICS outputs a linear list of all objects under analysis in clusters based on their density.

How to Choose Machine Learning Algorithms in Real Time

When implementing algorithms in real time, you need to keep in mind three main aspects: Space, Time, and Output.

Besides, you should clearly understand the aim of your algorithm:

  • Do you want to make predictions for the future?
  • Are you just categorizing the given data?
  • Is your targeted task simple or comprises of multiple sub-tasks?

The following table will show you certain real-time scenarios and help you to understand which algorithm is best suited to each scenario:

Real time scenarioBest suited algorithmWhy this algorithm is the best fit?
Simple straightforward data set with no complex computationsLinear RegressionIt takes into account all factors involved and predicts the result with simple error rate explanation.For simple computations, you need not spend much computational power; and linear regression runs with minimal computational power.
Classifying already labeled data into sub-labelsLogistic RegressionThis algorithm looks at every data point into two subcategories, hence best for sub-labeling.Logistic regression model works best when you have multiple targets.
Sorting unlabelled data into groupsK-Means clustering algorithmThis algorithm groups and clusters data by measuring the spatial distance between each point.You can choose from its sub-types – Mean-Shift algorithm and Density-Based Spatial Clustering of Applications with Noise
Supervised text classification (analyzing reviews, comments, etc.)Naive BayesSimplest model that can perform powerful pre-processing and cleaning of textRemoves filler stop words effectivelyComputationally in-expensive
Logistic regressionSorts words one by one and assigns a probabilityRanks next to Naïve Bayes in simplicity
Linear Support Vector Machine algorithmCan be chosen when performance matters
Bag-of-words modelSuits best when vocabulary and the measure of known words is known.
Image classificationConvolutional neural networkBest suited for complex computations such as analyzing visual cortexesConsumes more computational power and gives the best results
Stock market predictionsRecurrent neural networkBest suited for time-series analysis with well-defined and supervised data.Works efficiently in taking into account the relation between data and its time distribution.

How to Run Machine Learning Algorithms?

Till now you have learned in detail about various algorithms of machine learning, their features, selection and application in real time.

When implementing the algorithm in real time, you can do it in any programming language that works well for machine learning.

All that you need to do is use the standard libraries of the programming language that you have chosen and work on them, or program everything from scratch.

Need more help? You can check these links for more clarity on coding machine learning algorithms in various programming languages.

How To Get Started With Machine Learning Algorithms in R

How to Run Your First Classifier in Weka

Machine Learning Algorithm Recipes in scikit-learn

Where do We Stand in Machine Learning?

Machine learning is slowly making strides into as many fields in our daily life as possible. Some businesses are making it strict to have transparent algorithms that do not affect their business privacy or data security. They are even framing regulations and performing audit trails to check if there is any discrepancy in the above-said data policies.

The point to note here is that a machine working on machine learning principles and algorithms give output after processing the data through many nonlinear computations. If one needs to understand how a machine predicts, perhaps it can be possible only through another machine learning algorithm!

Applications of Machine Learning

Applications of Machine Learning

Currently, the role of Machine learning and Artificial Intelligence in human life is intertwined. With the advent of evolving technologies, AI and ML have marked their existence in all possible aspects.

Machine learning finds a plethora of applications in several domains of our day to day life. An exhaustive list of fields where machine learning is currently in use now is shown in the diagram here. An explanation for the same follows further below:

  1. Financial Services: Banks and financial services are increasingly relying on machine learning to identify financial fraud, portfolio management, identify and suggest good options for investment for customers.
  2. Police Department: Apps based on facial recognition and other techniques of machine learning are being used by the police to identify and get hold of criminals.
  3. Online Marketing and Sales: Machine learning is helping companies a great deal in studying the shopping and spending patterns of customers and in making personalized product recommendations to them. Machine learning also eases customer support, product recommendations and advertising ideas for e-commerce.
  4. Healthcare: Doctors are using machine learning to predict and analyze the health status and disease progress of patients. Machine learning has proven its accuracy in detecting health condition, heartbeat, blood pressure and in identifying certain types of cancer. Advanced techniques of machine learning are being implemented in robotic surgery too.
  5. Household Applications: Household appliances that use face detection and voice recognition are gaining popularity as security devices and personal virtual assistants at homes.
  6. Oil and Gas: In analyzing underground minerals and carrying out the exploration and mining, geologists and scientists are using machine learning for improved accuracy and reduced investments.
  7. Transport: Machine learning can be used to identify the vehicles that are moving in prohibited zones for traffic control and safety monitoring purposes.
  8. Social Media: In social media, spam is a big nuisance. Companies are using machine learning to filter spam. Machine learning also aptly solves the purpose of sentiment analysis in social media.
  9. Trading and Commerce: Machine learning techniques are being implemented in online trading to automate the process of trading. Machines learn from the past performances of trading and use this knowledge to make decisions about future trading options.

Future of Machine Learning

Machine learning is already making a difference in the way businesses are offering their services to us, the customers. Voice-based search and preferences based ads are just basic functionalities of how machine learning is changing the face of businesses.

ML has already made an inseparable mark in our lives. With more advancement in various fields, ML will be an integral part of all AI systems. ML algorithms are going to be made continuously learning with the day-to-day updating information.

With the rapid rate at which ongoing research is happening in this field, there will be more powerful machine learning algorithms to make the way we live even more sophisticated!

From 2013- 2017, the patents in the field of machine learning has recorded a growth of 34%, according to IFI Claims Patent Services (Patent Analytics). Also, 60% of the companies in the world are using machine learning for various purposes.

A peek into the future trends and growth of machine learning through the reports of Predictive Analytics and Machine Learning (PAML) market shows a 21% CAGR by 2021.

Conclusion

Machine Learning should be designed as an aid that would support mankind.

Ultimately, machine learning should be designed as an aid that would support mankind. The notion that automation and machine learning are threats to jobs and human workforce is pretty prevalent. It should always be remembered that machine learning is just a technology that has evolved to ease the life of humans by reducing the needed manpower and to offer increased efficiency at lower costs that too in a shorter time span. The onus of using machine learning in a responsible manner lies in the hands of those who work on/with it.

However, stay tuned to an era of artificial intelligence and machine learning that makes the impossible possible and makes you witness the unseen! Want to execute what you have learned in this blog, enroll in KnowledgeHut practical machine learning with Python and work with data science projects that deal with complex machine learning algorithms.

4 TYPES OF MACHINE LEARNING ALGORITHMS

Machine Learning came a long way from a science fiction fancy to a reliable and diverse business tool that amplifies multiple elements of the business operation.

Its influence on business performance may be so significant that the implementation of machine learning algorithms is required to maintain competitiveness in many fields and industries.

The implementation of machine learning in business operations is a strategic step and requires a lot of resources. Therefore, it’s important to understand what do you want the ML to do for your particular business and what kind of perks different types of ML algorithms bring to the table. 

In this article, we’ll cover the major types of machine learning algorithms, explain the purpose of each of them, and see what the benefits are.

PREDICTIVE ANALYTICS VS. MACHINE LEARNING: WHAT IS THE DIFFERENCE

Types of Machine Learning Algorithms

Algorithms include supervised and unsupervised learning systems as well as Reinforcement and Semi-supervised machine learning technology. 

Supervised Learning Algorithms

Supervised Learning Algorithms are the ones that involve direct supervision (cue the title) of the operation. In this case, the developer labels sample data corpus and set strict boundaries upon which the algorithm operates.

It is a spoonfed version of machine learning:

  • you select what kind of information output (samples) to “feed” the algorithm;
  • what kind of results it is desired (for example “yes/no” or “true/false”).

From the machine’s point of view, this process becomes more or less a “connect the dots” routine.

The primary purpose of supervised learning is to scale the scope of input data and to make predictions of unavailable, future or unseen data based on labeled sample data.

Supervised machine learning includes two major processes: classification and regression.

  • Classification is the process where incoming data is labeled based on past data samples and manually trains the algorithm to recognize certain types of objects and categorize them accordingly. The system has to know how to differentiate types of information, perform an optical character, image, or binary recognition (whether a particular bit of data is compliant or non-compliant to specific requirements in a manner of “yes” or “no”).
  • Regression is the process of identifying patterns and calculating the predictions of continuous outcomes. The system has to understand the numbers, their values, grouping (for example, heights and widths), etc. 

The most widely used supervised algorithms are:

  • Linear Regression
  • Logistical Regression
  • Random Forest
  • Gradient Boosted Trees
  • Support Vector Machines (SVM)
  • Neural Networks
  • Decision Trees
  • Naive Bayes
  • Nearest Neighbor

Supervised Learning Algorithms Use Cases

The most common fields of use for supervised learning algorithm is price prediction and trend forecasting in sales, retail commerce, and stock trading. In both cases, an algorithm uses incoming data to assess the possibility and calculate possible outcomes.

The best examples are Sales enablement platforms like Seismic and Highspot use this kind of an algorithm to present various possible scenarios for consideration.

Business cases for supervised learning method include ad tech operations as part of the ad content delivery sequence. The role of the supervised learning system there is to assess possible prices of ad spaces and its value during the real-time bidding process and also keep the budget spending under specific limitations (for example, the price range of a single buy and overall budget for a certain period).

Unsupervised Learning Algorithms

Unsupervised Learning is one that does not involve direct control of the developer. If the main point of supervised machine learning is that you know the results and need to sort out the new data, then in the case of unsupervised learning algorithm the desired results are unknown and yet to be defined.

Another big difference between the two is that supervised learning uses labeled data exclusively, while unsupervised learning feeds on unlabeled data.

The unsupervised machine learning algorithm is used for:

  • exploring the structure of the information;
  • extracting valuable insights;
  • detecting patterns;
  • implementing this into its operation to increase efficiency.

In other words, unsupervised learning techniques describe information by sifting through it and making sense of it.

Unsupervised learning algorithms apply the following techniques to describe the data:

  • Clustering: it is an exploration of data used to segment it into meaningful groups (i.e., clusters) based on their internal patterns without prior knowledge of group credentials. The credentials are defined by the similarity of individual data objects and also aspects of their dissimilarity from the rest (which can also be used to detect anomalies).
  • Dimensionality reduction: there is a lot of noise in the incoming data. Machine learning algorithms use dimensionality reduction to remove this noise while distilling the relevant information.

The most widely used algorithms are:

  • k-means clustering
  • t-SNE (t-Distributed Stochastic Neighbor Embedding)
  • PCA (Principal Component Analysis)
  • Association rule

Use Cases of Unsupervised Learning Algorithms

Digital marketing and ad tech are the fields where unsupervised learning is used to its maximum effect. In addition to that, this algorithm is often applied to explore customer information and adjust the service accordingly.

The thing is – there are a lot of so-called “known unknowns” in the incoming data. The very effectiveness of the business operation depends on the ability to make sense of unlabeled data and extract relevant insights out of it.

Unsupervised algorithms equip modern data management. At the moment, Lotame and Salesforce are among the most cutting-edge data management platforms that implement this machine learning system.

As such, unsupervised learning can be used to identify target audience groups based on certain credentials (it can be behavioral data, elements of personal data, specific software setting or else). This algorithm can be used to develop more efficient targeting of ad content and also for identifying patterns in the campaign performance.

Semi-supervised Machine Learning Algorithms

Semi-supervised learning algorithms represent a middle ground between supervised and unsupervised algorithms. In essence, the semi-supervised model combines some aspects of both into a thing of its own.

Here’s how semi-supervised algorithms work:

  1. A semi-supervised machine-learning algorithm uses a limited set of labeled sample data to shape the requirements of the operation (i.e., train itself).
  2. The limitation results in a partially trained model that later gets the task to label the unlabeled data. Due to the limitations of the sample data set, the results are considered pseudo-labeled data.
  3. Finally, labeled and pseudo-labeled data sets are combined, which creates a distinct algorithm that combines descriptive and predictive aspects of supervised and unsupervised learning.

Semi-supervised learning uses the classification process to identify data assets and the clustering process to group it into distinct parts.

Semi-supervised Machine Learning Use Cases

Legal and Healthcare industries, among others, manage web content classification, image, and speech analysis with the help of semi-supervised learning.

In the case of web content classification, semi-supervised learning is applied for crawling engines and content aggregation systems. In both cases, it uses a wide array of labels to analyze content and arrange it in specific configurations. However, this procedure usually requires human input for further classification.

An excellent example of this will be uClassify. The other well-known tool of this category is the GATE (General Architecture for Text Engineering).

In the case of image and speech analysis, an algorithm performs labeling to provide a viable image or speech analytic model with coherent transcription based on a sample corpus. For example, it can be an MRI or CT scan. With a small set of exemplary scans, it is possible to provide a coherent model able to identify anomalies in the images.

Reinforcement Learning Algorithms

Reinforcement learning represents what is commonly understood as machine learning artificial intelligence.

In essence, reinforcement learning is all about developing a self-sustained system that, throughout contiguous sequences of tries and fails, improves itself based on the combination of labeled data and interactions with the incoming data.

Reinforced ML uses the technique called exploration/exploitation. The mechanics are simple – the action takes place, the consequences are observed, and the next action considers the results of the first action.

In the center of reinforcement learning algorithms are reward signals that occur upon performing specific tasks. In a way, reward signals are serving as a navigation tool for the reinforcement algorithms. They give it an understanding of right and wrong course of action.

Two main types of reward signals are:

  • Positive reward signal encourages continuing performance a particular sequence of action
  • Negative reward signal penalizes for performing certain activities and urges to correct the algorithm to stop getting penalties.

However, the function of the reward signal may vary depending on the nature of the information. Thus reward signals may be further classified depending on the requirements of the operation. Overall, the system tries to maximize positive rewards and minimize the negatives.

Most common reinforcement learning algorithms include:

  • Q-Learning
  • Temporal Difference (TD)
  • Monte-Carlo Tree Search (MCTS)
  • Asynchronous Actor-Critic Agents (A3C)

TOP AI USE CASES IN SUPPLY CHAIN OPTIMIZATION

Use Cases for Reinforced Machine Learning Algorithms

Reinforcement Machine Learning fits for instances of limited or inconsistent information available. In this case, an algorithm can form its operating procedures based on interactions with data and relevant processes.

Modern NPCs and other video games use this type of machine learning model a lot. Reinforcement Learning provides flexibility to the AI reactions to the player’s action thus providing viable challenges. For example, the collision detection feature uses this type of ML algorithm for the moving vehicles and people in the Grand Theft Auto series.

Self-driving cars also rely on reinforced learning algorithms as well. For example, if the self-driving car (Waymo, for instance) detects the road turn to the left – it may activate the “turn left” scenario and so on.

The most famous example of this variation of reinforcement learning is AlphaGo that went head to head with the second-best Go player in the world and outplayed him by calculating the sequences of actions out of current board position.

On the other hand, Marketing and Ad Tech operations also use Reinforcement Learning. This type of machine learning algorithm can make retargeting operation much more flexible and efficient in delivering conversion by closely adapting to the user’s behavior and surrounding context.

Also, Reinforcement learning is used to amplify and adjust natural language processing (NLP) and dialogue generation for chatbots to:

  • mimic the style of an input message
  • develop more engaging, informative kinds of responses
  • find relevant responses according to the user reaction.

With the emergence of Google DialogFlow building, such bot became more of a UX challenge than a technical feat.

What do we think about ML intelligent algorithm?

As you can see, different types of machine learning algorithms are solving different kinds of problems. The combination of different algorithms makes a power capable of handling a wide variety of tasks and extracting valuable insights out of all sorts of information.

Whether your business is a taxi app or a food delivery service or even a social media network – every app can benefit from machine learning algorithms. Ready to begin? The APP Solutions team has expertise in architecting and implementing ML algorithms into various types of projects and we’d love to see your business grow.

Top 6 Machine Learning Algorithms for Classification

Supervised vs. Unsupervised vs. Reinforcement Learning

The easiest way to distinguish a supervised learning and unsupervised learning is to see whether the data is labelled or not.

Supervised learning learns a function to make prediction of a defined label based on the input data. It can be either classifying data into a category (classification problem) or forecasting an outcome (regression algorithms).

Unsupervised learning reveals the underlying pattern in the dataset that are not explicitly presented, which can discover the similarity of data points (clustering algorithms) or uncover hidden relationships of variables (association rule algorithms) …

Reinforcement learning is another type of machine learning, where the agents learn to take actions based on its interaction with the environment, with the aim to maximize rewards. It is most similar to the learning process of human, following a trial-and-error approach.

Classification vs Regression

Supervised learning can be furthered categorized into classification and regression algorithms. Classification model identifies which category an object belongs to whereas regression model predicts a continuous output.

For a guide to regression algorithms, please see:

Top 4 Regression Algorithms in Machine Learning

A Comprehensive Guide to Implementation and Comparison

Sometimes there is an ambiguous line between classification algorithms and regression algorithms. Many algorithms can be used for both classification and regression, and classification is just regression model with a threshold applied. When the number is higher than the threshold it is classified as true while lower classified as false.

In this article, we will discuss top 6 machine learning algorithms for classification problems, including: logistic regression, decision tree, random forest, support vector machine, k nearest neighbour and naive bayes. I summarized the theory behind each as well as how to implement each using python. Check out the code for model pipeline on my website.

1. Logistic Regression

logistic regression (image by author)

Logistics regression uses sigmoid function above to return the probability of a label. It is widely used when the classification problem is binary — true or false, win or lose, positive or negative …

The sigmoid function generates a probability output. By comparing the probability with a pre-defined threshold, the object is assigned to a label accordingly. Check out my posts on logistic regression for a detailed walkthrough.

Simple Logistic Regression in Python

Step-by-Step Guide from Data Preprocessing to Model Evaluation

Below is the code snippet for a default logistic regression and the common hyperparameters to experiment on — see which combinations bring the best result.

from sklearn.linear_model import LogisticRegression
reg = LogisticRegression()
reg.fit(X_train, y_train)
y_pred = reg.predict(X_test)

logistic regression common hyperparameters: penalty, max_iter, C, solver

2. Decision Tree

decision tree (image by author)

Decision tree builds tree branches in a hierarchy approach and each branch can be considered as an if-else statement. The branches develop by partitioning the dataset into subsets based on most important features. Final classification happens at the leaves of the decision tree.

from sklearn.tree import DecisionTreeClassifier
dtc = DecisionTreeClassifier()
dtc.fit(X_train, y_train)
y_pred = dtc.predict(X_test)

decision tree common hyperparameters: criterion, max_depth, min_samples_split, min_samples_leaf; max_features

3. Random Forest

random forest (image by author)

As the name suggest, random forest is a collection of decision trees. It is a common type of ensemble methods which aggregate results from multiple predictors. Random forest additionally utilizes bagging technique that allows each tree trained on a random sampling of original dataset and takes the majority vote from trees. Compared to decision tree, it has better generalization but less interpretable, because of more layers added to the model.

from sklearn.ensemble import RandomForestClassifier
rfc = RandomForestClassifier()
rfc.fit(X_train, y_train)
y_pred = rfc.predict(X_test)

random forest common hyperparameters: n_estimators, max_features, max_depth, min_samples_split, min_samples_leaf, boostrap

4. Support Vector Machine (SVM)

support vector machine (image by author)

Support vector machine finds the best way to classify the data based on the position in relation to a border between positive class and negative class. This border is known as the hyperplane which maximize the distance between data points from different classes. Similar to decision tree and random forest, support vector machine can be used in both classification and regression, SVC (support vector classifier) is for classification problem.

from sklearn.svm import SVC
svc = SVC()
svc.fit(X_train, y_train)
y_pred = svc.predict(X_test)

support vector machine common hyperparameters: c, kernel, gamma

5. K-Nearest Neighbour (KNN)

knn (image by author)

You can think of k nearest neighbour algorithm as representing each data point in a n dimensional space — which is defined by n features. And it calculates the distance between one point to another, then assign the label of unobserved data based on the labels of nearest observed data points. KNN can also be used for building recommendation system, check out my article on “Collaborative Filtering for Movie Recommendation” if you are interested in this topic.

from sklearn.neighbors import KNeighborsClassifier
knn = KNeighborsClassifier()
knn.fit(X_train, y_train)
y_pred = knn.predict(X_test)

KNN common hyperparameters: n_neighbors, weights, leaf_size, p

6. Naive Bayes

naive bayes (image by author)

Naive Bayes is based on Bayes’ Theorem — an approach to calculate conditional probability based on prior knowledge, and the naive assumption that each feature is independent to each other. The biggest advantage of Naive Bayes is that, while most machine learning algorithms rely on large amount of training data, it performs relatively well even when the training data size is small. Gaussian Naive Bayes is a type of Naive Bayes classifier that follows the normal distribution.

from sklearn.naive_bayes import GaussianNB
gnb = GaussianNB()
gnb.fit(X_train, y_train)
y_pred = gnb.predict(X_test)

Practical Guides to Machine Learning

Principal Component Analysis for ML
Time Series Analysis
deep learning cheatsheet for beginner

Build a Classification Model Pipeline

1. Loading Dataset and Data Overview

I chose the popular dataset Heart Disease UCI on Kaggle for predicting the presence of heart disease based on several health related factors.

Use df.info()to have a summarized view of dataset, including data type, missing data and number of records.

2. Exploratory Data Analysis (EDA)

Histogram, grouped bar chart and box plot are suitable EDA techniques for classification machine learning algorithms. If you’d like a more comprehensive guide to EDA, please see my post “Semi-Automated Exploratory Data Analysis Process in Python”

Semi-Automated Exploratory Data Analysis Process in Python

This article covers several techniques to automate the EDA process using Python, including univariate analysis

Univariate Analysis

univariate analysis (image by author)

Histogram is used for all features, because all features have been encoded into numeric values in the dataset. This saves us the time for categorical encoding that usually happens during the feature engineering stage.

Categorical Features vs. Target — Grouped Bar Chart

grouped bar chart (image by author)

To show how categorical value weigh in determining the target value, grouped bar chart is a straightforward representation. For example, sex = 1 and sex = 0 have distinctly distribution of target value, which indicates it is likely to contribute more to the prediction of target. Contrarily, if the target distribution is the same regardless of the categorical features, then very likely they are not correlated.

Numerical Features vs. Target — Box Plot

box plot (image by author)

Box plot shows how the values of numerical features varies across target groups. For example, we can tell that “oldpeak” have distinct difference when target is 0 vs. target is 1, suggesting that it is an important predictor. However, ‘trestbps’ and ‘chol’ appear to be less outstanding, as the box plot distribution is similar between target groups.

3. Split Dataset into Training and Testing Set

Classification algorithm falls under the category of supervised learning, so dataset needs to be split into a subset for training and a subset for testing (sometime also a validation set). The model is trained on the training set and then examined using the testing set.

from sklearn.model_selection import train_test_split
from sklearn import preprocessingX = df.drop(['target'], axis=1)
y = df["target"]X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=42)

4. Machine Learning Model Pipeline

In order to create a pipeline, I append the default state of all classification algorithms mentioned above into the model list and then iterate through them to train, test, predict and evaluate.

model pipeline (image by author)

5. Model Evaluation

model evaluation (image by author)

Below is an abstraction explanation of commonly used evaluation methods for classification models — accuracy, ROC & AUC and confusion matrix. Each of the following metrics is worth diving deeper, feel free to visit my article on logistic regression for a more detailed illustration.

1. Accuracy

Accuracy is the most straightforward indicator of the model performance. It measure the percentage of accurate predictions: accuracy = (true positive + true negative) / (true positive + false positive + false negative + false positive)

2. ROC & AUC

ROC & AUC (image by author)

ROC is the plot of true positive rate against false positive rate at various classification threshold. AUC is the area under the ROC curve, and higher AUC indicates better model performance.

3. Confusion matrix

Confusion matrix indicates the actual values vs. predicted values and summarize the true negative, false positive, false negative and true positive values in a matrix format.

Then we can use seaborn to visualize the confusion matrix in a heatmap.

confusion matrix plot (image by author)
accuracy and AUC result (image by author)

Based on three evaluations methods above, random forests and naive bayes have the best performance, whereas KNN is not doing well. However, this doesn’t mean that random forests and naive bayes are superior algorithms. We can only say that they are more suitable for this dataset where the size is relatively smaller and data is not at the same scale.

Each algorithm has its own preference and require different data processing and feature engineering techniques, for example KNN is sensitive to features at difference scale and multicollinearity affects the result of logistic regression. Understanding the characteristics of each allows us to balance the trade-off and select the appropriate model according to the dataset.

Thanks for reaching so far, if you’d like to read more articles from Medium and also support my work, I really appreciate you signing up Medium Membership using this affiliate link.

Take Home Message

This article is an introduction of following 6 machine learning algorithms and a guide to build a model pipeline to address classification problems:

  1. Logistic Regression
  2. Decision Tree
  3. Random Forest
  4. Support Vector Machine
  5. KNN
  6. Naive Bayes

A Tour of Machine Learning Algorithms

In this post, we will take a tour of the most popular machine learning algorithms.

It is useful to tour the main algorithms in the field to get a feeling of what methods are available.

There are so many algorithms that it can feel overwhelming when algorithm names are thrown around and you are expected to just know what they are and where they fit.

I want to give you two ways to think about and categorize the algorithms you may come across in the field.

  • The first is a grouping of algorithms by their learning style.
  • The second is a grouping of algorithms by their similarity in form or function (like grouping similar animals together).

Both approaches are useful, but we will focus in on the grouping of algorithms by similarity and go on a tour of a variety of different algorithm types.

After reading this post, you will have a much better understanding of the most popular machine learning algorithms for supervised learning and how they are related.

Kick-start your project with my new book Master Machine Learning Algorithms, including step-by-step tutorials and the Excel Spreadsheet files for all examples.

Let’s get started.

Ensemble Learning Method

A cool example of an ensemble of lines of best fit. Weak members are grey, the combined prediction is red.
Plot from Wikipedia, licensed under public domain.

Algorithms Grouped by Learning Style

There are different ways an algorithm can model a problem based on its interaction with the experience or environment or whatever we want to call the input data.

It is popular in machine learning and artificial intelligence textbooks to first consider the learning styles that an algorithm can adopt.

There are only a few main learning styles or learning models that an algorithm can have and we’ll go through them here with a few examples of algorithms and problem types that they suit.

This taxonomy or way of organizing machine learning algorithms is useful because it forces you to think about the roles of the input data and the model preparation process and select one that is the most appropriate for your problem in order to get the best result.

Let’s take a look at three different learning styles in machine learning algorithms:

1. Supervised Learning

Supervised Learning Algorithms

Input data is called training data and has a known label or result such as spam/not-spam or a stock price at a time.

A model is prepared through a training process in which it is required to make predictions and is corrected when those predictions are wrong. The training process continues until the model achieves a desired level of accuracy on the training data.

Example problems are classification and regression.

Example algorithms include: Logistic Regression and the Back Propagation Neural Network.

2. Unsupervised Learning

Unsupervised Learning Algorithms

Input data is not labeled and does not have a known result.

A model is prepared by deducing structures present in the input data. This may be to extract general rules. It may be through a mathematical process to systematically reduce redundancy, or it may be to organize data by similarity.

Example problems are clustering, dimensionality reduction and association rule learning.

Example algorithms include: the Apriori algorithm and K-Means.

3. Semi-Supervised Learning

Semi-supervised Learning Algorithms

Input data is a mixture of labeled and unlabelled examples.

There is a desired prediction problem but the model must learn the structures to organize the data as well as make predictions.

Example problems are classification and regression.

Example algorithms are extensions to other flexible methods that make assumptions about how to model the unlabeled data.

Overview of Machine Learning Algorithms

When crunching data to model business decisions, you are most typically using supervised and unsupervised learning methods.

A hot topic at the moment is semi-supervised learning methods in areas such as image classification where there are large datasets with very few labeled examples.

Algorithms Grouped By Similarity

Algorithms are often grouped by similarity in terms of their function (how they work). For example, tree-based methods, and neural network inspired methods.

I think this is the most useful way to group algorithms and it is the approach we will use here.

This is a useful grouping method, but it is not perfect. There are still algorithms that could just as easily fit into multiple categories like Learning Vector Quantization that is both a neural network inspired method and an instance-based method. There are also categories that have the same name that describe the problem and the class of algorithm such as Regression and Clustering.

We could handle these cases by listing algorithms twice or by selecting the group that subjectively is the “best” fit. I like this latter approach of not duplicating algorithms to keep things simple.

In this section, we list many of the popular machine learning algorithms grouped the way we think is the most intuitive. The list is not exhaustive in either the groups or the algorithms, but I think it is representative and will be useful to you to get an idea of the lay of the land.

Please Note: There is a strong bias towards algorithms used for classification and regression, the two most prevalent supervised machine learning problems you will encounter.

If you know of an algorithm or a group of algorithms not listed, put it in the comments and share it with us. Let’s dive in.

Regression Algorithms

Regression Algorithms

Regression is concerned with modeling the relationship between variables that is iteratively refined using a measure of error in the predictions made by the model.

Regression methods are a workhorse of statistics and have been co-opted into statistical machine learning. This may be confusing because we can use regression to refer to the class of problem and the class of algorithm. Really, regression is a process.

The most popular regression algorithms are:

  • Ordinary Least Squares Regression (OLSR)
  • Linear Regression
  • Logistic Regression
  • Stepwise Regression
  • Multivariate Adaptive Regression Splines (MARS)
  • Locally Estimated Scatterplot Smoothing (LOESS)

A Tour of Machine Learning Algorithms

In this post, we will take a tour of the most popular machine learning algorithms.

It is useful to tour the main algorithms in the field to get a feeling of what methods are available.

There are so many algorithms that it can feel overwhelming when algorithm names are thrown around and you are expected to just know what they are and where they fit.

I want to give you two ways to think about and categorize the algorithms you may come across in the field.

  • The first is a grouping of algorithms by their learning style.
  • The second is a grouping of algorithms by their similarity in form or function (like grouping similar animals together).

Both approaches are useful, but we will focus in on the grouping of algorithms by similarity and go on a tour of a variety of different algorithm types.

After reading this post, you will have a much better understanding of the most popular machine learning algorithms for supervised learning and how they are related.

Kick-start your project with my new book Master Machine Learning Algorithms, including step-by-step tutorials and the Excel Spreadsheet files for all examples.

Let’s get started.

Ensemble Learning Method

A cool example of an ensemble of lines of best fit. Weak members are grey, the combined prediction is red.
Plot from Wikipedia, licensed under public domain.

Algorithms Grouped by Learning Style

There are different ways an algorithm can model a problem based on its interaction with the experience or environment or whatever we want to call the input data.

It is popular in machine learning and artificial intelligence textbooks to first consider the learning styles that an algorithm can adopt.

There are only a few main learning styles or learning models that an algorithm can have and we’ll go through them here with a few examples of algorithms and problem types that they suit.

This taxonomy or way of organizing machine learning algorithms is useful because it forces you to think about the roles of the input data and the model preparation process and select one that is the most appropriate for your problem in order to get the best result.

Let’s take a look at three different learning styles in machine learning algorithms:

1. Supervised Learning

Supervised Learning Algorithms

Input data is called training data and has a known label or result such as spam/not-spam or a stock price at a time.

A model is prepared through a training process in which it is required to make predictions and is corrected when those predictions are wrong. The training process continues until the model achieves a desired level of accuracy on the training data.

Example problems are classification and regression.

Example algorithms include: Logistic Regression and the Back Propagation Neural Network.

2. Unsupervised Learning

Unsupervised Learning Algorithms

Input data is not labeled and does not have a known result.

A model is prepared by deducing structures present in the input data. This may be to extract general rules. It may be through a mathematical process to systematically reduce redundancy, or it may be to organize data by similarity.

Example problems are clustering, dimensionality reduction and association rule learning.

Example algorithms include: the Apriori algorithm and K-Means.

3. Semi-Supervised Learning

Semi-supervised Learning Algorithms

Input data is a mixture of labeled and unlabelled examples.

There is a desired prediction problem but the model must learn the structures to organize the data as well as make predictions.

Example problems are classification and regression.

Example algorithms are extensions to other flexible methods that make assumptions about how to model the unlabeled data.

Overview of Machine Learning Algorithms

When crunching data to model business decisions, you are most typically using supervised and unsupervised learning methods.

A hot topic at the moment is semi-supervised learning methods in areas such as image classification where there are large datasets with very few labeled examples.

Algorithms Grouped By Similarity

Algorithms are often grouped by similarity in terms of their function (how they work). For example, tree-based methods, and neural network inspired methods.

I think this is the most useful way to group algorithms and it is the approach we will use here.

This is a useful grouping method, but it is not perfect. There are still algorithms that could just as easily fit into multiple categories like Learning Vector Quantization that is both a neural network inspired method and an instance-based method. There are also categories that have the same name that describe the problem and the class of algorithm such as Regression and Clustering.

We could handle these cases by listing algorithms twice or by selecting the group that subjectively is the “best” fit. I like this latter approach of not duplicating algorithms to keep things simple.

In this section, we list many of the popular machine learning algorithms grouped the way we think is the most intuitive. The list is not exhaustive in either the groups or the algorithms, but I think it is representative and will be useful to you to get an idea of the lay of the land.

Please Note: There is a strong bias towards algorithms used for classification and regression, the two most prevalent supervised machine learning problems you will encounter.

If you know of an algorithm or a group of algorithms not listed, put it in the comments and share it with us. Let’s dive in.

Regression Algorithms

Regression Algorithms

Regression is concerned with modeling the relationship between variables that is iteratively refined using a measure of error in the predictions made by the model.

Regression methods are a workhorse of statistics and have been co-opted into statistical machine learning. This may be confusing because we can use regression to refer to the class of problem and the class of algorithm. Really, regression is a process.

The most popular regression algorithms are:

  • Ordinary Least Squares Regression (OLSR)
  • Linear Regression
  • Logistic Regression
  • Stepwise Regression
  • Multivariate Adaptive Regression Splines (MARS)
  • Locally Estimated Scatterplot Smoothing (LOESS)

Instance-based Algorithms

Instance-based Algorithms

Instance-based learning model is a decision problem with instances or examples of training data that are deemed important or required to the model.

Such methods typically build up a database of example data and compare new data to the database using a similarity measure in order to find the best match and make a prediction. For this reason, instance-based methods are also called winner-take-all methods and memory-based learning. Focus is put on the representation of the stored instances and similarity measures used between instances.

The most popular instance-based algorithms are:

  • k-Nearest Neighbor (kNN)
  • Learning Vector Quantization (LVQ)
  • Self-Organizing Map (SOM)
  • Locally Weighted Learning (LWL)
  • Support Vector Machines (SVM)

Regularization Algorithms

Regularization Algorithms

An extension made to another method (typically regression methods) that penalizes models based on their complexity, favoring simpler models that are also better at generalizing.

I have listed regularization algorithms separately here because they are popular, powerful and generally simple modifications made to other methods.

The most popular regularization algorithms are:

  • Ridge Regression
  • Least Absolute Shrinkage and Selection Operator (LASSO)
  • Elastic Net
  • Least-Angle Regression (LARS)

Decision Tree Algorithms

Decision Tree Algorithms

Decision tree methods construct a model of decisions made based on actual values of attributes in the data.

Decisions fork in tree structures until a prediction decision is made for a given record. Decision trees are trained on data for classification and regression problems. Decision trees are often fast and accurate and a big favorite in machine learning.

The most popular decision tree algorithms are:

  • Classification and Regression Tree (CART)
  • Iterative Dichotomiser 3 (ID3)
  • C4.5 and C5.0 (different versions of a powerful approach)
  • Chi-squared Automatic Interaction Detection (CHAID)
  • Decision Stump
  • M5
  • Conditional Decision Trees

Bayesian Algorithms

Bayesian Algorithms

Bayesian methods are those that explicitly apply Bayes’ Theorem for problems such as classification and regression.

The most popular Bayesian algorithms are:

  • Naive Bayes
  • Gaussian Naive Bayes
  • Multinomial Naive Bayes
  • Averaged One-Dependence Estimators (AODE)
  • Bayesian Belief Network (BBN)
  • Bayesian Network (BN)

Clustering Algorithms

Clustering Algorithms

Clustering, like regression, describes the class of problem and the class of methods.

Clustering methods are typically organized by the modeling approaches such as centroid-based and hierarchal. All methods are concerned with using the inherent structures in the data to best organize the data into groups of maximum commonality.

The most popular clustering algorithms are:

  • k-Means
  • k-Medians
  • Expectation Maximisation (EM)
  • Hierarchical Clustering

Association Rule Learning Algorithms

Assoication Rule Learning Algorithms

Association rule learning methods extract rules that best explain observed relationships between variables in data.

These rules can discover important and commercially useful associations in large multidimensional datasets that can be exploited by an organization.

The most popular association rule learning algorithms are:

  • Apriori algorithm
  • Eclat algorithm

Artificial Neural Network Algorithms

Artificial Neural Network Algorithms

Artificial Neural Networks are models that are inspired by the structure and/or function of biological neural networks.

They are a class of pattern matching that are commonly used for regression and classification problems but are really an enormous subfield comprised of hundreds of algorithms and variations for all manner of problem types.

Note that I have separated out Deep Learning from neural networks because of the massive growth and popularity in the field. Here we are concerned with the more classical methods.

The most popular artificial neural network algorithms are:

  • Perceptron
  • Multilayer Perceptrons (MLP)
  • Back-Propagation
  • Stochastic Gradient Descent
  • Hopfield Network
  • Radial Basis Function Network (RBFN)

Deep Learning Algorithms

Deep Learning Algorithms

Deep Learning methods are a modern update to Artificial Neural Networks that exploit abundant cheap computation.

They are concerned with building much larger and more complex neural networks and, as commented on above, many methods are concerned with very large datasets of labelled analog data, such as image, text. audio, and video.

The most popular deep learning algorithms are:

  • Convolutional Neural Network (CNN)
  • Recurrent Neural Networks (RNNs)
  • Long Short-Term Memory Networks (LSTMs)
  • Stacked Auto-Encoders
  • Deep Boltzmann Machine (DBM)
  • Deep Belief Networks (DBN)

Dimensionality Reduction Algorithms

Dimensional Reduction Algorithms

Like clustering methods, dimensionality reduction seek and exploit the inherent structure in the data, but in this case in an unsupervised manner or order to summarize or describe data using less information.

This can be useful to visualize dimensional data or to simplify data which can then be used in a supervised learning method. Many of these methods can be adapted for use in classification and regression.

  • Principal Component Analysis (PCA)
  • Principal Component Regression (PCR)
  • Partial Least Squares Regression (PLSR)
  • Sammon Mapping
  • Multidimensional Scaling (MDS)
  • Projection Pursuit
  • Linear Discriminant Analysis (LDA)
  • Mixture Discriminant Analysis (MDA)
  • Quadratic Discriminant Analysis (QDA)
  • Flexible Discriminant Analysis (FDA)

Ensemble Algorithms

Ensemble Algorithms

Ensemble methods are models composed of multiple weaker models that are independently trained and whose predictions are combined in some way to make the overall prediction.

Much effort is put into what types of weak learners to combine and the ways in which to combine them. This is a very powerful class of techniques and as such is very popular.

  • Boosting
  • Bootstrapped Aggregation (Bagging)
  • AdaBoost
  • Weighted Average (Blending)
  • Stacked Generalization (Stacking)
  • Gradient Boosting Machines (GBM)
  • Gradient Boosted Regression Trees (GBRT)
  • Random Forest

Other Machine Learning Algorithms

Many algorithms were not covered.

I did not cover algorithms from specialty tasks in the process of machine learning, such as:

  • Feature selection algorithms
  • Algorithm accuracy evaluation
  • Performance measures
  • Optimization algorithms

I also did not cover algorithms from specialty subfields of machine learning, such as:

  • Computational intelligence (evolutionary algorithms, etc.)
  • Computer Vision (CV)
  • Natural Language Processing (NLP)
  • Recommender Systems
  • Reinforcement Learning
  • Graphical Models
  • And more…

These may feature in future posts.

Further Reading on Machine Learning Algorithms

This tour of machine learning algorithms was intended to give you an overview of what is out there and some ideas on how to relate algorithms to each other.

I’ve collected together some resources for you to continue your reading on algorithms. If you have a specific question, please leave a comment.

Other Lists of Machine Learning Algorithms

There are other great lists of algorithms out there if you’re interested. Below are few hand selected examples.

  • List of Machine Learning Algorithms: On Wikipedia. Although extensive, I do not find this list or the organization of the algorithms particularly useful.
  • Machine Learning Algorithms Category: Also on Wikipedia, slightly more useful than Wikipedias great list above. It organizes algorithms alphabetically.
  • CRAN Task View: Machine Learning & Statistical Learning: A list of all the packages and all the algorithms supported by each machine learning package in R. Gives you a grounded feeling of what’s out there and what people are using for analysis day-to-day.
  • Top 10 Algorithms in Data Mining: on the most popular algorithms for data mining. Another grounded and less overwhelming take on methods that you could go off and learn deeply.

How to Study Machine Learning Algorithms

Algorithms are a big part of machine learning. It’s a topic I am passionate about and write about a lot on this blog. Below are few hand selected posts that might interest you for further reading.

  • How to Learn Any Machine Learning Algorithm: A systematic approach that you can use to study and understand any machine learning algorithm using “algorithm description templates” (I used this approach to write my first book).
  • How to Create Targeted Lists of Machine Learning Algorithms: How you can create your own systematic lists of machine learning algorithms to jump start work on your next machine learning problem.
  • How to Research a Machine Learning Algorithm: A systematic approach that you can use to research machine learning algorithms (works great in collaboration with the template approach listed above).
  • How to Investigate Machine Learning Algorithm Behavior: A methodology you can use to understand how machine learning algorithms work by creating and executing very small studies into their behavior. Research is not just for academics!
  • How to Implement a Machine Learning Algorithm: A process and tips and tricks for implementing machine learning algorithms from scratch.

How to Run Machine Learning Algorithms

Sometimes you just want to dive into code. Below are some links you can use to run machine learning algorithms, code them up using standard libraries or implement them from scratch.

  • How To Get Started With Machine Learning Algorithms in R: Links to a large number of code examples on this site demonstrating machine learning algorithms in R.
  • Machine Learning Algorithm Recipes in scikit-learn: A collection of Python code examples demonstrating how to create predictive models using scikit-learn.
  • How to Run Your First Classifier in Weka: A tutorial for running your very first classifier in Weka (no code required!).

Final Word

I hope you have found this tour useful.

Please, leave a comment if you have any questions or ideas on how to improve the algorithm tour.

Update: Continue the discussion on HackerNews and reddit.

Supervised and Unsupervised Machine Learning – Types of ML

Machine Learning algorithms are being used more often than we can imagine and there is a good reason for that.

Let’s see what kind of different Machine Learning algorithms exist and how they can help us in solving everyday life problems.

Machine Learning is not the future. It’s the present

Many different Machine Learning algorithms are widely used in many areas of our life and they help us to solve some everyday problems. Algorithms can help us not only to recognize images, videos, and texts, but are also used to fortify cybersecurity, improve medical solutions, customer service, and marketing.

Basically, there are few different types of Machine Learning algorithms. There is a major distinction between supervised learning and unsupervised learning techniques. Let’s see what are the main differences between them and how specifically they can help us.

Supervised learning

To put it simply, we train an algorithm and at the end pick the model that best predicts some well-defined output based on the input data.

Supervised techniques adapt the model to reproduce outputs known from a training set (e.g. recognize car types on photos). In the beginning, the system receives input data as well as output data. Its task is to create appropriate rules that map the input to the output. The training process should continue until the level of performance is high enough. After training, the system should be able to assign an output objects which it has not seen during the training phase. In most cases, this process is really fast and accurate.

There are two types of Supervised Learning techniques: Regression and Classification. Classification separates the data, Regression fits the data.

Regression

Regression is a technique that aims to reproduce the output value. We can use it, for example, to predict the price of some product, like a price of a house in a specific city or the value of a stock. There is a huge number of things we can predict if we wish.

Classification

Classification is a technique that aims to reproduce class assignments. It can predict the response value and the data is separated into “classes”. Examples? Recognition of a type of car in a photo, is this mail spam or a message from a friend, or what the weather will be today.

Unsupervised learning

In this Machine Learning technique, we do not have any outcome variables to predict. The computer is trained with unlabeled data. Unsupervised techniques aim to uncover hidden structures, like find groups of photos with similar cars, but it’s a bit difficult to implement and is not used as widely as supervised learning.

Unsupervised techniques may be used as a preliminary step before applying supervised ones. The internal structure of the data may provide information on how to better reproduce outputs.

In unsupervised techniques, we have clustering and dimensionality reduction.

Clustering

Clustering is used to find similarities and differences. It groups similar things together. Here we don’t provide any labels, but the system can understand data itself and cluster it well. Unlike classification, the final output labels are not known beforehand.

This kind of algorithm can help us solve many obstacles, like create clusters of similar tweets based on their content, find groups of photos with similar cars, or identify different types of news.

Dimensionality reduction

Dimensionality reduction is used to find a better (less complex) representation of the data. After applying such a process, the data set should have a reduced amount of redundant information while the important parts may be emphasized. In practice, this could be realized as a removing a column from a database from further analysis.

Semi-Supervised Learning & Reinforcement Learning

In the previous two types of Machine Learning techniques, there are no labels or labels are present for all the observations. Sometimes, we need something between these two. In such situations we can use Semi-Supervised Learning, which refers to a learning process in which lots of output values (the ones we want to predict) are missing. It requires applying both supervised and unsupervised methods in order to obtain useful results. This is often the case within medical applications, in which medical doctors are unable to manually classify/mark all types of illness due to the overwhelming amounts of data.

Sometimes, the required value of the output is not known explicitly, but the system provides feedback on the provided output. Learning based on such feedback is called Reinforcement Learning. This is used, for example, for training the gaming AI in the game NERO. Another example can be found in schools. Students learn about a specific topic (reinforcement learning), then they sit an exam, and the teacher gives them grades without specifying which answers were correct and which were not.

The Wrap Up

Machine Learning can identify patterns that we are unable to see or find in huge amounts of data. There are different Machine Learning algorithms which are well suited for many different types of situations, such as Supervised and Unsupervised Learning, as well as Semi-Supervised and Reinforcement learning, which are somewhere between the former two. All together, they can help all of us solve many problems and make new discoveries.

How Machine Learning Techniques Can Help Engineers Design Better Products

Since the early 1950s, machine learning (ML) has developed from playing a simple game of checkers to extremely advanced algorithms that help humans with everything from predicting the remaining useful life (RUL) of jet engines to the production of self-driving cars. In recent years, ML has allowed companies to automatically detect damage to powerlines, predict the best time to buy a product online, and even build effective fraud detection systems, all adding to the convenience and safety of our lives. Capitalizing on these technologies and incorporating them into existing Altair products allows engineers to work in a smarter way, speeding up design and production time.  

There are a multitude of techniques when using ML that offer different solutions for different problems, and when considering how ML can be utilized in the engineering world it is important to understand the different approaches and methods. In its simplest organization, the two main categories are supervised and unsupervised, each with its own objectives and uses. Under the umbrella of these methods, a range of applications can be explored and optimized to provide faster workflow, optimized design, and more accurate predictions.

Although incorporating this collection of technology is relatively new in the field of engineering, Altair has started to make leaps forward in this space to provide its users with the tools they need to make a difference. Take CAD tasks and 3D design for example. ML can act as a powerful tool to aid in this discipline, ultimately leading to optimized methods of manufacturing and more accurate simulations.

When building a CAE/CAD model, being able to search for similar shapes can be very useful. By selecting a part, it is now possible to search for similar shapes in Altair HyperWorks™, saving the user time and effort. Going one step further, part clustering will take all parts included and cluster them with respect to their shape similarity, allowing the user to view all clusters within a build. 

Search by shape
Part clustering

ML can also help with the accuracy of a simulation. Incorporating ML into Altair AcuSolve™ has led to improved aerodynamics predictions by implementing a physics-informed data-driven ML model. This produces a more accurate prediction of flow separation when studying aerodynamic fluid flow in conjunction with a deep neural network (DNN).

This process is achieved by appending a correction term to the equations governing the fluid flow and running several simulations with adjoint optimization to obtain training data. The key learning features are then identified in the generated training data and used to train and test the DNN models for the correction term. 

Improved prediction of flow separation with AcuSolve + DNN of a simplified wing/blade. Left = truth. Middle = without DNN. Right = with DNN.

A design of experiments (DOE) methodology allows engineers to create variables, responses, and goals to obtain the best design results possible. When used in conjunction with a conventional ML prediction model, this leads to predicted KPIs. More recently, advances in ML methods and engineering software have made it possible to make physics predictions leading to accurate contour plots, represented visually in real time.  

Predicted contour plot

By leveraging field predictive ML models engineers can explore more options without the use of a solver when designing different components and parts, saving time and resources. This ultimately produces higher quality results that can then be used to make more informed decisions throughout the design process.

Sliders used to edit variables

In optimization, it is sometimes desirable but not possible to define constraints that fully reflect an expert’s requirements. This may lead to a design that does not function as intended. ML enables the user to set up subjective constraints to ensure a design that has been trained to replicate the expert’s opinion. In the automotive industry for example, this can be a huge advantage. 

In a project with one of Altair’s major customers, ML methods were successfully employed to create a concept design for a reinforced bracket subjected to crash loads. The design space was sampled to avoid any folding modes after the crash event, with the modes then clustered to label them more easily.

An expert identifies desired post buckling.

These designs could then be classified based on the desired shape and used to teach a machine learning model. By doing this, it is possible to incorporate expert preferences in an optimization, leading to faster design cycles and improved design. 

Altair DesignAI enables teams to start enhancing product design by using existing design and simulation data, and scaling internal expertise. Altair DesignAI is a cloud native solution accessible on Altair One that helps organizations save time and money in the product development process. Altair One allows users to quickly find and download Altair and partner software to solve your giving collaborative access to simulation and data analytics technology plus scalable HPC and cloud resources, all in one place.

These advances to Altair solutions and machine learning techniques make it possible to work in a more effective way, producing results faster. By combining physics-based, simulation-driven design and machine learning-based AI-driven design, users are able to efficiently identify high-potential designs and reject low-potential designs earlier in development cycles.

Designed for people with different skill sets, our desktop-based predictive analytics and ML solutions helps users to quickly generate actionable insights from data. Quickly build out predictive and prescriptive models that easily explain and quantify insight found in your data. Apply and share that insight by deploying models natively or exporting them to common business intelligence (BI) tools. Data scientists rely on Altair to efficiently build powerful and insightful predictive models to make better business decisions.

Types of Learning

Machine Learning (ML) is an automated learning with little or no human intervention. It involves programming computers so that they learn from the available inputs. The main purpose of machine learning is to explore and construct algorithms that can learn from the previous data and make predictions on new input data.

The input to a learning algorithm is training data, representing experience, and the output is any expertise, which usually takes the form of another algorithm that can perform a task. The input data to a machine learning system can be numerical, textual, audio, visual, or multimedia. The corresponding output data of the system can be a floating-point number, for instance, the velocity of a rocket, an integer representing a category or a class, for example, a pigeon or a sunflower from image recognition.

In this chapter, we will learn about the training data our programs will access and how learning process is automated and how the success and performance of such machine learning algorithms is evaluated.

Concepts of Learning

Learning is the process of converting experience into expertise or knowledge.

Learning can be broadly classified into three categories, as mentioned below, based on the nature of the learning data and interaction between the learner and the environment.

  • Supervised Learning
  • Unsupervised Learning
  • Semi-supervised Learning

Similarly, there are four categories of machine learning algorithms as shown below −

  • Supervised learning algorithm
  • Unsupervised learning algorithm
  • Semi-supervised learning algorithm
  • Reinforcement learning algorithm

However, the most commonly used ones are supervised and unsupervised learning.

Supervised Learning

Supervised learning is commonly used in real world applications, such as face and speech recognition, products or movie recommendations, and sales forecasting. Supervised learning can be further classified into two types – Regression and Classification.

Regression trains on and predicts a continuous-valued response, for example predicting real estate prices.

Classification attempts to find the appropriate class label, such as analyzing positive/negative sentiment, male and female persons, benign and malignant tumors, secure and unsecure loans etc.

In supervised learning, learning data comes with description, labels, targets or desired outputs and the objective is to find a general rule that maps inputs to outputs. This kind of learning data is called labeled data. The learned rule is then used to label new data with unknown outputs.

Supervised learning involves building a machine learning model that is based on labeled samples. For example, if we build a system to estimate the price of a plot of land or a house based on various features, such as size, location, and so on, we first need to create a database and label it. We need to teach the algorithm what features correspond to what prices. Based on this data, the algorithm will learn how to calculate the price of real estate using the values of the input features.

Supervised learning deals with learning a function from available training data. Here, a learning algorithm analyzes the training data and produces a derived function that can be used for mapping new examples. There are many supervised learning algorithms such as Logistic Regression, Neural networks, Support Vector Machines (SVMs), and Naive Bayes classifiers.

Common examples of supervised learning include classifying e-mails into spam and not-spam categories, labeling webpages based on their content, and voice recognition.

Unsupervised Learning

Unsupervised learning is used to detect anomalies, outliers, such as fraud or defective equipment, or to group customers with similar behaviors for a sales campaign. It is the opposite of supervised learning. There is no labeled data here.

When learning data contains only some indications without any description or labels, it is up to the coder or to the algorithm to find the structure of the underlying data, to discover hidden patterns, or to determine how to describe the data. This kind of learning data is called unlabeled data.

Suppose that we have a number of data points, and we want to classify them into several groups. We may not exactly know what the criteria of classification would be. So, an unsupervised learning algorithm tries to classify the given dataset into a certain number of groups in an optimum way.

Unsupervised learning algorithms are extremely powerful tools for analyzing data and for identifying patterns and trends. They are most commonly used for clustering similar input into logical groups. Unsupervised learning algorithms include Kmeans, Random Forests, Hierarchical clustering and so on.

Semi-supervised Learning

If some learning samples are labeled, but some other are not labeled, then it is semi-supervised learning. It makes use of a large amount of unlabeled data for training and a small amount of labeled data for testing. Semi-supervised learning is applied in cases where it is expensive to acquire a fully labeled dataset while more practical to label a small subset. For example, it often requires skilled experts to label certain remote sensing images, and lots of field experiments to locate oil at a particular location, while acquiring unlabeled data is relatively easy.

Reinforcement Learning

Here learning data gives feedback so that the system adjusts to dynamic conditions in order to achieve a certain objective. The system evaluates its performance based on the feedback responses and reacts accordingly. The best known instances include self-driving cars and chess master algorithm AlphaGo.

Purpose of Machine Learning

Machine learning can be seen as a branch of AI or Artificial Intelligence, since, the ability to change experience into expertise or to detect patterns in complex data is a mark of human or animal intelligence.

As a field of science, machine learning shares common concepts with other disciplines such as statistics, information theory, game theory, and optimization.

As a subfield of information technology, its objective is to program machines so that they will learn.

However, it is to be seen that, the purpose of machine learning is not building an automated duplication of intelligent behavior, but using the power of computers to complement and supplement human intelligence. For example, machine learning programs can scan and process huge databases detecting patterns that are beyond the scope of human perception.

Classical Examples of Supervised vs. Unsupervised Learning in Machine Learning

Like humans, machines are capable of learning in different ways. When it comes to machine learning, the most common learning strategies are supervised learning, unsupervised learning, and reinforcement learning. This post will focus on unsupervised learning and supervised learning algorithms, and provide typical examples of each.

What Is Supervised Learning In Machine Learning?

As the name indicates, supervised learning involves machine learning algorithms that learn under the presence of a supervisor. 

Learning under supervision directly translates to being under guidance and learning from an entity that is in charge of providing feedback through this process. When training a machine, supervised learning refers to a category of methods in which we teach or train a machine learning algorithm using data, while guiding the algorithm model with labels associated with the data. However, it is essential for data scientists and machine learning engineers to understand algorithm models and which ones should be applied in particular circumstances.

As humans, we consume a lot of information, but often don’t notice these data points. When we see a photo of an animal, for example, we instantly know what the animal is based on our prior experience. But what happens when the learner doesn’t instantly recognize the animal? 

When the learner makes a guess and predicts what the animal might be, we have the opportunity to objectively evaluate if the learner has given a correct answer or not. This is possible because we have the correct labels of input.

From now on, we’ll be referring to the machine learning algorithm as “the model.” Now, if the model gave a correct answer, then there is nothing for us to do. Our job is to correct the model when the output of the model is wrong. If this is the case, we need to make sure that the model makes necessary updates so that the next time a cat image is shown to the model, it can correctly identify the image. 

The formal supervised learning process involves input variables, which we call (X), and an output variable, which we call (Y). We use an algorithm to learn the mapping function from the input to the output. In simple mathematics, the output (Y) is a dependent variable of input (X) as illustrated by:

Y = f(X)

Here, our end goal is to try to approximate the mapping function (f), so that we can predict the output variables (Y) when we have new input data (X).

supervised vs. unsupervised learning

Examples of Supervised Learning

Now that we’ve covered supervised learning, it is time to look at classic examples of supervised learning algorithms.

In supervised learning, our goal is to learn the mapping function (f), which refers to being able to understand how the input (X) should be matched with output (Y) using available data.

Here, the machine learning model learns to fit mapping between examples of input features with their associated labels. When models are trained with these examples, we can use them to make new predictions on unseen data.

The predicted labels can be both numbers or categories. For instance, if we are predicting house prices, then the output is a number. In this case, the model is a regression model. If we are predicting if an email is spam or not, the output is a category and the model is a classification model. 

Example: House prices

One practical example of supervised learning problems is predicting house prices. How is this achieved?

First, we need data about the houses: square footage, number of rooms, features, whether a house has a garden or not, and so on. We then need to know the prices of these houses, i.e. the corresponding labels. By leveraging data coming from thousands of houses, their features and prices, we can now train a supervised machine learning model to predict a new house’s price based on the examples observed by the model. 

Example: Is it a cat or a dog?

Image classification is a popular problem in the computer vision field. Here, the goal is to predict what class an image belongs to. In this set of problems, we are interested in finding the class label of an image. More precisely: is the image of a car or a plane? A cat or a dog?

Example: How’s the weather today?

One particularly interesting problem which requires considering a lot of different parameters is predicting weather conditions in a particular location. To make correct predictions for the weather, we need to take into account various parameters, including historical temperature data, precipitation, wind, humidity, and so on.

This particularly interesting and challenging problem may require developing complex supervised models that include multiple tasks. Predicting today’s temperature is a regression problem, where the output labels are continuous variables. By contrast, predicting whether it is going to snow or not tomorrow is a binary classification problem.

Want to learn more? Check out our post on How an ML Algorithm Helped Make Hurricane Damage Assessments Safer, Cheaper, and More Effective.

Example: Who are the unhappy customers?

Another great example of supervised learning is text classification problems. In this set of problems, the goal is to predict the class label of a given piece of text.

One particularly popular topic in text classification is to predict the sentiment of a piece of text, like a tweet or a product review. This is widely used in the e-commerce industry to help companies to determine negative comments made by customers.

unsupervised vs. supervised learning

What Is Unsupervised Learning?

In supervised learning, the main idea is to learn under supervision, where the supervision signal is named as target value or label. In unsupervised learning, we lack this kind of signal. Therefore, we need to find our way without any supervision or guidance. This simply means that we are alone and need to figure out what is what by ourselves. 

However, we are not totally in the dark. We do this kind of learning every day. In unsupervised learning, even though we do not have any labels for data points, we do have the actual data points. This means we can draw references from observations in the input data. 

Imagine you are in a foreign country and you are visiting a food market, for example. You see a stall selling a fruit that you cannot identify. You don’t know the name of this fruit. However, you have your observations to rely on, and you can use these as a reference. In this case, you can easily the fruit apart from nearby vegetables or other food by identifying its various features like its shape, color, or size.

This is roughly how unsupervised learning happens. We use the data points as references to find meaningful structure and patterns in the observations. Unsupervised learning is commonly used for finding meaningful patterns and groupings inherent in data, extracting generative features, and exploratory purposes.

Examples of Unsupervised Learning

There are a few different types of unsupervised learning. We’ll review three common approaches below.

Example: Finding customer segments

Clustering is an unsupervised technique where the goal is to find natural groups or clusters in a feature space and interpret the input data. There are many different clustering algorithms in the field of data science. One common approach is to divide the data points in a way that each data point falls into a group that is similar to other data points in the same group based on a predefined similarity or distance metric in the feature space.

Clustering is commonly used for determining customer segments in marketing data. Being able to determine different segments of customers helps marketing teams approach these customer segments in unique ways. (Think of features like gender, location, age, education, income bracket, and so on.)

machine learning springboard

Example: Reducing the complexity of a problem

Dimensionality reduction is a commonly used unsupervised learning technique where the goal is to reduce the number of random variables under consideration. It has several practical applications. One of the most common uses of dimensionality reduction is to reduce the complexity of a problem by projecting the feature space to a lower-dimensional space so that less correlated variables are considered in a machine learning system. 

The most common approaches used in dimensionality reduction are PCA, t-SNE, and UMAP algorithms. They are especially useful for reducing the complexity of a problem and also visualizing the data instances in a better way. Before going into more detail about feature projection, let’s look at another important concept in machine learning: feature selection.

Example: Feature selection

Even though feature selection and dimensionality reduction aim toward reducing the number of features in the original set of features, understanding how feature selection works helps us get a better understanding of dimensionality reduction.

Assume that we want to predict how capable an applicant is of repaying a loan from the perspective of a bank. Here, we need to help the bank set up a machine learning system so that each loan can be given to applicants who can repay the loan. We need a lot of information about each application to make predictions. A few important attributes about applicants are the applicant’s average monthly income, debt, credit history, and so on. 

Typically, however, banks collect much more information from applicants when taking their applications. Not all of it is relevant for predicting an applicant’s credit risk score. For instance, does an applicant’s age make any difference when deciding whether the applicant can repay the loan? Is the applicant’s gender important for determining the credit risk score? Probably not. 

It is important to understand that not every feature adds value to solving the problem. Therefore, eliminating these features is an essential part of machine learning. In feature selection, we try to eliminate a subset of the original set of features. 

In dimensionality reduction, we still discard features but do that in a way that the feature space is projected onto a smaller feature space, therefore eliminating less important information during this process.

Supervised Machine Learning Algorithms

What is Supervised Machine Learning?

Supervised machine learning algorithms uncover insights, patterns, and relationships from a labeled training dataset – that is, a dataset that already contains a known value for the target variable for each record. Because you provide the machine learning algorithm with the correct answers for a problem during training, the algorithm is able to “learn” how the rest of the features relate to the target, enabling you to uncover insights and make predictions about future outcomes based on historical data.

Examples of Supervised Machine Learning Techniques

  1. Regression, in which the algorithm returns a numerical target for each example, such as how much revenue will be generated from a new marketing campaign.
  2. Classification, in which the algorithm attempts to label each example by choosing between two or more different classes. Choosing between two classes is called binary classification, such as determining whether or not someone will default on a loan. Choosing between more than two classes is referred to as multiclass classification.

Why is Supervised Machine Learning Important?

Supervised machine learning turns data into real, actionable insights. It enables organizations to use data to understand and prevent unwanted outcomes or boost desired outcomes for their target variable.

Supervised Machine Learning Use Cases

Supervised machine learning is one of the most powerful engines that enable AI systems to make business decisions faster and more accurately than humans. Businesses across industries use it to solve problems such as:

  • Reducing customer churn
  • Determining customer lifetime value
  • Personalizing product recommendations
  • Allocating human resources
  • Forecasting sales
  • Forecasting supply and demand
  • Detecting fraud
  • Predicting equipment maintenance

Challenges in Implementing Supervised Machine Learning

However, successfully building, scaling, and deploying accurate supervised machine learning models has historically required extensive time and technical expertise from a team of highly skilled, expensive data scientists. Additionally, data science teams must periodically rebuild models in order to make sure the insights they provide remain true to life as the input data changes.

Supervised Machine Learning + DataRobot

DataRobot’s diverse library of machine learning algorithms and unique model blueprint technology incorporates supervised machine learning algorithms such as bagging, boosting, deep learning, frequency-severity methods, generalized additive models, generalized linear models, kernel-based methods, random forests, and many others. Additionally, DataRobot’s team of experienced data scientists is constantly researching, developing, and testing new open-source algorithms, ensuring the platform incorporates the most state-of-the-art supervised machine learning models.

Learn More About AI

  • Blog: How machine learning works
  • DataRobot Documentation: Modeling
  • Blog: Introducing No-Code AI App Builder
  • White Paper: MLOps 101: The Foundation for Your AI Strategy

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.