TITLE: Effective early disease risk assessment with matrix factorization on a large-scale medical database
AUTHORS: Chu-Yu Chin, Sun-Yuan Hsieh, Vincent S. Tseng

[DESCRIPTION]
<p>The early assessment of disease risk is an emerging topic in medical informatics. If diseases are detected at an early stage, prognosis can be improved and medical resources can be used more efficiently. A number of recent studies have considered risk factor analysis approaches, such as association rule mining, sequential rule mining, regression, and medical expert advice. </p>
<p>In this study, for improving disease risk assessment, non-negative matrix factorization and support vector machine (SVM) were integrated to discover important and implicit risk factors.</p>
<p>To make the method easy to follow, here we provide an experimental protocal. This experimental protocal comprises three main stages: data preprocessing, risk factor optimization, and early disease risk assessment. To discover the optimized risk factors, the NMF algorithm with parameter optimization was used for constructing the NMF-based matrix. In the assessment model learning and early disease risk assessment stages, the machine learning classifier SVM was used for disease modeling with the NMF-based matrix, yielding the final disease risk assessment, which serves as an excellent reference for physicians and patients.</p>

[STEPS]
?. [Install Prerequisite software and libraries]
This protocol requires:Matlab 2016aLibSVM version 3.22Each instruction can be verified on property websites.The following steps include: dataset preparation, executing NMF multiplicative update algorithm, paremeter settings for SVM and effectiveness evaluation on the SVM-based disease risk assessment.
?. [Prepare and load a Patient-Diagnosis Disease Matrix by the LibSVM format with label]
The medical diagnostic record data to be analyzed is converted into a patient-diagnosis disease matrix in advance.Running the command below in the Matlab to load patient-diagnosis disease matrix by the libSVM Format.>> [label, inst] = libsvmread('C:\SVM_data\200.libsvm.txt'); An example of patient-diagnosis disease matrix with the LibSVM format.
The instance data matrix and label will be show in the Matlab workspace.
?. [Executing the NMF multiplicative update algorithm]
The step comprises three phases. First, a number of dimension should be set. The appropriate values can be selected based on the training data by performing step 3-5. Second, to generate the NMF-Based matrix, the NMF multiplicative update algorithm is performed. Third, the NMF-Based matrix is stored in the LibSVM file format.>> numOfR=200
>> rng(1)
>> [nmfbasedmatrix,H] = nnmf(inst, numOfR, 'algorithm','mult');

>> %Create sparse matrix
>> nmfbasedmatrixS = sparse(nmfbasedmatrix)  

>> %write the matrix to the file by the libSVM format.
>> libsvmwrite('C:\NMF_Based_matrix\200.libsvm',label, nmfbasedmatrixS);
A new matrix called the NMF-based matrix has been generated and displayed in the matlab workspace.
 

 
 
The NMF-based matrix is stored in the SVM file format.
 

An example of the NMF-based matrix with the LibSVM format.
?. [Obtaining the SVM parameters by using the grid search method with stratified ten-fold cross-validation.]
In order to obtain more suitable SVM parameters, based on stratified ten-fold cross-validation, the grid search method that derived by the LibSVM is utilized.c:\>python C:\libsvm-3.22\tools\grid.py C:\NMF_Based_matrix\200.libsvm -v 10
In this example, the suitable parameters values of C and g are 2 and 0.03125, respectively.
 
 

 
[local] 5 -7 74.2 (best c=32.0, g=0.0078125, rate=74.2)[local] -1 -7 71.9 (best c=32.0, g=0.0078125, rate=74.2)[local] 5 -1 62.9 (best c=32.0, g=0.0078125, rate=74.2)[local] -1 -1 57.5 (best c=32.0, g=0.0078125, rate=74.2)[local] 11 -7 69.2 (best c=32.0, g=0.0078125, rate=74.2)[local] 11 -1 61.0 (best c=32.0, g=0.0078125, rate=74.2)[local] 5 -13 72.4 (best c=32.0, g=0.0078125, rate=74.2)[local] -1 -13 46.4 (best c=32.0, g=0.0078125, rate=74.2)[local] 11 -13 72.7 (best c=32.0, g=0.0078125, rate=74.2)[local] -3 -7 57.2 (best c=32.0, g=0.0078125, rate=74.2)[local] -3 -1 54.9 (best c=32.0, g=0.0078125, rate=74.2)[local] -3 -13 46.4 (best c=32.0, g=0.0078125, rate=74.2)[local] 5 1 54.3 (best c=32.0, g=0.0078125, rate=74.2)[local] -1 1 50.3 (best c=32.0, g=0.0078125, rate=74.2)[local] 11 1 51.9 (best c=32.0, g=0.0078125, rate=74.2)[local] -3 1 46.9 (best c=32.0, g=0.0078125, rate=74.2)[local] 9 -7 71.6 (best c=32.0, g=0.0078125, rate=74.2)[local] 9 -1 60.9 (best c=32.0, g=0.0078125, rate=74.2)[local] 9 -13 75.7 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 9 1 51.9 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 5 -11 75.3 (best c=512.0, g=0.0001220703125, rate=75.7)[local] -1 -11 46.4 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 11 -11 73.9 (best c=512.0, g=0.0001220703125, rate=75.7)[local] -3 -11 46.4 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 9 -11 73.3 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 3 -7 75.1 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 3 -1 63.7 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 3 -13 60.0 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 3 1 55.2 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 3 -11 72.7 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 5 -5 72.9 (best c=512.0, g=0.0001220703125, rate=75.7)[local] -1 -5 75.2 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 11 -5 68.2 (best c=512.0, g=0.0001220703125, rate=75.7)[local] -3 -5 70.8 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 9 -5 68.7 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 3 -5 74.2 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 15 -7 66.1 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 15 -1 61.0 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 15 -13 72.9 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 15 1 51.9 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 15 -11 72.2 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 15 -5 64.1 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 5 -15 60.0 (best c=512.0, g=0.0001220703125, rate=75.7)[local] -1 -15 46.4 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 11 -15 75.6 (best c=512.0, g=0.0001220703125, rate=75.7)[local] -3 -15 46.4 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 9 -15 75.3 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 3 -15 46.4 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 15 -15 73.7 (best c=512.0, g=0.0001220703125, rate=75.7)[local] -5 -7 46.4 (best c=512.0, g=0.0001220703125, rate=75.7)[local] -5 -1 46.4 (best c=512.0, g=0.0001220703125, rate=75.7)[local] -5 -13 46.4 (best c=512.0, g=0.0001220703125, rate=75.7)[local] -5 1 46.4 (best c=512.0, g=0.0001220703125, rate=75.7)[local] -5 -11 46.4 (best c=512.0, g=0.0001220703125, rate=75.7)[local] -5 -5 47.9 (best c=512.0, g=0.0001220703125, rate=75.7)[local] -5 -15 46.4 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 5 3 49.6 (best c=512.0, g=0.0001220703125, rate=75.7)[local] -1 3 48.0 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 11 3 49.8 (best c=512.0, g=0.0001220703125, rate=75.7)[local] -3 3 46.4 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 9 3 49.8 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 3 3 49.4 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 15 3 49.8 (best c=512.0, g=0.0001220703125, rate=75.7)[local] -5 3 46.4 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 7 -7 73.5 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 7 -1 61.4 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 7 -13 75.2 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 7 1 52.1 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 7 -11 75.7 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 7 -5 71.4 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 7 -15 72.3 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 7 3 49.8 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 5 -9 75.7 (best c=512.0, g=0.0001220703125, rate=75.7)[local] -1 -9 59.5 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 11 -9 73.0 (best c=512.0, g=0.0001220703125, rate=75.7)[local] -3 -9 46.4 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 9 -9 73.6 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 3 -9 75.3 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 15 -9 68.6 (best c=512.0, g=0.0001220703125, rate=75.7)[local] -5 -9 46.4 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 7 -9 73.7 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 1 -7 75.3 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 1 -1 63.8 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 1 -13 46.4 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 1 1 55.2 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 1 -11 60.0 (best c=512.0, g=0.0001220703125, rate=75.7)[local] 1 -5 76.5 (best c=2.0, g=0.03125, rate=76.5)[local] 1 -15 46.4 (best c=2.0, g=0.03125, rate=76.5)[local] 1 3 49.4 (best c=2.0, g=0.03125, rate=76.5)[local] 1 -9 72.5 (best c=2.0, g=0.03125, rate=76.5)[local] 5 -3 71.3 (best c=2.0, g=0.03125, rate=76.5)[local] -1 -3 73.4 (best c=2.0, g=0.03125, rate=76.5)[local] 11 -3 66.0 (best c=2.0, g=0.03125, rate=76.5)[local] -3 -3 66.0 (best c=2.0, g=0.03125, rate=76.5)[local] 9 -3 66.8 (best c=2.0, g=0.03125, rate=76.5)[local] 3 -3 72.1 (best c=2.0, g=0.03125, rate=76.5)[local] 15 -3 63.5 (best c=2.0, g=0.03125, rate=76.5)[local] -5 -3 60.0 (best c=2.0, g=0.03125, rate=76.5)[local] 7 -3 70.0 (best c=2.0, g=0.03125, rate=76.5)[local] 1 -3 73.9 (best c=2.0, g=0.03125, rate=76.5)[local] 13 -7 67.6 (best c=2.0, g=0.03125, rate=76.5)[local] 13 -1 61.0 (best c=2.0, g=0.03125, rate=76.5)[local] 13 -13 73.7 (best c=2.0, g=0.03125, rate=76.5)[local] 13 1 51.9 (best c=2.0, g=0.03125, rate=76.5)[local] 13 -11 73.6 (best c=2.0, g=0.03125, rate=76.5)[local] 13 -5 65.7 (best c=2.0, g=0.03125, rate=76.5)[local] 13 -15 72.5 (best c=2.0, g=0.03125, rate=76.5)[local] 13 3 49.8 (best c=2.0, g=0.03125, rate=76.5)[local] 13 -9 71.2 (best c=2.0, g=0.03125, rate=76.5)[local] 13 -3 63.5 (best c=2.0, g=0.03125, rate=76.5)2.0 0.03125 76.5
?. [Effectiveness Evaluation on the SVM-based disease risk assessment model]
For Effectiveness Evaluation on the SVM-based disease risk assessment model, the stratified ten-fold cross-validation is conducted by the LibSVM.C:\NMF_Based_matrix>c:\libsvm-3.22\windows\svm-train.exe -v 10 -c 2 -g 0.03125 testing-1.libsvm
The execution result will be shown finally.