Repository navigation
RVR manual
Relevance vector regression (RVR) is a Bayesian extension of support vector regression (SVR). The function here is RVR with linear kernel implemented by functions of PRoNTo (http://www.mlnl.cs.ucl.ac.uk/pronto/). The results of linear RVR are generally similar to linear SVR, and RVR has no free parameter and is much more faster than SVR (Cui and Gong, 2018, NeuroImage).
Here we provide functions RVR_NFolds_Sort.m, RVR_NFolds_RandomCV.m, RVR_LOOCV.m, RVR_APredictB.m, and CorrFilter_RVR_LOOCV.m.
If you want to specify training and testing groups, then using RVR_APredictB.m function. Or you may need to use cross validation method to evaluate your model. Generally, repeated N-folds cross validation is recommended, implemented by function RVR_NFolds_RandomCV.m. But it generate too many results and making figures for that is complex. I personally like using RVR_NFolds_Sort.m as main results, which split subjects into N subsets according to the rank of scores, but also report results of RVR_NFolds_RandomCV.m in the text of supplementary material. If your sample size is pretty small, then try leave-one-out cross validation RVR_LOOCV.m. For all the three cross-validation methods, I will generate the contribution map for visualization using all subjects (Cui and Gong, 2018, NeuroImage; Cui et al., 2018, Cerebral Cortex).
If you want to use feature selection method, we provide CorrFilter_RVR_LOOCV.m, which uses Pearson correlation between feature and scores for feature selection (Dosenbach et al., 2010, Science). Features with absolute correlation coefficient smaller than a threshold are removed. It is important to note that the feature selection step was applied on training subjects, and the acquired feature selection mask is directly applied on testing subjects. We did not include feature selection methods for other cross-validation methods, users can make changes accordingly easily.
About usage for the function, see the help within the function for the introduction of each variable.
Codes for N-fold cross validation. We sorted all subjects according to the scores and then split all subjects into N subsets according to the rank (Cui and Gong, 2018, NeuroImage; Cui et al., 2018, Cerebral Cortex). The prediction accuracy is calculated (i.e., Pearson correlation and mean absolute error).
If Weight_Flag was set to 1, the function also generates the contribution weight of each feature. All subjects are used to construct a new model, and the absolute values of coefficients of the model are used to quantify the contribution of the features.
Then, run function RVR_NFolds_Sort_Permutation.m to generate the random distribution of prediction accuracy to determine whether the acquired accuracies above are significantly higher than by chance.
Codes for the repeated random N-fold cross validation. Each time, all subjects are randomly divided into N subsets. CVRepeatTimes variable defines the repetition time for the N-fold cross validation. I generally use this as a validation of the results of RVR_NFolds_Sort.
Codes for leave-one-out cross validation. Unless the sample size is pretty small, I will not use LOOCV, as it may lead to biased and unstable results (Varoquaux, et al., 2017, NeuroImage). The function reported the prediction accuracy (i.e., correlation and mean absolute error) and features contribution.
Users need to write functions to do permutation test to determine if the acquired accuracy is significantly higher than by chance. Just run RVR_LOOCV 1000 times, each time with input variable Permutation_Flag = 1.
Codes for one group predict another group. The function reported the prediction accuracy (i.e., correlation and mean absolute error).
Users need to write functions to do permutation test to determine if the acquired accuracy is significantly higher than by chance. Just run RVR_APredictB 1000 times, each time with input variable Permutation_Flag = 1.
Codes for LOOCV with feature selection based on Pearson correlation between features and scores. variable CoefThreshold is the threshold and the features with absolute value of correlation smaller than this value are removed.
Codes for generating the contribution of features to the prediction. For example, function RVR_NFolds_Sort.m and RVR_LOOCV.m have called this function to produce the contribution weight. Users can use this function if needed.