Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

8. Building Price Models > Weighted Neighbors

Weighted Neighbors

One way to compensate for the fact that the algorithm may be using neighbors that are too far away is to weight them according to their distance. This is similar to the method used in Chapter 2, where people’s preferences were weighted according to how similar they were to the preferences of a person seeking a recommendation.

The more similar the items are, the smaller the distance between them, so you’ll need a way of converting distances to weights. There are a few different ways of doing this, each with advantages and drawbacks. This section will look at three functions that you can use.

Inverse Function

The function you used in Chapter 4 to convert distances to weights was an inverse function. Figure 8-3 shows what this looks like if you plot weight on one axis and price on the other.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint