This is an example showing how to use COMPARE programs to analyze BBL female schizophrenia data. The female data consist of 61 subjects. Thirty eight subjects are normal controls and twenty three subjects are schizophrenia patients. The scans of these subjects were spatially normalized into a template space and RAVENS maps were computed for classification. The RAVENS maps were spatially smoothed to improve SNR. Corresponding subject list files have been created for training and testing.

There are three subfolders:
Data		all the feature images 
List		all the subject list files
Comp		for running the analysis 
test1           testing results for a simple test 
test2           testing results for a comprehensive test 

There are three ways to run the classification analysis:

1. training
   Given training data, a classifier can be constructed by 

   Compare training_data_list result_file -m model.mdl

2. training and testing together
   Given training data and testing data, a classifier can be constructed and can also be used to classify testing data.

   Compare training_data_list result_file -t testing_data_list 


3. testing 
   Give a classifer contructed by "Compare", testing data can be classified by 

   Compare_test model.mdl testing_data_list result_file


***build classifier***
Compare

  This program trains a classifier via leave-one-out cross-validation and outputs the classification rates

  Usage: Compare (data.lst) (result_file) [options]

  Required parameters:
    data.lst      : the input file containing the location of the data
    result_file   : text file for the output

  Optional parameters:
    [-k    <int>      ]  std value for Gaussian kernel in SVM (range:1~10000. This value is multiplied by 100! default:1)
    [-j    <int>      ]  searching range for std value (should be greater than above value, optional)
    [-c    <int>      ]  trade-off value in SVM (range:1~10000, default: 10)
    [-t    file_name  ]  subject list to be classified by the classifier trained (default: no testing)
    [-T    <float>    ]  randomly leave this % out from data.lst for testing (overrides -t, default: no testing)
    [-s    <float>    ]  Gaussian kernel size for smoothing score map (default: 3.0, range:1~10)
    [-n    <int>      ]  searching space of feature number (range:1~1500, default: 150)
    [-m    model_name ]  name of a file to store the trained classifier (default: no output)
    [-M    <int>      ]  starting point of a range of features for final classification (default: 1)
    [-N    <int>      ]  ending point of a range of features for final classification (default: 150)
    [-S    spatial_map]  prefix of name of group difference spatial maps (in float format, one for each feature) (defalut: no output)

    [-v]   version information
    [-h]   this message
    [-u]   this message

  More information:
    https://www.rad.upenn.edu/sbia/software/
    sbia-software@uphs.upenn.edu

  Suggested use: Compare data.lst data.out -j2 -T20 -mdata.mdl -Sdata_map
    where "data" is the name of your dataset

***test classifier***
 Compare_test

  This program classifies the samples in data_list_file using model_file, and outputs SVM scores to result_file

  Usage: Compare_test (model_file) (data_list_file) (result_file)
  Usage: Compare_test [-v/h/u]

  Required parameters:
    model_file       : the input file containing the location of the data
    data_list_file   : the input file containing the location of the data
    result_file      : text file for the output

  Optional parameters:
    [-v]   version information
    [-h]   this message
    [-u]   this message

  More information:
    https://www.rad.upenn.edu/sbia/software/
    sbia-software@uphs.upenn.edu


test 1: (around 15 mins)
in /comp folder type:

***training:
Compare ../list/test_sub.lst bbl_test_rate.txt -m bbl_test.mdl 

***testing:
Compare_test bbl_test.mdl ../list/test_sub.lst test_result.txt


test 2: (around 8 hours)
in /comp folder type:

***training:
Compare ../list/bbl_female.lst bbl_female_rate.txt -k 3 -j 7 -c 10 -n 100 -s 3.5 -m bbl_female.mdl -S bbl_female_map -t ../list/test_sub.lst

***testing:
Compare_test bbl_female.mdl ../list/test_sub.lst test_result.txt
