Automated W7-X sawtooth crashes detection and characterization

Sawtooth crashes are observed during ECCD experiments at the superconducting optimized stellarator Wendelstein 7-X. The study and the characterization are necessary in order to understand under which condition ECCD can be driven without posing a risk to experimental operations. The development of automatic tools is crucial to speed up the analysis of extensive datasets. In this work, we report on the first attempt of using a data-driven approach to automatically characterize the sawtooth crashes. Cluster algorithms are applied to the dataset, confirming the existence of two distinct types of crashes. This approach allows to study the two groups separately and underlines the different plasma parameters that influence the sawtooth crash parameters, for instance crash amplitude and period.


Introduction
The superconducting optimized stellarator Wendelstein 7-X (W7-X) [1,2] is designed to operate low-shear magnetic configurations avoiding low-order resonant surfaces within the confinement region.Low-order resonant values of the rotational transform are however reached at the plasma edge.Such a See Grulke et al 2024 (https://doi.org/10.1088/1741-4326/ad2f4d)for the W7-X Team.* Author to whom any correspondence should be addressed.
Original Content from this work may be used under the terms of the Creative Commons Attribution 4.0 licence.Any further distribution of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI.
islands are an integral part of the divertor itself, determining the strikelines, i.e. the regions where the heatflux coming from the confinement region is deposited onto the divertor plates [3][4][5].Strikeline control is crucial, in order to prevent damages of components not suited to sustain high heatfluxes [6,7].The position of the strikelines can be varied by toroidal currents flowing in the plasma, affecting the rotational transform [8].Although W7-X was optimized to minimize the bootstrap current [9], this can still be present, especially at high beta.Electron cyclotron current drive (ECCD) [10][11][12] constitutes a flexible tool to control and tailor the rotational transform [13].Experiments have proven successful in balancing the bootstrap current with external current drive but, in many circumstances, the plasma is observed to experiment sawtooth crashes [14] of different type [15,16].Confinement degradation and even the loss of the plasma occurred in a limited number of crashes [16,17].A characterization is therefore crucial to better understand the phenomenon in a stellarator context, to develop experimental scenarios that enable driving ECCD without triggering sawtooth crashes posing operation limitations or even improve them, for instance by flushing out impurities [18].Experimental data suggest that sawtooth crashes at W7-X can be divided into different groups, characterized by different spatial and time scales [15,16] and triggered by different modes [19,20].In this work, we report on the first attempt of using a data-driven approach to automatically characterize and analyze sawtooth crashes at W7-X.The development of automatic data analysis tools is crucial for a fast analysis and the use of larger datasets.The two main applications for future experiments are the crash pattern recognition, which could highlight different physical processes and the development of predictive models enabling safe ECCD/sawtooth scenarios.The work is structured as follows.In section 2 we discuss the dataset and the clustering in section 3.In this section, we present some examples in which the algorithm was successful in identifying different crash types and discuss the current limitations.The approach and dataset limitations are discussed in section 4. Finally, the conclusions and future developments are discussed in section 5.Moreover, more advanced dimensionality reduction and manifold learning algorithms such as the Self-Organized Map (SOM) [21,22] to improve the clustering performance and the visualization.

Experimental set up
W7-X is a superconductive optimized stellarator whose magnetic field is generated by 50 non planar and 20 planar coils.The minor radius a is about 0.5 m (depending on the magnetic configuration) and the major radius R is 5.5 m.The magnetic field on the axis of the so-called 'bean-shaped plane' is around 2.5 T. W7-X is a low-shear stellarator and the rotational transform (− ι) depends on the magnetic configuration.The experiments used in this work were performed using the so-called standard configuration with a (vacuum) core rotational transform − ι ≈ 0.85 and a (vacuum) last closed flux surface (LCFS) − ι ≈ 0.97.In this work, we focus on pure electron cyclotron resonance heating (ECRH) experiments conducted using the so-called standard configuration, co-ECCD (i.e. the current is driven in such a way that the rotational transform is increased) with a peaked deposition profile around r/a ≈ 0.15.According to the performed modeling [15,16,20], the rotational transform is increased in proximity of the deposition region and the − ι = 1 surface is crossed and a dominant (m, n) = (1, 1) mode is destabilized, resulting in a sawtooth crash.Additionally, it is found [16] that due to the current diffusion, − ι weakly decreases next to the plasma core, a − ι = 5/6 resulting in a weaker sawtooth crash.Three experiments (20171206.025,20171206.028and 20171207.008)were conducted with a reversed magnetic field (−2.52 T, therefore the co-current has a negative sign).For this work, we use the electron temperature T e , measured by electron cyclotron emission (ECE) [23] line integrated electron density n e (measured with a dispersion interferometer [24]), toroidal current I tor , measured with Rogowski coils and the diamagnetic energy W dia [25].These three parameters yield information about the plasma (electron) pressure p and toroidal current of the system.The ion temperature T i is generally around 1 keV and has been neglected for this work since the coupling between ions and electrons is relatively poor for the considered densities (1 − 3 × 10 19 m −2 ).Therefore, no significant T i variation is present.

Data
For visualization, we choose representative experiments in which the ECE worked reliably (Experiment 20171207.025and 20171207.028)and example (Experiment 20180918.023), in which ECE signals are characterized by a higher noise as well as malfunctioning of core channels, resulting in large crash parameter uncertainties.Data analysis is however repeated for a larger number of experiments, whose plasma parameters as well as the magnetic field and ECCD direction are reported in table 1. Identification of sawtooth crashes is based on a ridge detection algorithm, based on the continuous wavelet transform (CWT) [26], applied to Electron Cyclotron Emission (ECE) time traces, which provides precise localization, reliable edge detection and it is well suited for noise filtering.An example is given in figure 1(a).Here the electron temperature for a core ECE channel is displayed.The core temperature timetraces before (T b e , in blue) and after (T a e , in red) the crash are averaged for 1000 µs and 15 µs, respectively and the T e ECE profiles are displayed in figure 1(b).For every radial location, the relative (∆T = (T a e − T b e )/(T b e )) temperature change is calculated and a typical radial profile of the relative electron temperature changes is plotted in figure 1(c).Low-field side and high-field side ECE channels are mapped to a negative and positive radial position, respectively.From this profile, the crash amplitude ∆T (relative change of the core electron temperature T e due to the sawtooth crash) and the high-and low-field side inversion radii (r inv,hfs , r inv,lfs , radial position at which T e is kept constant during the crash) are calculated.
Additionally, at the crash time, the plasma parameters I tor , T e and n e and W dia are calculated by averaging over 1 ms.We chose these parameters for the initial version of our algorithm, in order to have information about the following macroscopic quantities that are used to characterize the experiments and verify whether they correlate with the crash parameters.The electron temperature T e on the axis and the line integrated electron density n e are chosen as a measurement of the central pressure, although T e is a local measurement and n e a line integrated one.However, this does not constitutes a relevant contradiction, since low beta W7-X plasmas are characterized by a flat density profile.I tor is chosen as a natural quantity for the amount of driven current.The absolute value of the toroidal current is taken into account, since in experiments with  reversed magnetic field I tor has a negative sign, although the ECCD is driven in all cases in such a way that the rotational transform is increased.Finally, we also include W dia since it measures the overall stored energy.As explained in the next section, we neglected parameters that do not change within the experiment, such as the injected ERCH power P ERCH and the magnetic field direction.The influence of different P ERCH within different experiments are however indirectly taken into account in T e and W dia .
The crash and plasma parameters of the mentioned experiments are presented in figure 2, where the (r inv,hfs , r inv,lfs and ∆T are plotted in the first three panels, respectively.The core T e is plotted in the fourth, the toroidal current in the fifth and the line integrated electron density in the sixth and the diamagnetic energy in the seventh.A magnification is plotted in figure 3. The interested reader can find a more detailed description regarding the phenomenology in [15], whereas we report here a brief description of the main features.The presence of crashes with different amplitude is well visible in the fourth panel (ECE time trace, red), in which smaller amplitude crashes are alternated by higher amplitude crashes.The latter can be strong enough to temporarily affect other plasma parameters, such as the diamagnetic energy or the toroidal current, which recover on a timescale consistent with the confinement time.

Data analysis tools
The following algorithms, from Scikit-learn [27], are used to extract the crash patterns and automatically label them.In this section we briefly summarize the main features of the used tools and the results are presented in the next section.Data are first normalized by removing the mean and scaling to unit variance.Principal Component Analysis (PCA) is performed on data, in order to reduce dimensionality.PCA is an orthogonal linear transformation that decomposes a multivariate dataset into a set of orthogonal components, constituting the base of a new coordinate system.The new components are sorted by their variance and therefore, the first component is the component with the highest variance, the second component has the second-highest variance and so on.The values of the old coordinate system are then projected onto the new one and are called scores.The components of the PCA eigenvectors are called loadings and they describe how much each variable contributes to a certain principal component.In this work, we kept as many principal components as necessary to preserve up to 90 % of the original variance.
The DBSCAN cluster algorithm [28] is applied to the scores obtained with PCA.DBSCAN clusters are defined as  regions of high point density separated by low point density regions.In such a way the algorithm can work with arbitrarily-shaped clusters.Each cluster is composed of core samples and non-core samples.A point is a core sample if it is located within a distance (eps) from at least a certain amount of point (min samples).Non-core samples are points which are within a distance eps from a number of points lower than (min samples).If a point is neither a core sample nor a non-core sample it is classified as noise.This approach helps remove wrongly detected transient events not related to sawteeth crashes detected by the CWT algorithm.As a score for the cluster division goodness we use the Silhouette score [29].Such a score is based on two quantities: a and b. a measures the intra-cluster distance, i.e. the average distance of a point with respect to all the other points of the same cluster.b measures the distance between one point of a cluster and all the other points in the clusters it is not part of.Finally, the Silhouette score of each point i is defined as: The best value is 1, representing that the clusters are dense and well separated, while the worst value is −1, indicating that different clusters do not differ from each other.For every experiment, the hyperparameters (eps) and (min samples) are chosen in order to minimize the noise for values between 0.95 s max and s max , where s max is the maximum of the Silhouette score, calculated over eps ∈ [0.6, 1.8] and min samples ∈ [4,30].
Additionally, the cluster prediction of an experiment was assessed by trying to identify cluster labels in other experiments, thus verifying whether different experiments have a similar score distribution in the PCA space.The procedure is based on the cluster analysis of two experiments, let us name them A and B. The scores and labels of A are used to train a linear classifier (LogisticRegression), in order to predict the cluster labels of B. The cluster labels for B found with DBSCAN and those predicted with the linear classifier are then compared to verify whether a similar result is obtained.The classification performance is calculated using two different F1 scores [30,31], using the Scikit-learn functions: F1 macro , which calculate the average of the F1 score for every label and F1 weighted , in which the label F1 scores are weighted, to account for the different size of the groups.

Data analysis results
We start testing the algorithm on experiment 20171206.025,on which a manual division into clusters was performed in a previous publication [15].The dataset consists of 446 points for every feature and is characterized by a large variation in toroidal current (from 0 to −12 kA), and moderate changes in T e , n e and W dia , mainly caused by gas puffing.Additionally, the ECE data, on which the crash detection analysis is based, show a good reliability for almost all channels.Principal component analysis (PCA) analysis is performed on the scaled data in order to reduce the dimensionality and we restricted the component choice to those with an explained variance higher than 0.1.In such a way, three components are taken into account, accounting for about 91% of the variance and the scores are displayed in figure 4, where the first component is plotted against the second (left plot) and the third (right plot), respectively.The vectors, in red, corresponds to the loadings and describe how an increase in a given variable influences the position of a sample in the new coordinate space.It is possible to see that r inv,hfs , r inv,lfs and ∆T contribute mainly to the first principal component, I tor , T e and W dia to the second and n e to the third.
The clustering algorithm [28] was applied to the PCA scores, taking into account the first three principal components (explaining up to 91 % of the total variance) and discarding the remaining.The clustering algorithm DBSCAN is applied to the scores with different hyperparameter values and the Silhouette score s is calculated and plotted, along with the number of clusters and the noise as a function of the hyperparameters in figure 5.The hyperparameters used to cluster the data are chosen in such a way to yield a Silhouette score up to 95 %s max , where s max is the maximum of the Silhouette score, have the same number clusters of s max and minimize the noise.In such a way, the highest score (s = 0.59, n noise = 6) is found for eps = 1.59 and min samples = 4, corresponding to two different clusters.DBSCAN labels are assigned arbitrarily, therefore in this work, we will label as '0', the cluster with the highest averaged first component value, '1' the cluster with the second highest and so on.
Results are presented in figures 6 and 7, in which two clusters, with different colors, are displayed, whereas the points not belonging to any of the found clusters are represented in black.In these figures three selected features (r inv,hfs , ∆T and I tor ) are plotted in the parameter space, to highlight the dependence of the crash parameters on I tor .It is possible to notice that the cluster division allows for better separation of the dependence of plasma parameters on crash parameters.The covariance matrices for unclustered and clustered data are reported in figure 8.We found a strong correlation between the crash parameters and the toroidal current for the cluster 0( >0.9), whereas a weaker correlation is found for the cluster 1, which is generally characterized by more scattered data (figure 7).No correlation is found if the unclustered data are considered.It should be noted that, for this experiment, a small T e and n e variation is present.The different correlation between I tor and the crash parameters is the result of the current redistribution after the crashes [16].For the label 1 crashes, the current and therefore the rotational transform are strongly influenced by the presence of label 0 crashes, influencing the crash pattern and resulting in a weaker correlation with the plasma parameters.The same approach was adopted also for the other experiments and the results are presented in table 2. It is possible to notice that the best Silhouette results are obtained for all the analyzed experiments when using two clusters, with the exception of experiment 20180918.029,whose PCA results and division into clusters are plotted in figure 9 whereas the clustered crash parameters and plasma parameters are plotted in figure 10.In this figure it is possible to notice that at the beginning of the experiment, two clusters (depicted in red and blue) are found until the n e increase, occurring at t 1.5 s, whereas two other clusters are detected after the n e increase, depicted in green and orange.The two groups of two clusters are composed as well by crashes with a higher and a smaller r inv and ∆T.The difference with respect to 20171206.025consists in the lower amount of points, resulting in lower density clusters, and higher variances for T e and n e , resulting in higher distances between points.The joint effect of having less dense clusters stretched along more PCA directions, makes the experiment not fully suitable to be clustered with DBSCAN.A possible solution consists of applying the cluster algorithm on the joint data of different experiments with comparable plasma parameters, in order to increase the number of points with high ne given as input to DBSCAN.The PCA results and the clustered crash parameters as a function of time are plotted  in figures 11 and 12, respectively.The Silhouette score is 0.33 (eps = 1.05, min samples = 5), therefore lower than scores found for clustering related to single experiments.

Classification validation
In the previous section we show that, unless in the case of experiments with a small statistics, most experiments are characterized by the existence of two types of crashes.In this section, we want to further validate the results, by analyzing whether the PCs of different experiments are consistent with each other and therefore whether the two crash types have a similar distribution in the PC space.In order to do so, the clustering algorithm was validated on different datasets, composed of data from other experiments, by performing the cluster analysis on two separate experiments and then training a linear classifier on one dataset and predicting the labels of the second one.In the selected example, the training dataset corresponds to the same shown above (experiment 20171206.025),whereas the test datasets are composed of data from experiments 20171206.028and 20180918.023.An example is given in figure 13.On the left plot, the first two principal components for experiments 20171206.025and 20171206.028are depicted.Data belonging to different clusters using DBSCAN are represented either in blue or in red, whereas outliers are plotted in black.On the right plot, the data from 20171206.025are used to predict the separation into clusters of 20171206.028and the labels found independently using DBSCAN are used as a ground truth for the classification.The algorithm was able to identify almost all the points.It is possible to notice that all points that were classified as belonging to a cluster are correctly labeled.This does not hold true for the outliers that are instead assigned to the other clusters.A counter example is given by experiment 20180918.023 in which crash parameters have high uncertainties as a result of noisy ECE signals and lack of core channels and, as discussed above, a larger variance is present for plasma parameters.Repeating the same process for 20180819.023,it is possible to notice that experiment 20171206.025fails at recognizing the same labels that are found by DBSCAN (figure 14).Whereas all points belonging to the '1' cluster are recognized correctly using the trained data, only 15 crashes over 51 are assigned to the '0' cluster.This is to be expected since the different plasma parameters changed the crash amplitude.By comparing the plasma parameters displayed in figure 2, it is possible to notice that for a similar value of |I tor |, the crash amplitude ∆T for 20171206.025is higher than in 20180918.023,thus making '0' cluster crashes more similar to '1' cluster crashes.
More generally, the algorithm was tested on other experiments, yielding comparable results.We use two F1 scores to measure the accuracy of the classification: F1 macro , which corresponds to the unweighted average of the F1 scores for every label and F1 weighted , which in turn takes into account the label size and weights the score accordingly.Results are reported in   table 3.As expected, higher F1 scores are obtained for experiments having a similar distribution in the PCA space as for experiment 20171206.025.In contrast, different distribution are instead found in experiments in which the plasma parameters changed significantly, resulting in an out-of-sample distribution of the scores.

PCA space of the entire dataset
In the previous section, we showed that experiments with different plasma parameters have PCA scores with different distributions in the PCA space.In order to assess whether the clusters found in each experiment correspond to similar  events, let us consider the points distribution in the PCA space of all experiments, as plotted in figure 15.The PCA space is created by using all the experiments together, but the assigned label corresponds to the clustering performed on single experiments, except for experiments 20180918.023and 20180918.029,which were clustered together due to the similarity in their plasma properties.Considering especially the projection onto the first two components, it is possible to graphically see that points belonging to one cluster are generally separated from the other cluster and do not overlap.In order to verify whether the two clusters are separated, we split the non-noise samples into a training set (with 70 % of the points) and a test set (with the remaining points).The first set is used to train a linear classifier to predict the labels of the test set, as done in section 3.3, and the classification results are reported in table 4.Only three points on a total of 463 are assigned to the wrong cluster.The presence of a net distinction between the two clusters is highlighted by the 2D projections of the decision regions in figure 16.Every plot shows the projection onto the PC 1-2 plane, for PC 3 = PC 4 = −1,0 and 1, respectively.This suggests that the two events can be linearly separated in the PCA space.Hence, the analysis shows that the approach is still able to classify the two types of crashes when considering the full set of experimental conditions observed.This result is promising in view of the extension of this approach to a broader set of W7-X plasma conditions.

Physical interpretation
The possibility of having different crash types destabilized by different modes was found in numerical works, such as [16,19] and experimental works, such as [15].In the latter, the cluster separation was purely based on the crash amplitude ∆T.Bigger amplitude crashes correspond to 0-labeled crashes, i.e. they present an higher r inv and ∆T and are associated with a (m, n) = (1, 1) mode [15].Smaller amplitude crashes correspond to label 1 crashes and present a smaller r inv and ∆T with respect to the other group.Additionally, as shown in figure 3 it is possible to observe that r inv and ∆T are reduced immediately after such a crash and increase again until the next label 0 crash occurs, resulting in a more scattered distribution in the parameter space (figure 7).A possible explanation for such a pattern can be explained by a strong redistribution of the toroidal current and assuming the 1-label crashes are not associated with a (m, n) = (1, 1) mode, but instead with (m, n) = (5, 6), as discussed in [16].This is not contradicted by the mode analysis.The crash separation based on plasma parameters and the crash spatial parameters allows for the introduction of another crash parameter, namely the crash period  for the two distinct crash types, which is not treated in this work.

Discussion and approach limits
It is shown that the algorithm is able to divide the dataset into two clusters most of the time.Unexpected results are found in the case of a small number of points.This is not surprising, since DBSCAN is a density-based cluster algorithm.A possible solution to this problem consists of performing the cluster analysis on the dataset composed of different experiments.In this case, the highest Silhouette score was obtained clusters, although the overall score was lower than for the experiments being clustered singularly.Such a decrease in the score can be explained by the fact that, although the experiments were conducted with similar plasma parameters, a difference is still present, thus spreading the points in the PCA space and making the clusters less compact.Additionally, we noticed that, with this approach, a smaller number of noise points is detected.These points, which are not assigned to any cluster if the analysis is performed on singular experiments, are not well connected to the rest of the cluster, contributing again in making it less compact and thus lowering the Silhouette score.This might suggest that maximizing the Silhouette score, without considering the number of noise    Cluster distribution on the principal component space.PCA space is obtained using all data together, whereas the label is assigned by applying the clustering algorithm singularly.points, can lead to more compact, but less numerous clusters.
A trade-off between the two values needs to be considered in future works.Finally, advanced dimensionality reduction and manifold learning algorithms such as the Self Organizing Map [21,22] could be explored to improve the clustering performance and the visualization.

Conclusions and future developments
In this work, we introduced an initial version of an algorithm for the automated analysis of sawtooth crashes at W7-X, tested on selected examples.It is shown that the algorithm is able to automatically divide the crashes into different clusters, with different distributions on the parameter space, although DBSCAN performs poorly in the case of small datasets.The division into clusters highlights the existence of two sawtooth types and shows more clearly the dependence between the plasma parameters and the crash parameters.The clustering algorithm is validated internally, by using hyperparameters that maximize the cluster separation and was also validated on different datasets belonging to different experiments, by training a linear classifier on one experiment and use it to predict the labels on another experiment.The validation was partially successful since the algorithm failed to recognize the same cluster labels in experiments with differing plasma parameters.Such a result is not surprising and means that the algorithm does not recognize the same clusters if the points are out of samples, i.e. the experiments are conducted at different plasma parameters.On the other hand, the cluster recognition capability of the employed algorithm increases drastically if different points from experiments at different plasma parameters are included to train the linear classifier.This suggests that the problem could be in future solved by larger datasets, obtained by performing experiments with broader plasma parameter scans and lays the foundation for future attempts to extrapolate the crash parameters at different plasma parameters, such as higher β or I tor .Moreover, the analysis also shows that extending this approach to other devices with different operating conditions is possible, by increasing the dataset.In fact, also other data-driven studies, especially in the disruption prediction field, have shown that a proper set of features eases the porting of the models from one machine to the other [32][33][34][35].
The presented work constitutes a first step for the development of a predictive algorithm for sawtooth crashes at W7-X, allowing for a better understanding the crashes at W7-X by implementing the experimental data with current diffusion model, which calculates the resistive diffusion of the rotational transform due to ECCD, and including a current redistribution model for the post-crash phase.Together with the experimental data regarding the distinct spatial and temporal crash scales, it might be possible to assess which resonant surfaces and therefore modes are associated with every crash, thus providing an additional validation to the so-far performed numerical works.Additionally, a predictive model can be employed for developing safe ECCD scenarios, by extrapolating the crash parameters at higher β or I tor and therefore enabling the use of ECCD for strikeline control [6,19] and at the same time avoid confinement degradation [17].Finally, it might be used to develop ECCD scenarios to improve plasma performance, for instance by flushing out impurities.

Figure 1 .
Figure 1.Left: Core ECE timetrace during a sawtooth.The temperature profiles before (blue) and after (red) the crash are displayed in the central plot and are used to calculate the relative electron temperature changes, displayed in the right plot.

Figure 2 .
Figure 2. Crash and plasma parameters of the three selected experiments used for this work.From top to bottom: the inversion radii r inv,hfs , r inv,lfs , relative change of the central electron temperature ∆T, core electron temperature Te, toroidal current Itor, line integrated electron density ne and the diamagnetic energy W dia .

Figure 3 .
Figure 3. Magnification of experiment 20171206.028.The presence of different sawtooth crashes with different amplitudes is visible in ECE time trace (fourth panel).Stronger events are seen to temporarily affect the diamagnetic energy of the plasma.

Figure 4 .
Figure 4. Scores of the principal components of 20171206.025The first component is plotted against the second and the third components in the left and right plots, respectively.The red vectors represent the PCA loadings.For this experiment, PC1 is mostly influenced by r inv,hfs , r inv,lfs and ∆T, PC2 by Itor and PC3 by T e0 and ne.

Figure 5 .
Figure 5. Scan of the hyperparameters of DBSCAN (eps and min samples) for the maximization of the Silhouette score.Left: Silhouette Score; center: number of clusters; right: noise.Data refers to experiment 20171206.025.

Figure 6 .
Figure 6.Data distribution in the (Itor, r inv (high field side) and ∆T ) space.The two clusters are identified by different colors, whereas outliers are plotted in black.

Figure 7 .
Figure 7. 2D projections of features (Itor, r inv (high field side) and ∆T) displayed in figure 6. Different colors indicate different clusters, whereas outliers are plotted in black.

Figure 8 .
Figure 8. Covariance matrices for: unclustered data (left), data with label = 0 (center), data with label = 1 (right).The division into clusters allows for better recognition of the main plasma parameters influencing the crash parameters.

Figure 9 .
Figure 9. Cluster distribution on the principal components space for 20180918.029,using eps = 1.26, min samples = 4.The first component is plotted against the second, the third and the fourth in the left, center and right plots, respectively.

Figure 10 .
Figure 10.Crash and plasma parameters for 20180918.029.The clustered plasma parameters inversion radii r inv,hfs , r inv,lfs , relative change of the central electron temperature ∆T, are plotted in the first three panels respectively.The cluster color scheme refers to figure 9.

Figure 11 .
Figure 11.Cluster distribution on the principal components space for 20180918.023and 20180918.029.The cluster algorithm was applied to the data from both experiments together.

Figure 12 .
Figure 12.Crash and plasma parameters for 20180918.023(left) and 20180918.029(right).The clustered plasma parameters inversion radii r inv,hfs , r inv,lfs , relative change of the central electron temperature ∆T, are plotted in the first three panels respectively.The cluster color scheme refers to figure 11.

Figure 13 .
Figure 13.Left: first two principal components for experiments 20171206.025and 20171206.028,the different colors correspond to different detected clusters.Right: data from 20171206.025are used to predict the separation into clusters of 20171206.028.

Figure 14 .
Figure 14.Left: first two principal components for experiments 20171206.025and 20180918.023,the different colours correspond to different detected clusters.Right: data from 20171206.025are used to predict the separation into clusters of 20180818.023.

Figure 15 .
Figure15.Cluster distribution on the principal component space.PCA space is obtained using all data together, whereas the label is assigned by applying the clustering algorithm singularly.

Figure 16 .
Figure 16.Decision region plot.Scores on PC 1 and PC 2 planes are represented.Different plot shows refers to the PC 1-2 planes for different values of PC 3 and 4. Scores belonging to the '0' and '1' clusters are plotted in blue and red respectively.Circles refer to the training set, whereas crosses to the test.Validation results are reported in table 4.

Table 1 .
Overview of the main plasma parameters for different experiments.The values in this table refer to an average of the values over the whole experiment.

Table 2 .
Cluster algorithm results.The last line refers to the results of the cluster algorithm applied to two experiments.

Table 3 .
Cluster label prediction results of every discharge by training a classification algorithm on 20171206.025.

Table 4 .
Confusion matrix of the performance of the test set (30 % of the total points).The true labels refer to the labels found by applying the clustering algorithm, whereas pred.labels indicate the labels predicted by a linear classifier.