انت هنا الان : شبكة جامعة بابل > موقع الكلية > نظام التعليم الالكتروني > مشاهدة المحاضرة

k Nearest Neighbors _2

الكلية كلية العلوم للبنات     القسم قسم الحاسبات     المرحلة 4
أستاذ المادة زينب فلاح حسن الكيم       09/04/2019 12:11:33
classify an unknown example with the most common class among k closest examples
• “tell me who your neighbors are, and I’ll tell you who you are”
Problems if “tune” k on training data
• meta parameter, overfit if tune these on training data
k = 1 is often used for efficiency, but sensitive to “noise”

Larger k gives smoother boundaries, better for generalization
• But only if locality is preserved. Locality is not preserved if end up looking at samples too far away, not from the same class.
• Interesting theoretical properties if k < sqrt(n), n is # of examples
• Can choose k through cross-validation (study soon)

normalize features to be on the same scale
• Different normalization approaches
• Linearly scale the range of each feature to be, say, in range [0,1]

Linearly scale to 0 mean variance 1:
• If Z is a random variable of mean m and variance ?

Feature normalization does not help in high dimensional
spaces if most features are irrelevant
,
then (Z - m)/? has mean 0 and variance 1

If K=1, select the nearest neighbor
• If K>1,
– For classification select the most frequent
neighbor.
– For regression calculate the average of K
neighbors.


المادة المعروضة اعلاه هي مدخل الى المحاضرة المرفوعة بواسطة استاذ(ة) المادة . وقد تبدو لك غير متكاملة . حيث يضع استاذ المادة في بعض الاحيان فقط الجزء الاول من المحاضرة من اجل الاطلاع على ما ستقوم بتحميله لاحقا . في نظام التعليم الالكتروني نوفر هذه الخدمة لكي نبقيك على اطلاع حول محتوى الملف الذي ستقوم بتحميله .