## Explaining machine learning algorithms, how they work with data, and how they are used

The purpose of this post is to provide an overview of the various types of machine learning algorithms, the manner in which these algorithms interact with data to create machine learning, and the application of different machine learning algorithms.

Machine learning is a function of artificial intelligence. The process of machine learning may be defined as the act of feeding a set of data into a specific algorithm that interacts with the data in order to analyze it. The data is organized, segmented, or “parsed” and utilized to make predictions, reach binary decisions, or detect patterns within a set of data.

Three distinct types of algorithms exist for machine learning. These represent three distinct styles of machine learning that can be employed.

### Supervised Machine Learning Algorithms

Supervised machine learning is employed to facilitate the generation of actionable insights pertaining to real-world scenarios. Supervised algorithms can be divided into two subcategories:

- Regression algorithms are employed to forecast a numerical value, contingent upon fluctuating variables. Examples of regression algorithms in action include predicting a person’s salary based on their level of education, determining the likelihood of developing a specific ailment at a given age, or determining the value of a house by considering various factors.
- Classification algorithms are employed to predict an exact value of a given entity in a binary sense. The classification is based on a dichotomous scale, with the values “true” and “false” representing the two possible outcomes. The values “0” and “1” are used to represent the two possible states of the input data, which can be either a photograph of a duck or not a photograph of a duck.

Supervised learning is predicated upon the utilization of a corpus of data that exhibits exemplars of the “correct” response to the mathematical function in question. In the case of a regression algorithm, it is necessary to provide data that demonstrates the relationship between a given salary at a specific level of education, age, and other factors that contribute to the development of a particular ailment, or the values of houses under specific conditions.

In the case of a classification algorithm, data including examples of what is true or false must be included. It is evident that the greater the quantity of training examples, the more accurate the prediction will be.

#### Popular Supervised Machine Learning Algorithms:

**CLASSIFICATION**

Logistic regression is a classification algorithm that is employed when a binary answer to a question must be determined from one or more independent variables. In essence, they forecast the probability of an event occurring. To illustrate, one might inquire as to the probability of a person experiencing a heart attack in the presence of a set of specified conditions. What are the probabilities of an individual resigning from their position based on a set of specified conditions? The outcome is dichotomous. The answer is either affirmative or negative, or true or false.

Naive Bayes (Classification) is an algorithm that is employed in categorical contexts, such as the determination of whether an email is spam or not, the categorization of news, or even face recognition.

Logistic regression is a classification algorithm that is employed when a binary answer to a question is required, based on the input of either one or multiple independent variables. In essence, they forecast the probability of an event occurring. For example, one might inquire as to the probability of a person having a heart attack based on a set of X conditions. What are the probabilities of an individual resigning from their position based on a set of specified conditions? The outcome is dichotomous. The answer is either affirmative or negative, or true or false.

Support Vector Machines (SVMs), which are primarily used for classification, employ hyperplanes to divide data in the most optimal manner. In essence, this technique plots a line between two categories of data, with the objective of dividing items into either one set or the other with the highest level of accuracy. This process can be repeated with different sets of data to achieve the optimal categorization of an item. This approach can be employed for the classification of images, including facial recognition (a more accurate method), handwriting recognition, and text/article categorization.

The Random Forests (Classification) algorithm is a decision-tree ensemble method that combines multiple decision trees to reach a solution. Each tree is assigned a random portion of the data, ensuring that every tree is running solutions for different but similar data. Subsequently, the solution that was most prevalent among the majority of trees can be identified. This algorithm is most effective when applied to datasets comprising a significant proportion of data.

**REGRESSION**

AdaBoost (Regression or Classification) is an algorithm that can be used in conjunction with other algorithms to enhance the accuracy of the solution. It is commonly referred to as Adaptive Boosting. The process entails the repeated refinement of a set of data with the objective of enhancing its quality. Once an algorithm has been executed, the outliers can be identified and utilized exclusively in subsequent algorithms to identify the source of the error.

Decision trees (regression or classification) are algorithms that present appropriate solutions based on certain conditions that branch from the main topic. Decision trees can be employed in target marketing, such as determining which individuals should be sent an invitation to apply for a credit card or a complimentary trial of a product based on the probability that they will ultimately purchase the product.

Linear regression (regression) is a statistical technique that employs a traditional linear function (y = mx + b) to generate a prediction for a specific set of conditions. Examples of such applications include the aforementioned education salary or house value.

The Nearest Neighbor algorithm is a regression algorithm that is often used to identify similar items through a process known as a k-NN search.

### Unsupervised Machine Learning Algorithms

Unsupervised algorithms are employed to identify patterns within data and to create descriptive models. The primary function of unsupervised learning is to organize databases, which provides structure and enables scientists to make sense of unlabeled data. In this way, unsupervised algorithms are able to present information that a scientist might not have considered. This technique is necessary when a set of data exists without a precise goal or model. No training data is available or prescribed in unsupervised learning.

*Descriptive modeling is a mathematical process that describes real-world events and the relationships between factors responsible for them.*

There are two subcategories of algorithms for unsupervised machine learning:

- Clustering algorithms are designed to separate data into groups or clusters based on shared characteristics and attributes. The data that is clustered together will exhibit greater similarities than that found in other clusters. Clustering algorithms are non-binary in that they are capable of organizing data into multiple clusters, rather than merely dividing it into two distinct groups.
- Association rule mining algorithms are essentially “if/then” statements that identify commonalities between pieces of data. In contrast to clustering algorithms, which seek to identify common associations in data, ARMs are designed to identify the causes of these associations. In other words, clustering is the identification of the “what,” while association rules are the identification of the “why.” The objective of association rules is to understand the clusters and make predictions.

#### Popular Unsupervised Machine Learning Algorithms:

**CLUSTERING**

K-means clustering (also known as linear clustering) represents the most popular model of clustering, which divides data into multiple clusters for analysis. A number of points on a graph are selected as the center points for each cluster, each representing a specific variable. Subsequently, the data is allocated a position on the graph in accordance with its relationship to each center point, thereby facilitating the grouping of data that is similar in nature. This process must be repeated multiple times, as the location of a center point can affect the results.

Hierarchical clustering (also known as linear clustering) is a method of arranging data in a tree-like structure, known as a dendrogram. As the degree of similarity between data points diminishes, the data disperses from the trunk of the tree. Dendrograms may occur horizontally or vertically across a graph.

Distribution-Based Clustering algorithms assign a specific outcome as the center variable for each cluster. The data is organized according to the outcome, and the results will demonstrate which data led to which outcomes.

Density-Based Algorithms (Non-Linear Clustering) – These algorithms are analogous to k-means clustering, whereby data that is more similar is grouped together. In contrast to k-means, it does not require a specified number of clusters to be defined a priori. Instead, it is capable of automatically creating clusters.

**ASSOCIATION**

The Apriori Algorithm (Association Rule) is a data mining technique that operates on a set of data containing a large number of transactions. These transactions may be items purchased by customers or medical reactions to a particular medication. The information extracted from the transactions is used to make predictions about what variables will lead to a given outcome. In the context of this algorithm, the outcome may be a sale or a side effect.

The Eclat Algorithm (Association Rule) is a data mining technique that is used to detect direct correlation between data sets in a transactional context. For instance, if an individual purchases chips, there is a high probability that they will also purchase salsa, or two books that are frequently purchased in conjunction with one another by a significant number of individuals.

FP-growth Algorithm (Association Rule) – This algorithm represents an advancement over Apriori, as it identifies frequent patterns through the use of a tree ‘growth’ technique that illuminates various possibilities in a more efficient manner.

### Reinforcement Machine Learning Algorithms

Reinforcement learning, which draws inspiration from behaviorist psychology, is a process of machine learning that functions without the need for training data, much like unsupervised learning. The programs in question learn through decision-making functions, which are algorithms that describe how the algorithm should and can behave. Subsequently, the program employs the decision-making process to execute an action. If the decision is deemed to be beneficial, it is reinforced and considered a reward. The program determines the quality of a decision only after it has been made. This process is repeated continuously until the program is terminated. The process of reinforcement learning is regarded as a promising avenue for artificial intelligence research, as it most closely resembles the manner in which humans learn. Reinforcement learning algorithms can be utilized in a multitude of applications, including computer versus human strategy games, self-driving cars, robotic hands, and numerous other domains.

**REINFORCEMENT MACHINE LEARNING ALGORITHMS:**

- Q-Learning is a simplified form of reinforcement learning that involves predicting the value of Q given other values in a matrix.
- Temporal Difference is a process that predicts future quantities, such as the number of rewards expected over a given period of time.