This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
assignments:assignment5 [2015/10/31 08:30] asa |
assignments:assignment5 [2015/10/31 09:24] asa |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ========= Assignment 5: Feature selection ============ | + | ======== Assignment 5: Feature selection =========== |
Due: November 15th at 11pm | Due: November 15th at 11pm | ||
+ | |||
+ | |||
+ | ==== Data ==== | ||
In this assignment you will compare several feature selection methods on several datasets. | In this assignment you will compare several feature selection methods on several datasets. | ||
- | The first dataset is the [[https://archive.ics.uci.edu/ml/datasets/Arcene| Arcene]] dataset which was used in a feature selection competition | + | The first dataset is the [[https://archive.ics.uci.edu/ml/datasets/Arcene| Arcene]] dataset which was used in the 2003 NIPS feature selection competition. The dataset is produced by mass spectrometry of biological samples that comes from different types of cancer. |
- | The datasets we will use are the yeast gene expression dataset | + | |
+ | The second dataset describes the expression of human genes in two types of leukemia The original publication that describes the data: | ||
+ | |||
+ | T. R. Golub, D. K. Slonim, P. Tamayo, C. Huard, M. Gaasenbeek, J. P. Mesirov, H. Coller, M. L. Loh, J. R. Downing, M. A. Caligiuri, C. D. Bloomfield, and E. S. Lander. | ||
+ | [[https://www.broadinstitute.org/mpr/publications/projects/Leukemia/Golub_et_al_1999.pdf | Molecular classification of cancer: class discovery and class prediction by gene expression monitoring]]. | ||
+ | Science, 286(5439):531, 1999. | ||
+ | |||
+ | Download a processed version of the dataset in libsvm format from the [[https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary.html | libsvm data repository]]. Look for the dataset named "leukemia". There are two files, one a training set and another which contains a test set. Merge the two files into a single file for your experiments. | ||
===== Part 1: Filter methods ===== | ===== Part 1: Filter methods ===== | ||
Line 31: | Line 41: | ||
Compare the accuracy of an L1 SVM to an SVM that uses RFE to select relevant features. | Compare the accuracy of an L1 SVM to an SVM that uses RFE to select relevant features. | ||
- | Compare the accuracy of a regular L2 SVM trained on those features with an L2 SVM trained on all the features computed using 5-fold cross-validation. | + | Compare the accuracy of a regular L2 SVM trained on the features selected by the L1 SVM with the accuracy of an L2 SVM trained on all the features (compute accuracy using 5-fold cross-validation). |
It has been argued in the literature that L1-SVMs often leads to solutions that are too sparse. As a workaround, implement the following strategy: | It has been argued in the literature that L1-SVMs often leads to solutions that are too sparse. As a workaround, implement the following strategy: | ||
Line 37: | Line 47: | ||
* Create $k$ sub-samples of the data in which you randomly choose 80% of the examples. | * Create $k$ sub-samples of the data in which you randomly choose 80% of the examples. | ||
* For each sub-sample train an L1-SVM. | * For each sub-sample train an L1-SVM. | ||
- | * For each feature compute a score that is the average weight vector | + | * For each feature compute a score that is the number of sub-samples for which that feature yielded a non-zero score. |
+ | |||
+ | |||
+ | ===== Part 3: Method comparison ===== | ||
+ | |||
+ | Compute the accuracy of a Linear L2 SVM as a function of the number of selected features on the leukemia and Arcene datasets for the following feature selection methods: | ||
+ | |||
+ | * The Golub score | ||
+ | * L1-SVM feature selection using subsamples | ||
+ | * RFE-SVM | ||
+ | |||
+ | Make sure that your evaluation provides an un-biased estimate of classifier performance. | ||
+ | Comment on the results. | ||
+ | For the above experiment you do not need to select the optimal value for the SVM soft-margin constant. | ||
+ | Compare these results to results obtained using internal cross-validation for selecting | ||
+ | the soft margin constant $C$ over a grid of values. | ||
+ | In writing your code, use scikit-learn's ability to combine analysis steps using the [[http://scikit-learn.org/stable/modules/pipeline.html |Pipeline class]]. This will be particularly useful for performing model selection. | ||
- | Do your results change if you do model selection for the resulting classifier over a grid of values for the soft margin constant $C$? | ||