# Quadratic Multilinear Discriminant Analysis for Tensorial Data Classification
## 4 Experimental Results
### Tensors from ECG Data  
We further tested our method on tensors we constructed from ECG signals in the PTB Diagnostic ECG Database [34] publicly available on PhysioNet [21]. Tensor-based techniques have proven to be especially effective on ECG data, and have been successfully applied in a variety of settings: data compression, irregular heartbeat classification, detection and quantification of T-wave alternans, and analysis of changes in heartbeat morphology (all surveyed in [4]). In classification problems using features extracted from ECG signals via tensor methods, linear SVM has proven to perform well. For example, in [5] linear SVM is successful in detecting and localizing myocardial infarction. Here we consider a classification problem of third-order tensors of features extracted via taut string from multi-lead ECG recordings. The taut-string method is used to approximate the signals with piecewise linear estimates, from which one can extract features such as mean, standard deviation, skewness, and kurtosis. This approach on ECG signals has already been successfully applied in [22], where feature vectors were classified using linear SVM (which performed best among the vector-based machine learning techniques considered). Here we construct third-order tensors using the taut-string approach, and classify the tensors with MDA techniques, as well as linear SVM. We first briefly review the method for constructing the taut-string piecewise linear approximation of an ECG signal. For a discrete time signal \(z=(z_{0},z_{1},\ldots,z_{n})\) and a fixed \(\varepsilon>0\) (which is different from the regularization parameter \(\varepsilon\) mentioned earlier), we define \(x=\mathrm{TS}(z,\varepsilon)\) to be the time signal \(x\) such that \(\|z-x\|_{\infty}\leq\varepsilon\) and \(\|D(x)\|_{2}\) is minimal, where \(D(x)=(x_{1}-x_{0},x_{2}-x_{1},\ldots,x_{n}-x_{n-1})\) is the discrete derivative. We can picture \(x\) as a string between \(z-\varepsilon\) and \(z+\varepsilon\) which is pulled tight. We can alternatively think of this process in terms of the decomposition \(z=x+y\), where \(x\) is a denoised, smoother approximation of \(z\), and \(y\) is the noise with \(\|y\|_{\infty}\leq\varepsilon\). An efficient algorithm to compute \(\mathrm{TS}(z,\varepsilon)\) is described in [35]. One advantage of this method is that--by varying the parameter \(\varepsilon\)--it allows us to consider different scales and multiple approximations of one signal at the same time, and thereby extract higher order features (a matrix of features from a single signal). In [22], the taut-string method was applied to the heart rate variation (HRV) signal that measures time intervals between consecutive R-peaks in the ECG signal. We will apply the taut-string method to the ECG signal itself. For larger values of \(\varepsilon\), the signal \(x=\mathrm{TS}(z,\varepsilon)\) extracts only the R-peaks, and for slightly smaller values of \(\varepsilon\), \(x=\mathrm{TS}(z,\varepsilon)\) will also capture the main features of the \(T\)-wave. By varying \(\varepsilon\) and capturing statistics about \(x=\mathrm{TS}(z,\varepsilon)\) and \(y=z-x\), one captures important aspects of the morphology of the ECG signal at multiple scales. The PTB dataset consists of multi-lead ECG recordings from both healthy patients and those with various health conditions (predominantly myocardial infarction). We only considered recordings that are at least 90 seconds long, truncated them to a fixed length of 90 seconds and removed noise with a Butterworth filter. We then applied the taut-string method to each of the 12 leads using 5 fixed parameter values (0.0100, 0.1575, 0.3050, 0.4525, and 0.6000), and finally extracted 6 features from each lead (number of line segments, number of inflection segments, total variation of noise, total variation of denoised signal, power of denoised signal, power of noise). In the end, we obtain a tensor from each recording of size \(6\times 5\times 12\).