# Performance Comparison of Machine Learning Disruption Predictors at JET
## 3 Models Implementation and Results  
When training a data-driven algorithm, pre-processing of the input data is essential for the successful development of the model. The data from the HRTS, the electron temperature, and the density profiles have been pre-processed using a procedure based on the correlation of the measurements of each line of sight to those of their neighbours, and also by exploiting the estimated error measurement from the diagnostic [42]. The unreliable measurements can then be replaced by the interpolated values between the two closest lines of sight. Moreover, the outer nine lines of sight (major radius greater than 3.78 m) have been discarded, as they do not provide reliable measurements in the analyzed dataset. For the Bolometer 1D data, negative power values have been substituted with null values, whereas unreliable positive ones are saturated to 1 MW/m\({}^{2}\), which is a threshold empirically found. All the diagnostic data are resampled causally, which means using only current and past inputs, with a sampling time of 2 ms. Note that a causal resampling is necessary to develop algorithms in a real-time framework.  
A data reduction is performed as described in [8] in order to represent the two classes (disrupted and non-disrupted) with the same percentage of training samples, and the repetition of discharges with the same or similar settings is avoided. In this way, the algorithm can be trained without up-weighting the errors on the disruptive samples.  
Many ML models require to have, as an input, a plasma feature vector of \(n\) values corresponding to the time series, sampled at the same time \(t\). In order to encode the spatial information contained in the 1-D plasma profiles, 0-D peaking factors of temperature \(\left(Te_{pf}\right)\) and plasma density \(\left(ne_{pf}\right)\) were defined as the ratio between the mean values of the measurements over the core region of the plasma cross-section divided by the mean value of the measurements of the outer region of the plasma. Similarly, the radiated power \(\left(Rad_{pf-CVA}\right)\) peaking factor is evaluated by dividing the mean values of the core measurements by the mean values of the outer channels, excluding the divertor lines of sight (channels 1-8), and instead \(Rad_{pf-XDIV}\) is defined by averaging the contribution of the divertor channels and dividing it by the mean value of the remaining channels, excluding the core ones (channel 13-16) [8; 36]. They are used here as plasma features of the MLP-NN and GTM models together with the corresponding samples of internal inductance \(l_{i}\), and the radiated fraction of the total input power \(P_{frac}=\frac{P_{half-TOT}}{P_{TOT}}\). The normalized locked mode amplitude \(LM_{norm}\) signal is used in the MLP-NN model as a further element of the feature vector while it is used in the GTM-based prediction model as an external signal in the multiple condition alarm scheme proposed in [8].  
Conversely, CNNs have the ability to learn spatiotemporal features directly from the plasma profiles, overcoming the limits of the previously cited 0-D peaking factors, such as some heuristic choices in the definition and the inevitable loss of information. Hence, in the CNN DP model [33], for each plasma profile, a spatiotemporal matrix is built, whose elements assume the value of the measure in the corresponding line of sight of the corresponding diagnostics and the corresponding time sample. The obtained images are vertically stacked, normalized with respect to the signal ranges in the training set, and segmented using an overlapping sliding window of 200 ms, obtaining the corresponding feature vector elements. The 0-D signals \(l_{i}\), \(P_{frac}\), and \(LM_{norm}\) are also sampled in this model at the same sample frequency as the 1-D data.