Abstract
Linear and generalized linear scalar-on-function modeling have been commonly used to understand the relationship between a scalar response variable (e.g. continuous, binary outcomes) and functional predictors. Such techniques are sensitive to model misspecification when the relationship between the response variable and the functional predictors is complex. On the other hand, support vector machines (SVMs) are among the most robust prediction models but do not take account of the high correlations between repeated measurements and cannot be used for irregular data. In this work, we propose a novel method to integrate functional principal component analysis with SVM techniques for classification and regression to account for the continuous nature of functional data and the nonlinear relationship between the scalar response variable and the functional predictors. We demonstrate the performance of our method through extensive simulation experiments and two real data applications: the classification of alcoholics using electroencephalography signals and the prediction of glucobrassicin concentration using near-infrared reflectance spectroscopy. Our methods especially have more advantages when the measurement errors in functional predictors are relatively large.
Keywords: EEG, functional data analysis, functional principal component analysis, scalar-on-function modeling, support vector machine
1 Introduction
Functional data analysis (FDA) has been widely used to analyze data that are measured over time or some other continuum, such as electroencephalography (EEG) signals that reflect the brain’s spontaneous electrical activity over a period of time. FDA exploits the smoothness of the processes by considering the data as being continuously defined functions. One instance of FDA is scalar-on-function modeling (Reiss et al. 2017) which is commonly used to understand the relationship between a continuous scalar response variable and one or more functional predictors. When the response variable is binary, functional logistic regression may be used. Methods for fitting such models typically assume a linear relationship between the response variable and the functional predictors. Naturally, though, such techniques are sensitive to model misspecification when the relationship between the response variable and the functional predictors is nonlinear.
Support vector machines (SVMs; e.g. Hastie et al. 2009, Chapter 12) are among the most robust prediction models, and they work by constructing hyperplanes for classification and regression analysis. When the original input feature space is not linearly separable, an SVM will map the input features into a higher-dimensional space using a kernel trick. In the higher-dimensional space, the transformed features become linearly separable and that results in nonlinear boundaries in the original feature space. A straightforward approach to applying SVMs to functional data is simply to regard each discrete measurement as an input feature. However, such an approach does not take into account either the high correlation between repeated measurements or the continuous nature of the functional data. In addition, the standard SVM cannot be used when the observed measurements are irregular, ie in any situation in which functional observations are not observed completely on a common grid.
In this article, our goal is to exploit SVM techniques for classification and regression while accounting for the particular characteristics of functional data. Functional principal component analysis (FPCA; Besse and Ramsay 1986; Ramsay and Dalzell 1991) extracts the features that characterize the functional data and that “explain” most of the variance. These features are termed functional principal components (FPCs), and functional data can typically be well represented by the first few FPCs (Rice and Silverman 1991). FPCA generally employs regularization to account both for the smoothness of the functional data and for the measurement error (Rice and Silverman 1991; Ramsay and Silverman 2005; Besse and Ramsay 1986; Xiao et al. 2016). Wu and Liu (2013) proposed an approach to the classification of functional data that is based on applying SVM to FPC scores. This is similar in spirit to what we are proposing here, but their approach applies only to classification problems and is based on a model that requires each class to have a unique functional mean, which is similar to functional linear discriminant analysis (James and Hastie 2001). Our method also differs from kernel PCA (Schölkopf et al. 1997) which first applies a kernel function to project the original data into a higher-dimensional feature space, and then perform PCA on the kernel-induced feature space to extract the principal components. In contrast, our methods leverage the continuous nature of the functional data by first applying FPCA to extract functional PCs that capture the underlying variability in the functional data and then exploiting a kernel-based approach (specifically, SVM) to predict the outcome using these FPC scores as features. Thus, our approach combines the benefits of FPCA for functional data analysis and the power of kernel methods for classification or prediction tasks.
Here, we propose and validate a novel approach that extends the earlier work by Wu and Liu (2013) in two directions. Firstly, we allow both classification and regression problems, and secondly, we make no assumptions about the nature of the functional data. (The setting of Wu and Liu (2013) is one of five scenarios considered in Section 3.) We refer to our method as functional support vector machine (FSVM). We conduct simulation studies to explore the performance of FSVM and compare it with more traditional functional regression approaches and with classical SVM. We apply the methods to the EEG data to evaluate the classification performance and to near-infrared reflectance spectroscopy (NIRS) data to evaluate the regression performance. We conclude the paper with some discussion and remarks on potential future directions.
2 Methodology
In this section, we describe the approach, we take to address the problem of using functional data observations to predict scalar outcomes. We will do this by taking a two-step procedure. In the first step, we employ FPCA to extract FPC scores. In the second step, we utilize these FPC scores as features within a regular SVM algorithm.
Let be a random function, where is a bounded subspace of the separable Hilbert space, is a compact interval and . In practice, we typically have observations of such functions at a finite number of points, that are contaminated with error. Let denote the observed data of the ith sample, where , and the ’s, are independent and identically distributed (iid) and independent of the ’s. In addition, we observe univariate “response” variables, either class labels 1 and –1 (in a binary classification problem) or a continuous scalar response (in a regression problem). Our training set is .
Let be the mean function and be the covariance function. By Mercer’s theorem, , where are the eigenvalues and ’s are the corresponding orthonormal eigenfunctions. Then form a complete and orthonormal system of .
can be represented by and the FPCA expansion (Karhunen 1950)
| (2.1) |
where are the FPC scores of . The A ’s are random variables with and are uncorrelated across k.
We can estimate smooth FPCs (or eigenfunctions) ’s and the corresponding FPC scores A ’s using any FPCA approach (e.g. Ramsay and Silverman 2005; Yao et al. 2005; Xiao et al. 2016).
If we can choose K such that the first K FPCs account for most of the variation in and thus a good approximation can be realized from only the first K FPCs , then it is natural to consider using only the first K FPC scores to predict y . We will use these scores as input features for classification and regression analysis through SVM techniques.
2.1 Binary outcomes
We consider a binary classification problem using as input features in an attempt to minimize
| (2.2) |
over f, where f is some decision function. Suppose is the minimizer of (2.2), then . Stated differently, the two classes can be separated by a decision boundary . Equation (2.2) is equivalent to the misclassification error . Note that when and when . To solve the classification problem (2.2), we exploit SVM techniques, which we outline here.
An alternative to using the non-convex loss function in (2.2), would be to consider instead the hinge loss function and solve an optimization problem that also includes a penalty to control the smoothness of f
| (2.3) |
where and is a tuning parameter. when , and when . Therefore, the hinge loss is large if y is misclassified and a penalty is imposed to control the smoothness of f. If the input feature space (ie space of : ) is linearly separable, then we can find a linear decision function and solve the following optimization problem:
| (2.4) |
To increase model flexibility, we consider in the form , where is a symmetric positive-definite kernel function, the corresponding space of functions is a reproducing kernel Hilbert space (RKHS), and (Berlinet and Thomas-Agnan 2011). Thus, solving the optimization problem (2.3) is equivalent to solving
| (2.5) |
where is a matrix of for all pairs (i, l) and . Two popular choices for are the linear kernel which is particularly appropriate when the feature space is linearly separable; and the Gaussian kernel , where is a bandwidth parameter, which has demonstrated superior performance in practice when the feature space is not linearly separable. When is a linear kernel, (2.5) is equivalent to (2.4) and has the relationship . If is a Gaussian kernel, then is a nonlinear decision function. The “kernel trick” involves the first mapping to a higher-dimensional RKHS by means of a transforming function h with , where is an inner product. Next, the trick involves finding a linear decision function in the higher-dimensional space. The resulting decision function is typically nonlinear in the original space. Since the optimization problem (2.5) involves h only through the inner products, we only require knowledge of the kernel function but not .
An equivalent version (e.g. Hastie et al. 2009, Chapter 12) of the optimization problem (2.5) is
| (2.6) |
subject to the constraints
where are Lagrange multipliers and C is a regularization parameter that controls the tradeoff between the misclassification error and decision boundary complexity. Smaller C leads to a smoother decision boundary while larger C will allow a wiggly boundary. The solution of (2.6) is , where is computed as for any for which and . We call the resulting method the functional support vector classifier (FSVC).
Note that in contrast to our method that has a unique decision function , the proposal of Wu and Liu (2013) involved a separate decision function f for each class with parameter functions , where s is the class index. They first estimated FPC scores to reconstruct , ie , then estimated the class label . Their optimization problem for estimating the parameters in f is similar to Equations (2.4) and (2.5), but it involves a more complex truncated-hinge loss function in contrast to the hinge loss used in our methods. This difference results in a computationally expensive nonconvex optimization problem that requires the use of the difference convex algorithm (An and Tao 1997).
2.2 Continuous outcomes
In a scalar-on-function regression with a continuous scalar response, the response y is modeled as
| (2.7) |
where , is a scalar intercept, denotes error and ’s are iid and independent of the X ’s.
If the relationship between the X ’s and the y ’s were known to be linear, then we would consider predicting y by . More generally, we predict y by to allow for a nonlinear relationship and so we must solve an optimization problem
| (2.8) |
for some general loss function . Here, we use the -insensitive loss function which is similar to hinge loss for classification and generally used in support vector regression (SVR):
| (2.9) |
and solve (2.8) by -SVR algorithm (Schölkopf et al. 2000). Equivalently, we could solve the quadratic programming problem
| (2.10) |
subject to
where and are Lagrange multipliers, C is a regularization parameter that controls the complexity of decision function, and is a tuning parameter with that controls the fraction of errors (Schölkopf et al. 2000). The regression estimate then takes the form . We call the resulting method Functional Support Vector Regression (FSVR). We refer to both techniques as instances of Functional Support Vector Machine (FSVM).
As in many classification and regression problems, with FSVM it is necessary to select several tuning parameters. We have two tuning parameters that are required to get the input for SVM: a smoothing parameter that controls the smoothness of the covariance matrix and the number of FPCs K. If a linear kernel is used in SVM, a regularization parameter C is inherent in SVM for binary outcomes while a regularization parameter C and a tuning parameter are inherent in SVM for continuous outcomes. If a Gaussian kernel is used in SVM, then the bandwidth parameter is an additional tuning parameter. We simultaneously select the tuning parameters in the FPCA and SVM steps to control the performance. We select the optimal combinations of tuning parameters involved in the two steps that minimize the misclassification error for binary outcomes and mean-squared error for continuous outcomes. We will discuss the details of choosing tuning parameters in Sections 3 and 4.
The above procedures are summarized into Algorithm 1 for binary outcome and Algorithm 2 for continuous outcome.
Algorithm 1:
Functional support vector classification (FSVC)
Perform FPCA on observed data x to estimate FPC scores A ’s and choose the first K FPC scores .
-
Solve a classification problem using as input features by SVM techniques:
Solve the convex quadratic programming problem (2.5) to obtain .
Given ’s, , where is computed as for any for which . Thus, obtain .
Simultaneously select optimal tuning parameters in steps 1 and 2 by cross-validated misclassification errors : the smoothing parameter that controls the smoothness of covariance matrix, the number of FPCs K, the regularization parameter C that controls the complexity of decision boundary, and the bandwidth parameter if Gaussian kernel is used.
Algorithm 2:
Functional support vector regression (FSVR)
Perform FPCA on observed data x to estimate FPC scores A ’s and choose the first K FPC scores .
-
Solve a regression problem using as input features by SVM techniques:
Solve the convex quadratic programming problem (2.10) to obtain and .
Given , where is computed as for any for which . Thus, obtain .
Simultaneously select optimal tuning parameters in steps 1 and 2 by cross-validated mean squared error : the smoothing parameter that controls the smoothness of covariance matrix, the number of FPCs K, the regularization parameter C that controls the complexity of decision function, the tuning parameter that controls the fraction of errors, and the bandwidth parameter if Gaussian kernel is used.
2.3 Connection with linear scalar-on-function regression
When a linear kernel is chosen, the FSVM method is similar to scalar-on-function regression that is based on a principal component basis (Reiss et al. 2017). Note that FSVM using a linear kernel predicts y by
where . The functional linear model (Ramsay and Silverman 2005) with a principal component basis minimizes
over and , whereas we use the -insensitive loss as in (2.9).
For the functional classification problem, our method directly estimates the classifier , while a functional logistic regression with principal component basis models
where .
3 Simulation Studies
We evaluated our methods through several simulation scenarios for both binary and continuous outcomes with varying sample sizes and numbers of observation time points for the training data set. For each simulated dataset, we compared our methods with the following alternative methods on a validation set of sample size 10,000: (1) scalar-on-function regression (functional logistic regression for binary outcomes and functional linear regression for continuous outcomes); (2) classical SVM using each measurement as an input feature, using the linear kernel; (3) classical SVM using each measurement as an input feature, using the Gaussian kernel; and (4) functional linear discriminant analysis for binary outcomes.
3.1 Simulation design
We have two main situations—binary y and continuous y. For each of them, the following scenarios were considered: (1) Scenario 1 (Settings 1–3), y was generated from a function of FPC scores with error , including both linear and nonlinear cases; (2) Scenario 2 (Setting 4), y was generated from scalar-on-function regression models (ie functional logistic regression for binary y and functional linear regression for continuous y); (3) Scenario 3 (Setting 5), we generated two groups with their mean curve functions and , respectively. When y was binary, for the sample in group 1 and for the sample in group 2. When y was continuous, ; (4) Scenario 4 (Setting 6) we generated two groups with the same mean curve functions but different covariance functions. The generation of y is the same as Scenario 3. We also considered Scenario 5 (Setting 7) in which data were generated from a functional linear discriminant model for a binary outcome.
In Scenario 1 (Settings 1–3), we generated
where were iid N(0, 1), ’s were eigenfunctions generated from Legendre polynomials and then transformed onto [0, 1] and scaled by requiring (Figure S1 of the Supplementary Materials), and . The FPC scores were .
The observed data were , where t ’s were evenly spaced on [0, 1]. We set if if , where was a logit link for binary y , and set for continuous y , was generated according to the specifications in Figures 1 and r3, where only the first two FPC scores are useful for predicting y in the linear case of Setting 1, as well as for the nonlinear cases in Setting 2 (involving interactions of the two FPC scores), and Setting 3 (representing the quadratic case).
Figure 1:
Simulation performance for binary outcomes of Scenarios 1–2. Left column: ; right column: .
In Scenario 2 (Setting 4), we set , where were cubic B-spline basis functions on the interval . The basis coefficients a ’s were generated independently from N(0, 1). The observed data , where t ’s were evenly spaced on [0, 1]. The parameter function was in terms of the same basis functions . We set if if , where , g was logit link for binary y , and set for continuous y , where was the matrix of inner products between the cubic B-splines, and . We set for each corresponding basis function and without loss of generality.
In Scenario 3 (Setting 5), we generated and (Figure S2 of the Supplementary Materials), where . We generated for sample in group 1 and for sample in group 2.
In Scenario 4 (Setting 6), we generated , where . We set for sample in group 1 and for sample in group 2 where were i.i.d. N(0, 1), ’s were eigenfunctions generated from Legendre polynomials and then transformed onto [0, 1] and scaled by requiring , and and . The observed data were .
In Scenario 5 (Setting 7), we generated data from a functional linear discriminant model. We set , where were B-spline basis functions of order 2 on the interval . The basis coefficients a ’s were generated independently from N(0, 1). We set if and otherwise, where for group 1 and for group 2.
In all simulation settings, we generated as iid from N(0, 1) or N(0, 10) to evaluate the performance under different levels of measurement errors in x . For error in y , we generated as being iid from N(0, 1).
For our implementation of FSVM, we first used FACE (Xiao et al. 2016) to estimate FPCs. We fixed the number of knots to be 10 when J = 40 and to be 35 when J = 50 and J = 100 as suggested in Xiao et al. (2016). We searched smoothing parameter in the grid of and the number of FPCs K in the grid of . For the intrinsic tuning parameters in SVM, we searched C in the grid of for both binary and continuous outcomes, and in the grid of for continuous outcomes. The optimal tuning parameters were determined by five-fold cross-validations. We minimized the cross-validated misclassification errors in FSVC and cross-validated mean squared errors in FSVR. When the Gaussian kernel was used, we determined the bandwidth parameter in Gaussian kernel by the median heuristic (ie the median of ) to reduce computational time (Fukumizu et al. 2009; Caputo et al. 2002). To implement classical SVM, we set the searching grids of C and to be the same as for FSVM. To implement linear scalar-on-function regressions, we used penalized scalar-on-function regression with the thin plate regression spline basis as the default setting in R package refund (Goldsmith et al. 2011). For functional linear discriminant analysis, we used FACE to estimate FPCs and then considered the FPC scores as input features to perform standard linear discriminant analysis.
The three situations for the number of observed functions in the training data and number of observations per function were n = 50, J = 40; n = 50, J = 100; and n = 100, J = 50. We repeated the procedures 100 times for each instance.
3.2 Simulation results
3.2.1 Binary outcomes
Figure 1 shows the results of the simulation experiments for binary y. We provide boxplots of the classification accuracy for functional linear discriminant analysis, functional logistic regression, SVC using the linear kernel, SVC using the Gaussian kernel, FSVC using the linear kernel, and FSVC using the Gaussian kernel.
FSVC performed well relative to the other methods in all settings with varying sample size, number of time points, and measurement error levels of . For Setting 1 in which the decision function is a linear function (Fig. 1a), FSVC using the linear kernel performed the best among those considered and showed to be more advantageous when the measurement error in was larger. For Settings 2 and 3 in which l is a nonlinear function (Figures 1b and 1c), FSVC using the Gaussian kernel came out ahead of the others in terms of higher accuracy, while functional linear discriminant analysis performed the worst.
For Scenario 2 (Setting 4) in which y was generated from functional logistic regression models (Fig. 1d), as would be expected, functional logistic regression performed the best among others. Among the rest, functional discriminant analysis and FSVC using the linear kernel outperformed the others. For Scenario 3 (Setting 5) in which different groups had different mean functions (Fig. 2a), FSVC using the linear kernel came ahead of the others. For Scenario 4 (Setting 6) in which groups with the same mean functions but different covariance functions, FSVC using the Gaussian kernel came head of the others especially when noise was large (Fig. 2b). For Scenario 5 (Setting 7) in which data were generated from a functional linear discriminant model (Fig. 2c), as would be expected, functional linear discriminant analysis performed the best among those considered and the performance of FSVC using the linear kernel and functional logistic regression were similar when the measurement error was larger.
Figure 2:
Simulation performance for binary outcomes of Scenarios 3–5. Left column: ; right column: .
3.2.2 Continuous outcomes
Figure 3 shows the results of the simulation experiments of continuous y. We provide boxplots of the root-mean-square error (RMSE) for functional linear regression, SVR using the linear kernel, SVR using the Gaussian kernel, FSVR using the linear kernel, and FSVR using the Gaussian kernel.
Figure 3:
Simulation performance for continuous outcomes of Scenarios 1–4. Left column: ; Right column: . : the RMSEs of SVR linear were large and exceeded the figure when .
For Setting 1 in which was a linear function of (Fig. 3a), FSVR using the linear kernel performed the best among those considered. For Settings 2 and 3 in which was a nonlinear function of (Figures 3b and 3c), the performance of FSVR using the Gaussian kernel and SVR using the Gaussian kernel was similar and outperformed the rest when . When , FSVR using the Gaussian kernel came out ahead of the others. For Scenario 2 (Setting 4) in which y was generated from functional linear regressions (Fig. 3d), the performance of FSVR using the linear kernel was similar to functional linear regression. For Scenario 3 (Setting 5) in which different groups had different mean functions, FSVR using the linear kernel outperformed the others (Fig. 3e). For Scenario 4 (Setting 6) in which groups with the same mean functions but different covariance functions, the performance of FSVR using the Gaussian kernel and SVR using the Gaussian kernel outperformed the rest and FSVR using the Gaussian kernel was better than SVR using the Gaussian kernel when N = 50 and J = 40 (Fig. 3f).
4 Real Data Applications
In this section, we explore the performance of our proposed methods when they are applied to two different data sets, one in which the outcome is binary and one with a continuous outcome.
4.1 Binary outcome: EEG data
EEG is a neuroimaging technique that measures the electrical activity of the brain via electrodes placed on the scalp surface. We apply our classification procedure to a large study (Zhang et al. 1995) that collected EEG data of 77 alcoholics and 45 controls, measuring the amplitude at 64 electrodes each sampled at frequencies 1 to 256 Hz. Each subject completed multiple trials where two picture stimuli appeared in succession. In each trial, the two pictures were either matching or non-matching and the subjects were asked to decide whether the two pictures were the same. Previous studies have found different patterns in the spectra between matching and non-matching trials (Zhang et al. 1995). Thus, our goal is to use the difference of these patterns to classify alcoholics and controls.
In our analysis, we considered only the P1 electrode located in the parietal region and the P5 electrode located in the occipital region using one matching trial and one non-matching trial for each subject. Figures 4a and 4b show the difference between spectra for all subjects at P1 and P5 electrodes. From each group, we randomly selected 80% of subjects to form the training data set leaving the remaining 20% to form the validation data set.
Figure 4:
Waveform, classification accuracy, and AUC of EEG study. a) and b) Amplitude of the difference between matching condition and nonmatching condition of all subjects at P1 and P5 electrodes at 1 to 256 Hz, respectively. Solid lines: alcoholics; Dashed lines: controls. c) and d) Accuracy of classifying alcoholics and controls by P1 and P5 waveforms across 100 bootstrap samples. e) and f) AUC of classifying alcoholics and controls by P1 and P5 waveforms across 100 bootstrap samples.
For both electrodes, we fixed the number of knots to be 15. We searched smoothing parameter in the grid of , the number of FPCs K in the grid of , and C in the grid of . The optimal tuning parameters were determined by five-fold cross-validation which minimized the cross-validated misclassification errors. When the Gaussian kernel was used, the bandwidth parameter was determined by the median heuristic. We compared the FSVC approaches with the same alternative approaches as in the simulation section. The search grids of K and C for SVC approaches were the same as for FSVC approaches. We repeated the analysis 100 times by randomly assigning subjects to the training and validation data sets.
The median number of FPCs selected by FSVC approaches for P1 was eight and that for P5 was seven. FPCA results on the EEG dataset for all subjects are shown in Figure S3 of the Supplementary Materials. For both P1 and P5 electrodes, although the first three FPCs accounted for more than 80% of the total variance, the fourth to eighth FPCs also contributed to classification.
The classification accuracies of each method across the 100 bootstrap samples are shown in Figures 4c and 4d. In terms of the mean and median accuracy estimates, FSVC using the Gaussian kernel outperformed all the other methods for both P1 and P5 waveforms. FSVC using the Gaussian kernel was the only method that had a median value of classification accuracy above 0.7. We also evaluated the AUC by varying the threshold values from 0.1 to 0.9 by 0.2. For both P1 and P5 waveforms, FSVC using the Gaussian kernel outperformed all other methods (Figures 4e and 4f).
4.2 Continuous outcome: near-infrared reflectance spectroscopy data
Glucobrassicin (GBS), a type of glucosinolate in most Brassica vegetables, such as Brussels sprouts and cabbage, produces indole-3-carbinol, a compound that suppresses tumors and increases carcinogen metabolism and excretion (Kassie et al. 2007). It is widely thought that increasing GBS consumption could reduce cancer risk (van Poppel et al. 1999). The standard method to quantify GBS requires high-performance liquid-chromatography, which is expensive and time consuming (Norm et al. 1992). Alternatively, a NIRS technique that utilizes the near-infrared region of the electromagnetic spectrum would be preferred to measure GBS concentrations because it is inexpensive, fast, and nondestructive (Font et al. 2005; Toledo-Martín et al. 2017).
We analyzed the cabbage and Brussels sprout data set that consists of 92 samples (Renner and Fritz 2020). The NIR spectra were between 950 and 1650 nm recorded as the of 1/reflectance, resulting in 141 wavelengths. Our goal is to use the NIR spectra (Fig. 5a) to predict the fresh weight and dry weight GBS concentrations. We randomly selected 50 samples as training data and the remaining 42 samples as validation data. We implemented FSVR using both the linear and Gaussian kernels. We fixed the number of knots to be 35 and searched smoothing parameter in the grid of (0.5, 1, 5, 10), the number of FPCs K in the grid of (1, 2, …, 10), C in the grid of (0.01, 0.2575, 0.5050, 0.7525, 1), and in the grid of . The optimal tuning parameters were determined by five-fold cross-validations. When the Gaussian kernel was used, the bandwidth parameter in the Gaussian kernel was determined by the median heuristic. We repeated the analysis 100 times by randomly assigning samples to the training and validation data sets. We compared FSVR approaches with functional linear regression and SVR using the linear and Gaussian kernels. For SVR, the searching grids of K, C, and were the same as in FSVR.
Figure 5:

NIR spectra and root mean square error (RMSE) of NIR study. a) NIR spectra of all samples. Solid line: NIR spectra for each sample; Dashed line: average NIR spectra over samples. b) and c) RMSE of predicting dry and fresh weight GBS concentrations across 100 bootstrap samples.
The median of the selected number of FPCs was eight for FSVR. We present the FPCA results on the entire data set in Figure S4 of the Supplementary Materials. Although the first FPC accounted for 92.6% of the total variance, the other seven FPCs also contributed to help predict GBS concentrations.
We present the RMSE of each method for predicting dry and fresh weight GBS concentrations across the 100 bootstrap samples in Figures 5b and 5c. FSVR using the Gaussian kernel outperformed all the other methods in terms of the mean, median, and standard deviation of RMSE for predicting both dry weight and fresh weight GBS concentrations.
The average running time per analysis on the EEG dataset was about 8.6 s and on the NIRS dataset was about 6.4 s on an Intel Core i9 3.6 GHz processor.
5 Discussion
In this work, we propose a novel nonparametric approach to use functional data for classification and regression analysis. Our methods exploit the continuous nature of the functional data by smoothing FPCA and using SVM techniques to construct linear or nonlinear hyperplanes. We also discuss the connections between our methods using linear kernel and linear scalar-on-function regression using principal component basis. The superior performance of our methods is demonstrated in the extensive simulation experiments and real data applications. Our methods especially have more advantages when the measurement errors in functional predictors are relatively large because the smoothed FPCA accounts for noise. When the measurement errors in functional predictors are smaller, SVM performed similarly to FSVM in some scenarios, which suggests that there is a tradeoff between smoothness and dimension reduction. In our real data applications, we also see that some FPC scores can be useful in prediction even though they accounted for a relatively small amount of the variance. In the implementations of classical SVM, dimension reduction is not typically used because the kernel trick maps the features into a higher-dimensional space and dimension reduction goes the opposite way. When a linear kernel is used in FSVMs, the coefficients of indicates the importance of the input features. However, FSVMs with Gaussian kernels do not provide explicit feature importance. To identify the relevance of features, one can employ feature selection algorithms such as recursive feature elimination (Guyon et al. 2002).
Several extensions can be considered. We only considered binary outcomes and continuous outcomes in this work, but our method can be easily generalized to multi-class classifications by either one-vs-rest or one-vs-one strategies (Bishop and Nasrabadi 2006). In our model, all the predictors are functional predictors. When additional scalar variables are also helpful in classification and prediction, we can include them as additional input features in the SVM step.
Our technique can also be extended to estimate individualized treatment rules along the lines of outcome-weighted learning (Zhao et al. 2012) which used the SVM technique to solve a weighted classification problem with outcomes as weights. When functional features (e.g. neuroimaging measurements) are available, we can implement FSVM.
6 SOFTWARE
The R code for implementing our method is available on GitHub at https://github.com/shanghongxie/FSVM.
Supplementary Material
Contributor Information
Shanghong Xie, School of Statistics, Southwestern University of Finance and Economics, Chengdu, China; Department of Biostatistics, Columbia University, New York, NY, United States.
R Todd Ogden, Department of Biostatistics, Columbia University, New York, NY, United States.
Supplementary Material
Supplementary material is available at Biostatistics Journal online.
Funding
This work was partially supported by the National Institutes of Health grant 5 R01 MH099003. Xie was also supported by the Center of Statistical Research, and the Joint Lab of Data Science and Business Intelligence at the Southwestern University of Finance and Economics.
Conflict of interest statement
None declared.
References
- Berlinet A, Thomas-Agnan C. Reproducing kernel Hilbert spaces in probability and statistics. New York, NY: Springer Science & Business Media; 2011. [Google Scholar]
- Besse P, Ramsay JO. Principal components analysis of sampled functions. Psychometrika. 1986:51:285–311. [Google Scholar]
- Bishop CM, Nasrabadi NM. Pattern recognition and machine learning. vol. 4. New York, NY: Springer; 2006. [Google Scholar]
- Caputo B, Sim K, Furesjo F, Smola A. Appearance-based object recognition using SVMs: which kernel should I use? In Proceedings of NIPS workshop on Statistical methods for computational experiments in visual processing and computer vision, Whistler. 2002. [Google Scholar]
- Font R, Del Rio-Celestino M, Rosa E, Aires A, De Haro-Bailon A. Glucosinolate assessment in brassica oleracea leaves by near-infrared spectroscopy. J Agric Sci. 2005:143(1):65–73. [Google Scholar]
- Fukumizu K, Gretton A, Lanckriet GR, Schölkopf B, Sriperumbudur BK. Kernel choice and classifiability for RKHS embeddings of probability distributions. Adv Neural Inform Process Syst. 2009:22:1750–1758. [Google Scholar]
- Goldsmith J, Bobb J, Crainiceanu CM, Caffo B, Reich D. Penalized functional regression. J Comput Graph Stat. 2011:20(4):830–851. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Guyon I, Weston J, Barnhill S, Vapnik V. Gene selection for cancer classification using support vector machines. Mach Learn. 2002:46:389–422. [Google Scholar]
- Hastie T, Tibshirani R, Friedman J. The elements of statistical learning: data mining, inference, and prediction. Springer Science & Business Media; 2009. [Google Scholar]
- ISO 9167:2019 Rapeseed and rapeseed meals—Determination of glucosinolates content—Method using high-performance liquid chromatography.
- James GM, Hastie TJ. Functional linear discriminant analysis for irregularly sampled curves. J R Stat Soci: Ser B. 2001:63(3):533–550. [Google Scholar]
- Karhunen K. Über die struktur stationärer zufälliger funktionen. Arkiv för Mat. 1950:1(2):141–160. [Google Scholar]
- Kassie F, Anderson LB, Scherber R, Yu N, Lahti D, Upadhyaya P, Hecht SS. Indole-3-carbinol inhibits 4-(methylnitrosamino)-1-(3-pyridyl)-1-butanone plus benzo(a)pyrene–induced lung tumorigenesis in a/j mice and modulates carcinogen-induced alterations in protein levels. Cancer Res. 2007:67(13):6502–6511. [DOI] [PubMed] [Google Scholar]
- Ramsay J, Dalzell CJ. Some tools for functional data analysis (with discussion). J R Stat Soc Ser B. 1991:53:539–572. [Google Scholar]
- Ramsay JO, Silverman BW. Functional data analysis. 2nd ed. New York, NY: Springer; 2005. [Google Scholar]
- Reiss PT, Goldsmith J, Shang HL, Ogden RT. Methods for scalar-on-function regression. Int Stat Rev. 2017:85(2):228–249. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Renner IE, Fritz VA. Using near-infrared reflectance spectroscopy (NIRS) to predict glucobrassicin concentrations in cabbage and brussels sprout leaf tissue. Plant Methods. 2020:16:136. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Rice JA, Silverman BW. Estimating the mean and covariance structure nonparametrically when the data are curves. J R Stat Soc Ser B. 1991:53(1):233–243. [Google Scholar]
- Schölkopf B, Smola A, Müller K-R. Kernel principal component analysis. In: Gerstner W, Germond A, Hasler M, Nicoud J-D, editors. International Conference on Artificial Neural Networks; Springer; Berlin Heidelberg; 1997. p. 583–588. [Google Scholar]
- Schölkopf B, Smola AJ, Williamson RC, Bartlett PL. New support vector algorithms. Neural Comput. 2000:12(5):1207–1245. [DOI] [PubMed] [Google Scholar]
- Thi Hoai An L, Dinh Tao P. Solving a class of linearly constrained indefinite quadratic problems by DC algorithms. J Global Optim. 1997:11:253–285. [Google Scholar]
- Toledo-Martín EM, Font R, Obregón-Cano S, De Haro-Bailón A, Villatoro-Pulido M, Del Río-Celestino M. Rapid and cost-effective quantification of glucosinolates and total phenolic content in rocket leaves by visible/near-infrared spectroscopy. Molecules 2017:22(5):851. [DOI] [PMC free article] [PubMed] [Google Scholar]
- van Poppel G, Verhoeven DTH, Goldbohm RA. Brassica vegetables and cancer prevention. Epidemiology and mechanisms. Adv Exp Med Biol. 1999:472:159–168. [DOI] [PubMed] [Google Scholar]
- Wu Y, Liu Y. Functional robust support vector machines for sparse and irregular longitudinal data. J Comput Graph Stat. 2013:22(2):379–395. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Xiao L, Zipunnikov V, Ruppert D, Crainiceanu C. Fast covariance estimation for high-dimensional functional data. Stat Comput. 2016:26(1/2):409–421. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Yao F, Müller H-G, Wang JL. Functional data analysis for sparse longitudinal data. J Am Stat Assoc. 2005:100(470):577–590. [Google Scholar]
- Zhang XL, Begleiter H, Porjesz B, Wang W, Litke A. Event related potentials during object recognition tasks. Brain Res Bull. 1995:38(6):531–538. [DOI] [PubMed] [Google Scholar]
- Zhao Y, Zeng D, Rush AJ, Kosorok MR. Estimating individualized treatment rules using outcome weighted learning. J Am Stat Assoc. 2012:107(499):1106–1118. [DOI] [PMC free article] [PubMed] [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.




