# X-ray Diffraction Data Analysis by Machine Learning Methods--A Review
## 3 Introduction to Machine Learning
The ML algorithm tries to identify patterns or clusters in the data that are not known a priori, making unsupervised learning useful for tasks such as data exploration, dimensionality reduction, or anomaly detection [84]. Common unsupervised learning algorithms include K-means clustering, Gaussian mixture, fuzzy c-means (FCM), hierarchical clustering, principal component analysis (PCA), and autoencoders [87]. * The K-means method is used for partitioning the data into a predetermined number of K disjoint clusters, which are chosen with the aim to evenly distribute the variance between different clusters [86];
* Gaussian mixture models are probabilistic in nature and try to represent the input data as a mixture of a finite number of Gaussian distributions with unknown parameters to be learned during training [86];
* In fuzzy clustering, points are not assigned (only) to specific clusters; instead, each point has an association (weight) with each cluster. Since each point can belong to more than one cluster, fuzzy c-means is sometimes referred to as soft K-means [86; 88];
* Hierarchical clustering works by successively merging or splitting clusters to create a tree-like (nested) representation of the data. In agglomerative clustering, a hierarchy is built using a bottom-up approach (each observation starts as a single-item cluster, and clusters are successively merged until a single, all-encompassing cluster is formed) [86];
* PCA is a linear decomposition technique used for reducing the dimensionality of the data by projecting it onto a lower dimensional space while preserving the most amount of variance; in kernel PCA, the algorithm is applied to a transformed version of the data [86; 88];
* Autoencoders use ANNs to learn an encoder-decoder pair that can efficiently represent unlabeled data: the encoder compresses the input data, while the decoder reconstructs an output from the compressed version of the input. Autoencoders are suitable for unsupervised feature learning and data compression [86]. Deep learning utilizes artificial neural networks with multiple layers (deep architectures) to learn hierarchical representations from data [84]. Common algorithms include convolutional neural networks (CNN), and recurrent neural networks (RNNs, which are more suitable for sequential data such as speech in natural language processing applications) [87]. * CNNs, belonging to the artificial neural network group, are commonly used in image data analysis. Their name stems from the mathematical operation convolution, which is used in at least one of the neuron layers, instead of the simpler matrix multiplication used by regular ANNs [86];
* The architecture of RNNs makes them suitable for identifying patterns in sequences of data and are used for applications such as speech and natural language processing. In contrast to regular ANNs, in which calculations are performed layer-by-layer from input to output, in recursive NNs information can also flow backward, allowing the output from some nodes to affect their inputs in the future (in subsequent evaluations of the neural network), thus introducing an internal state useful for inferring meaning in text processing based on words previously read by the algorithm [86; 89];
* Long short-term memory (LSTM) units were introduced within the RNN framework to enable RNNs to learn over thousands of steps, which would have not been possible otherwise because of the problem of vanishing or exploding gradients (that accumulate and compound over multiple iterations of the NN) [86; 89]. In reinforcement learning (RL) an agent learns to make decisions by repeatedly interacting with an environment. The agent receives feedback (rewards or penalties) based on its actions and uses this information to tune its parameters and improve its decision-making process over multiple iterations. It is commonly used in robotics, computer games, and control systems [84].