Grokking Algorithms



Download 6,4 Mb.
Pdf ko'rish
bet93/120
Sana21.12.2022
Hajmi6,4 Mb.
#893167
1   ...   89   90   91   92   93   94   95   96   ...   120
Bog'liq
Grokking Algorithms An Illustrated Guide for Programmers and Other

Chapter 10
 
 
I
 
 
K-nearest neighbors
It just involves a set o
f ive numbers instead of a set of two numbers.
he distance formula is lexible: you could have a set of a 
million
numbers and still use the same old distance formula to ind the 
distance. Maybe you’re wondering, “What does 
distance
mean when 
you have ive numbers?” he distance tells you how similar those sets of 
numbers are.
Here’s the distance between Priyanka and Justin.
Priyanka and Justin are pretty similar. What’s the diference between 
Priyanka and Morpheus? Calculate the distance before moving on.
Did you get it right? Priyanka and Morpheus are 24 apart. he distance 
tells you that Priyanka’s tastes are more like Justin’s than Morpheus’s.
Great! Now recommending movies to Priyanka is easy: if Justin likes a 
movie, recommend it to Priyanka, and vice versa. You just built a movie 
recommendations system!
If you’re a Netlix user, Netlix will keep telling you, “Please rate more 
movies. he more movies you rate, the better your recommendations 
will be.” Now you know why. he more movies you rate, the more 
accurately Netlix can see what other users you’re similar to.


195
Building a recommendations system
EXERCISES
10.1 
In the Net
lix example, you calculated the distance between two 
diferent users using the distance formula. But not all users rate 
movies the same way. Suppose you have two users, Yogi and Pinky, 
who have the same taste in movies. But Yogi rates any movie he 
likes as a 5, whereas Pinky is choosier and reserves the 5s for 
only the best. hey’re well matched, but according to the distance 
algorithm, they aren’t neighbors. How would you take their 
diferent rating strategies into account? 
10.2
Suppose Netlix nominates a group of “inluencers.” For example, 
Quentin Tarantino and Wes Anderson are inluencers on Netlix, 
so their ratings count for more than a normal user’s. How would 
you change the recommendations system so it’s biased toward the 
ratings of inluencers?
Regression
Suppose you want to do more than just recommend a movie: you want 
to guess how Priyanka will rate this movie. Take the ive people closest 
to her.
By the way, I keep talking about the closest ive people. here’s nothing 
special about the number 5: you could do the closest 2, or 10, or 10,000. 
hat’s why the algorithm is called k-nearest neighbors and not ive-
nearest neighbors! 
Suppose you’re trying to guess a rating for 
Pitch Perfect
. Well, how did 
Justin, JC, Joey, Lance, and Chris rate it?


196

Download 6,4 Mb.

Do'stlaringiz bilan baham:
1   ...   89   90   91   92   93   94   95   96   ...   120




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish