This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
assignments:assignment1 [2016/08/28 15:00] asa |
assignments:assignment1 [2016/08/31 19:07] (current) asa [Part 2: The nearest centroid classifier] |
||
---|---|---|---|
Line 37: | Line 37: | ||
With these definitions, answer the following: | With these definitions, answer the following: | ||
- | * How should we choose $c_r$ and $c_a$ such that the majority classifier and the minority classifier both have an error of 0.5? (The minority classifier is analogous to the majority classifier, except that it classifies everything as negative). Section 1.4.1 in the book has a brief discussion of error measures. | + | * How should we choose $c_r$ and $c_a$ such that the majority classifier and the minority classifier both have an error of 0.5? (The minority classifier is analogous to the majority classifier, except that it classifies everything as positive, since we assumed the positive class has fewer representatives). Section 1.4.1 in the book has a brief discussion of error measures. |
Line 52: | Line 52: | ||
Show that for a binary classification problem where the number of positive examples equals the number of negative examples the nearest centroid classifier can be expressed as a linear classifier with the weight vector | Show that for a binary classification problem where the number of positive examples equals the number of negative examples the nearest centroid classifier can be expressed as a linear classifier with the weight vector | ||
$$\mathbf{w} = \frac{1}{N}\sum_{i=1}^N y_i \mathbf{x}_i.$$ | $$\mathbf{w} = \frac{1}{N}\sum_{i=1}^N y_i \mathbf{x}_i.$$ | ||
- | Hint: consider the vector that connects the centroids of the two classes and draw a figure in two dimensions to help you think about the problem. | + | Hint: consider the vector that connects the centroids of the two classes and draw a figure in two dimensions to help you think about the problem. Also note that this form only holds if the two classes have equal number of examples, so we'll assume that is the case. |
===== Part 3: Are my features useful? ===== | ===== Part 3: Are my features useful? ===== |