# X-ray Diffraction Data Analysis by Machine Learning Methods--A Review
## 3 Introduction to Machine Learning  
Machine learning (ML) is a type of artificial intelligence where computer algorithms \"learn\" from example data and can make predictions without being explicitly told what to do or how to achieve their targets. ML is a powerful data analysis tool, used in diverse applications, such as data processing, pattern recognition, and automated decision making. To build a machine learning model capable of making predictions, training data are first collected and processed, then a (machine learning) model is chosen, which is then trained and evaluated for the intended task [84]. Machine learning encompasses several paradigms, each offering unique approaches to tackle different data analysis challenges. By leveraging these ML techniques, researchers can automate efficient and accurate data interpretation, leading to significant advancements in materials science, chemistry, and other fields. We briefly present five fundamental paradigms of machine learning below. Supervised learning is a type of ML in which an algorithm learns from sets of labeled data where both the input data and corresponding desired output are provided during training. The goal of supervised learning is to learn (or optimize) the parameters of a mapping function and use it to accurately predict the output for new inputs that are not available to the algorithm during the training phase [84]. Common algorithms and structures used in supervised learning include linear regression (when the output is a continuous variable), support vector machines (SVMs), decision trees (DTs), random forests (RFs), k-nearest neighbors (KNN)s, naive Bayes (NB), and neural networks (NNs) [85]. * SVMs, which are very suitable for binary classification and linearly separable data, work by transforming (mapping) the input data to a high-dimensional feature space such that different categories become linearly separable [86];
* Decision trees work (as their name implies) by inferring simple if-then-else decision rules from the data features and can be visualized as a piecewise constant approximation of the data [86];
* Random forests (RFs) are ensemble methods that make predictions by aggregating the output of multiple decision trees. Randomness is built into the algorithm to decrease the variance in the predictions of the generated forest. RFs are robust in overfitting and useful for both regression and classification applications. A different ensemble method, called \"extremely randomized trees\" may be employed to increase the prediction power by reducing the variance [86];
* Nearest neighbor methods predict labels from a predefined number of training samples that are closest to the given input point; in KNNs, this number is a user-defined constant [86];
* Naive Bayes methods are an application of [PERSON] theorem under the \"naive\" assumption that input features are independent from each other [86]. For example, this assumption would be violated when using length, width, and area as input features in the same data analysis workflow;
* Neural networks can identify and encode nonlinear relationships in high-dimensional data; sometimes NNs used in machine learning are referred to as ANNs, where the letter A stands for \"artificial\". NNs are composed of layers of \"neurons\" that mimic their biological counterparts: they have multiple input streams (which work like dendrites) and a single output activation signal (similar in function to an axon). Each layer of neurons has adjustable parameters that are used to compute the output signal. Based on the connectivity between layers, NNs can be categorized as dense (whereby each neuron in a layer is connected to every neuron in the previous layer) or sparse. The term multilayer perceptron (MLP) is sometimes used to refer to modern ANNs; MLPs consist of (at least three) dense layers: input, output, and at least one hidden (other) layer [86]. Unsupervised learning involves finding structure and relationships in data without using explicit (output) data labels.