16
Error Rate for the Nearest-Neighbor Rule

Error Rate for the Nearest-Neighbor Rulesrihari/CSE555/Chap4.Part3.pdf · Computational Complexity of k-Nearest- Neighbor Rule • Each Distance Calculation is O(d) • Finding single

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Error Rate for the Nearest-Neighbor Rulesrihari/CSE555/Chap4.Part3.pdf · Computational Complexity of k-Nearest- Neighbor Rule • Each Distance Calculation is O(d) • Finding single

Error Rate for the Nearest-Neighbor Rule

Page 2: Error Rate for the Nearest-Neighbor Rulesrihari/CSE555/Chap4.Part3.pdf · Computational Complexity of k-Nearest- Neighbor Rule • Each Distance Calculation is O(d) • Finding single

Error Rate of the Nearest-Neighbor Rule

Page 3: Error Rate for the Nearest-Neighbor Rulesrihari/CSE555/Chap4.Part3.pdf · Computational Complexity of k-Nearest- Neighbor Rule • Each Distance Calculation is O(d) • Finding single

Error Rate for the Nearest-Neighbor Rule

Page 4: Error Rate for the Nearest-Neighbor Rulesrihari/CSE555/Chap4.Part3.pdf · Computational Complexity of k-Nearest- Neighbor Rule • Each Distance Calculation is O(d) • Finding single

Error Bounds

Page 5: Error Rate for the Nearest-Neighbor Rulesrihari/CSE555/Chap4.Part3.pdf · Computational Complexity of k-Nearest- Neighbor Rule • Each Distance Calculation is O(d) • Finding single

Error Bounds

Page 6: Error Rate for the Nearest-Neighbor Rulesrihari/CSE555/Chap4.Part3.pdf · Computational Complexity of k-Nearest- Neighbor Rule • Each Distance Calculation is O(d) • Finding single

Error Bounds

Page 7: Error Rate for the Nearest-Neighbor Rulesrihari/CSE555/Chap4.Part3.pdf · Computational Complexity of k-Nearest- Neighbor Rule • Each Distance Calculation is O(d) • Finding single
Page 8: Error Rate for the Nearest-Neighbor Rulesrihari/CSE555/Chap4.Part3.pdf · Computational Complexity of k-Nearest- Neighbor Rule • Each Distance Calculation is O(d) • Finding single

The k – Nearest-Neighbor Rule

• Classify x by assigning it the label most frequently represented among the k nearest samples and use a voting scheme

Page 9: Error Rate for the Nearest-Neighbor Rulesrihari/CSE555/Chap4.Part3.pdf · Computational Complexity of k-Nearest- Neighbor Rule • Each Distance Calculation is O(d) • Finding single

The k – Nearest-Neighbor Rule

• Select wm if a majority of the k nearest neighbors are labeled wm, an event of probability

• It can be shown that if k is odd, the large-sample two-class error rate for the k-nearest-neighbor rule is bounded above by the function Ck (P*), where Ck (P*) is defined to be the smallest concave function of P* greater than

Page 10: Error Rate for the Nearest-Neighbor Rulesrihari/CSE555/Chap4.Part3.pdf · Computational Complexity of k-Nearest- Neighbor Rule • Each Distance Calculation is O(d) • Finding single
Page 11: Error Rate for the Nearest-Neighbor Rulesrihari/CSE555/Chap4.Part3.pdf · Computational Complexity of k-Nearest- Neighbor Rule • Each Distance Calculation is O(d) • Finding single
Page 12: Error Rate for the Nearest-Neighbor Rulesrihari/CSE555/Chap4.Part3.pdf · Computational Complexity of k-Nearest- Neighbor Rule • Each Distance Calculation is O(d) • Finding single

Computational Complexity of k-Nearest-Neighbor Rule

• Each Distance Calculation is O(d)• Finding single nearest neighbor is O(n)• Finding k nearest neighbors involves sorting; thus O(dn2)• Methods for speed-up:

• Parallelism• Partial Distance• Prestructuring• Editing, pruning or condensing

Page 13: Error Rate for the Nearest-Neighbor Rulesrihari/CSE555/Chap4.Part3.pdf · Computational Complexity of k-Nearest- Neighbor Rule • Each Distance Calculation is O(d) • Finding single

Parallel Implementation of k-Nearest-Neighbor Rule

O(1) in time and O(n) in space

Page 14: Error Rate for the Nearest-Neighbor Rulesrihari/CSE555/Chap4.Part3.pdf · Computational Complexity of k-Nearest- Neighbor Rule • Each Distance Calculation is O(d) • Finding single

Partial Distance Method of nn speedup

• The partial distance based on r selected dimensions is

• Terminate a distance calculation once its partial distance is greater than the full r =d Euclidean distance to the current closest prototype

Page 15: Error Rate for the Nearest-Neighbor Rulesrihari/CSE555/Chap4.Part3.pdf · Computational Complexity of k-Nearest- Neighbor Rule • Each Distance Calculation is O(d) • Finding single

Search Tree Method of nn speedup

• Create a search tree where prototypes are selectively linked

• Consider only the prototypes linked to entry point

• Points in neighboring region may actually be closer• Tradeoff of accuracy versus speed

Entry points

Page 16: Error Rate for the Nearest-Neighbor Rulesrihari/CSE555/Chap4.Part3.pdf · Computational Complexity of k-Nearest- Neighbor Rule • Each Distance Calculation is O(d) • Finding single

Editing Method of nn speedup

• Eliminate Prototypes that are surrounded by training points of the same category

• Complexity is O(d3 nd/2 ln n)