分類預測方法在小樣本之比較
Comparisons of Classification Methods with Small Data
摘要
研究動機與目的:
在臨床醫學研究中,經常會希望從眾多的變項中篩選重要的變項進一步預測疾病發生或分類症狀,近年常使用的預測工具有針對二元結果變項的統計模式如邏輯斯迴歸(Logistic regression),以及資料驅動(Data-driven)的機器學習方法,例如:支持向量機(Support vector machines; SVM)等。邏輯斯迴歸除了可作為分類的工具,還可量化特定預測變項與疾病發生之關係強度,若是前瞻性的取樣設計,更能直接估算疾病發生的機率,仍為臨床研究上最常用的統計工具之一,和SVM各有其優缺點,兩類方法並不會相互取代,因此實務上多根據研究者需求來選擇使用的分類預測方法。在邏輯斯迴歸模式中,過去研究已發現若結果事件數(Number of events)太少,模式的係數估計會產生問題然而事件數比例對於分類預測結果影響的研究很少,事件數對SVM分類預測結果的影響亦闕如。
本研究將針對資料含有大量的自變項數的情況下,以統計模擬的方式探討不同事件數比例分別對於邏輯斯迴歸和SVM在分類預測上的影響。
研究方法:
本研究將分為兩部份,第一部分探討在不同情境下邏輯斯迴歸模式在分類預測的表現,第二部分則探討在不同情境下SVM在分類預測的表現。由於本研究設定的情境包括預設的勝算比情境,資料生成以羅輯斯迴歸模式為基礎,因此不比較羅輯斯迴歸模式與SVM的表現。邏輯斯迴歸模式將使用以AIC、BIC逐步法和LASSO三種變項選擇方法,SVM則考慮linear, radial basis function, polynomial三種kernel functions。模擬情境各搭配不同訓練集(training sets)樣本數(n=100, 200, 500)和測試集(testing sets)樣本數(n=50, 100)組合,以及不同參數設定(依變項經過邏輯轉換和自變項線性和非線性)和不同事件數比例(baseline 20%, 50%, 80%)。研究結果的評估指標為Area Under ROC(AUC)以及模型估計的總運算時間。
研究結果與結論:
邏輯斯迴歸分類的部分,設定依變項邏輯轉換和自變項關係為線性時,無論訓練集樣本數大小,LASSO的AUC表現明顯較佳且運算時間也最少。當訓練集樣本數較大時(n=200,500),BIC逐步法的AUC表現與LASSO相似,而AIC逐步法與兩者有明顯的落差。當事件數和非事件數比例為平均的情況下(baseline 50%),各變項選擇方法的AUC表現較佳。訓練集樣本數愈大AUC表現較好,測試集總樣本數愈大AUC變異則比較小。設定依變項邏輯轉換和自變項關係為非線性時,LASSO其AUC表現仍然比其他選擇方法好,但與關係為線性時相比來得差。
SVM進行分類的部分,設定依變項邏輯轉換和自變項關係為線性時,在AUC表現方面,當事件數和非事件數比例為平均(baseline 50%)時,三種kernel functions表現並無明顯差異,當比例為不平均(baseline 20%, 80%)時,Linear kernel表現和Polynomial kernel相似,比RBF kernel表現好。在估算模型的總運算時間方面,Linear kernel時間花費為最少,Polynomial kernel最多。在事件數和非事件數比例上,只有RBF kernel影響較大,其AUC表現在比例為平均時明顯較佳。訓練集樣本數愈大時,SVM的AUC表現較好。設定依變項邏輯轉換和自變項關係為非線性時,RBF和Polynomial kernel其AUC表現較線性時差。
總整來說,當變項數量很多且主要的目的在篩選重要變項做分類預測時,若使用邏輯斯迴歸模式,LASSO方法AUC表現通常較佳,尤其在事件數和非事件數的比例越接近時。若使用SVM,樣本數較大時,無論使用哪一個kernel functions結果差異不大,但linear kernel的運算時間明顯較少。在事件數和非事件數的比例越接近時,AUC表現通常也較好。
在臨床醫學研究中,經常會希望從眾多的變項中篩選重要的變項進一步預測疾病發生或分類症狀,近年常使用的預測工具有針對二元結果變項的統計模式如邏輯斯迴歸(Logistic regression),以及資料驅動(Data-driven)的機器學習方法,例如:支持向量機(Support vector machines; SVM)等。邏輯斯迴歸除了可作為分類的工具,還可量化特定預測變項與疾病發生之關係強度,若是前瞻性的取樣設計,更能直接估算疾病發生的機率,仍為臨床研究上最常用的統計工具之一,和SVM各有其優缺點,兩類方法並不會相互取代,因此實務上多根據研究者需求來選擇使用的分類預測方法。在邏輯斯迴歸模式中,過去研究已發現若結果事件數(Number of events)太少,模式的係數估計會產生問題然而事件數比例對於分類預測結果影響的研究很少,事件數對SVM分類預測結果的影響亦闕如。
本研究將針對資料含有大量的自變項數的情況下,以統計模擬的方式探討不同事件數比例分別對於邏輯斯迴歸和SVM在分類預測上的影響。
研究方法:
本研究將分為兩部份,第一部分探討在不同情境下邏輯斯迴歸模式在分類預測的表現,第二部分則探討在不同情境下SVM在分類預測的表現。由於本研究設定的情境包括預設的勝算比情境,資料生成以羅輯斯迴歸模式為基礎,因此不比較羅輯斯迴歸模式與SVM的表現。邏輯斯迴歸模式將使用以AIC、BIC逐步法和LASSO三種變項選擇方法,SVM則考慮linear, radial basis function, polynomial三種kernel functions。模擬情境各搭配不同訓練集(training sets)樣本數(n=100, 200, 500)和測試集(testing sets)樣本數(n=50, 100)組合,以及不同參數設定(依變項經過邏輯轉換和自變項線性和非線性)和不同事件數比例(baseline 20%, 50%, 80%)。研究結果的評估指標為Area Under ROC(AUC)以及模型估計的總運算時間。
研究結果與結論:
邏輯斯迴歸分類的部分,設定依變項邏輯轉換和自變項關係為線性時,無論訓練集樣本數大小,LASSO的AUC表現明顯較佳且運算時間也最少。當訓練集樣本數較大時(n=200,500),BIC逐步法的AUC表現與LASSO相似,而AIC逐步法與兩者有明顯的落差。當事件數和非事件數比例為平均的情況下(baseline 50%),各變項選擇方法的AUC表現較佳。訓練集樣本數愈大AUC表現較好,測試集總樣本數愈大AUC變異則比較小。設定依變項邏輯轉換和自變項關係為非線性時,LASSO其AUC表現仍然比其他選擇方法好,但與關係為線性時相比來得差。
SVM進行分類的部分,設定依變項邏輯轉換和自變項關係為線性時,在AUC表現方面,當事件數和非事件數比例為平均(baseline 50%)時,三種kernel functions表現並無明顯差異,當比例為不平均(baseline 20%, 80%)時,Linear kernel表現和Polynomial kernel相似,比RBF kernel表現好。在估算模型的總運算時間方面,Linear kernel時間花費為最少,Polynomial kernel最多。在事件數和非事件數比例上,只有RBF kernel影響較大,其AUC表現在比例為平均時明顯較佳。訓練集樣本數愈大時,SVM的AUC表現較好。設定依變項邏輯轉換和自變項關係為非線性時,RBF和Polynomial kernel其AUC表現較線性時差。
總整來說,當變項數量很多且主要的目的在篩選重要變項做分類預測時,若使用邏輯斯迴歸模式,LASSO方法AUC表現通常較佳,尤其在事件數和非事件數的比例越接近時。若使用SVM,樣本數較大時,無論使用哪一個kernel functions結果差異不大,但linear kernel的運算時間明顯較少。在事件數和非事件數的比例越接近時,AUC表現通常也較好。
Background:
To predict the occurrence of disease and classify it into different types of symptoms amongst a large number of variables, researchers often use statistical modeling or machine learning methods in the recent year for the binary outcome such as logistic regression and support vector machines (SVM). Logistic regression could quantify the associations between the predictors and outcomes and estimate the probability of the outcome event if the sampling is prospective, and this model is widely used in medical studies. Previous studies have shown that small numbers of events may cause problematic estimates of the parameter in regression models. However, there are few studies for the effect of event numbers on the outcome classification. The impact of event numbers on the performance of SVM has little been discussed.
Objectives:
The aim of this study was to investigate the effect of proportion of events on the performance of classifications by using logistic regression and by SVM, respectively, when data contained a large numbers of predictors.
Methods:
In logistic regression, we compared different variable selection methods such as stepwise selection based on Akaike information criterion (stepwise AIC), stepwise selection based on Bayesian information criterion (stepwise BIC), Least Absolute Shrinkage and Selection Operator for variable selection (LASSO). In SVM, we compared different kinds of kernel function such as linear,radial basis function (RBF), polynomial. Since the data generated for simulation studies were based on logistic model with pre-specified odds ratios, the present study did not compare the performance logistic regression and SVM.
The scenarios of the simulation studies included different training and test sizes, different parameter settings in logistic regression, and different proportion of events at baseline. Training and test sizes were considered as 100,200,500 and 50, 100.Parameter setting were considered that the relationship between the dependent variable after logic transformation and independent variables (x) were linear (setting I) and non-linear (setting II). The proportions of events at baseline were considered as (20%, 50%, and 80%). We used Area Under ROC (AUC) to evaluate the performance of classification methods and calculated the total time of model estimation.
Results and Conclusions:
For the AUC performance, LASSO performs better if uses logistic regression for classification, and three kinds of kernel function is not much different if use SVM for classification. For computing time, LASSO is significantly faster than stepwise selection, and linear kernel SVM has less time-consuming. When the proportion of events at baseline is average, the AUC of logistic regression and SVM usually perform better. In comparisons, the performance for classification in setting I (linear) is better than in setting II (non-linear).
To predict the occurrence of disease and classify it into different types of symptoms amongst a large number of variables, researchers often use statistical modeling or machine learning methods in the recent year for the binary outcome such as logistic regression and support vector machines (SVM). Logistic regression could quantify the associations between the predictors and outcomes and estimate the probability of the outcome event if the sampling is prospective, and this model is widely used in medical studies. Previous studies have shown that small numbers of events may cause problematic estimates of the parameter in regression models. However, there are few studies for the effect of event numbers on the outcome classification. The impact of event numbers on the performance of SVM has little been discussed.
Objectives:
The aim of this study was to investigate the effect of proportion of events on the performance of classifications by using logistic regression and by SVM, respectively, when data contained a large numbers of predictors.
Methods:
In logistic regression, we compared different variable selection methods such as stepwise selection based on Akaike information criterion (stepwise AIC), stepwise selection based on Bayesian information criterion (stepwise BIC), Least Absolute Shrinkage and Selection Operator for variable selection (LASSO). In SVM, we compared different kinds of kernel function such as linear,radial basis function (RBF), polynomial. Since the data generated for simulation studies were based on logistic model with pre-specified odds ratios, the present study did not compare the performance logistic regression and SVM.
The scenarios of the simulation studies included different training and test sizes, different parameter settings in logistic regression, and different proportion of events at baseline. Training and test sizes were considered as 100,200,500 and 50, 100.Parameter setting were considered that the relationship between the dependent variable after logic transformation and independent variables (x) were linear (setting I) and non-linear (setting II). The proportions of events at baseline were considered as (20%, 50%, and 80%). We used Area Under ROC (AUC) to evaluate the performance of classification methods and calculated the total time of model estimation.
Results and Conclusions:
For the AUC performance, LASSO performs better if uses logistic regression for classification, and three kinds of kernel function is not much different if use SVM for classification. For computing time, LASSO is significantly faster than stepwise selection, and linear kernel SVM has less time-consuming. When the proportion of events at baseline is average, the AUC of logistic regression and SVM usually perform better. In comparisons, the performance for classification in setting I (linear) is better than in setting II (non-linear).