Warning: Declaration of action_plugin_tablewidth::register(&$controller) should be compatible with DokuWiki_Action_Plugin::register(Doku_Event_Handler $controller) in /s/bach/b/class/cs545/public_html/fall16/lib/plugins/tablewidth/action.php on line 93
assignments:assignment3 [CS545 fall 2016]

User Tools

Site Tools


assignments:assignment3

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
assignments:assignment3 [2016/09/19 10:09]
asa
assignments:assignment3 [2016/09/20 09:34]
asa [Part 1]
Line 15: Line 15:
 ==== Part 1 ==== ==== Part 1 ====
  
-Implement ridge regression in a class called RidgeRegression that implements the classifier API, i.e. ``fit`` and ``predict`` methods with the same signature as the Perceptron class you implemented in the previous assignment. ​ Also implement functions for computing the following measures of error:+Implement ridge regression in a class called RidgeRegression that implements the classifier API, i.e. ''​fit'' ​and ''​predict'' ​methods with the same signature as the classifiers ​you implemented in the previous assignment. ​ Also implement functions for computing the following measures of error:
  
   * The Root Mean Square Error (RMSE).   * The Root Mean Square Error (RMSE).
Line 30: Line 30:
  
 With the code you just implemented,​ your next task is to explore the dependence of error on the value of the regularization parameter, $\lambda$. With the code you just implemented,​ your next task is to explore the dependence of error on the value of the regularization parameter, $\lambda$.
-In what follows set aside 30% of the data as a test-set, and compute the in-sample error, and the test-set error as a function of the parameter $\lambda$ on the red wine data.  Choose the values of $\lambda$ on a logarithmic scale with values 0.01, 0.1, 1, 10, 100, 1000 and plot the RMSE only+In what follows set aside 30% of the data as a validation-set, and compute the in-sample error, and the validation-set error as a function of the parameter $\lambda$ on the red wine data.  Choose the values of $\lambda$ on a logarithmic scale with values 0.01, 0.1, 1, 10, 100, 1000 and plot the RMSE. 
-Repeat the same experiment where instead of using all the training data, choose 20 random examples out of the training set, and train your model using those 20 examples.+Repeat the same experiment where instead of using all the training data, choose 20 random examples out of the training set, and train your model using those 20 examples, while evaluating on the same validation set.
  
 Now answer the following: Now answer the following:
Line 43: Line 43:
 Regression Error Characteristic (REC) curves are an interesting way of visualizing regression error as described Regression Error Characteristic (REC) curves are an interesting way of visualizing regression error as described
 in the following [[http://​machinelearning.wustl.edu/​mlpapers/​paper_files/​icml2003_BiB03.pdf|paper]]. in the following [[http://​machinelearning.wustl.edu/​mlpapers/​paper_files/​icml2003_BiB03.pdf|paper]].
-Write a function that plots the REC curve of a regression method, and plot the REC curve of the best regressor you found in Part 1 of the assignment.+Write a function that plots the REC curve of a regression method, and plot the REC curve of the best regressor you found in Part 1 of the assignment ​(i.e. the one that gave the lowest error on the validation set).  Plot the REC curve for both the validation set and the training set.
 What can you learn from this curve that you cannot learn from an error measure such as RMSE or MAD? What can you learn from this curve that you cannot learn from an error measure such as RMSE or MAD?
  
Line 53: Line 53:
 We will explore the relationship between the magnitude of weight vector components and their relevance to the classification task in several ways. We will explore the relationship between the magnitude of weight vector components and their relevance to the classification task in several ways.
 Each feature is associated with a component of the weight vector. ​ It can also be associated with the correlation of that feature with the vector of labels. Each feature is associated with a component of the weight vector. ​ It can also be associated with the correlation of that feature with the vector of labels.
-Create ​a scatter plot of the weight vector ​component ​against the [[https://​en.wikipedia.org/​wiki/​Pearson_product-moment_correlation_coefficient | Pearson correlation coefficient]] of feature ​against ​the labels (again, you can use the [[http://​docs.scipy.org/​doc/​numpy/​reference/​routines.statistics.html | Numpy statistics module]] to compute it).+As we discussed in class, the magnitude of the weight vector can give an indication of feature relevance; another measure of relevance of a feature is its correlation with the labels. ​ To compare the two,  
 +create ​a scatter plot of weight vector ​components ​against the [[https://​en.wikipedia.org/​wiki/​Pearson_product-moment_correlation_coefficient | Pearson correlation coefficient]] of the corresponding ​feature ​with the labels (again, you can use the [[http://​docs.scipy.org/​doc/​numpy/​reference/​routines.statistics.html | Numpy statistics module]] to compute it).
 What can you conclude from this plot? What can you conclude from this plot?
 The paper ranks features according to their importance using a different approach. ​ Compare your results with what they obtain. The paper ranks features according to their importance using a different approach. ​ Compare your results with what they obtain.
assignments/assignment3.txt · Last modified: 2016/09/20 09:34 by asa