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:assignment3 [2016/09/19 10:09] asa |
assignments:assignment3 [2016/09/19 12:19] 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 Perceptron class 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 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 a 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. |