LightMySky
به انگلیسی

Clustering: Structure Without Labels

With no target column, the question becomes which examples resemble each other. K-means alternates assigning points to the nearest centre and moving the centres, and the awkward parts are choosing k, choosing a distance, and deciding whether the groups mean anything.

شروع یادگیری این موضوعبه حساب کاربری نیازی نیست. پیشرفت در همین مرورگر ذخیره می‌شود.

کارهایی که یادگیرنده بعد از این درس می‌تواند انجام دهد

  • Run two rounds of k-means by hand on a small set of points
  • Show how different starting centres give different final groups
  • Say what makes a clustering result meaningful rather than merely tidy

۱ · بخوان

Every model so far, trees included, had a target column to score against. With no target column, the question becomes which examples resemble each other. K-means answers it by alternating two steps: assign every point to its nearest centre, then move each centre to the middle of its new group. Repeat the pair until the groups stop moving.

Try it together

Run two rounds by hand on points at 1, 2, 8 and 9, with starting centres at 1 and 9. Round one assigns 1 and 2 to the first centre and 8 and 9 to the second, then the centres move to 1.5 and 8.5. Round two assigns the same way, so the groups hold. Now notice the trap: different starting centres can end in different final groups.

012345678910centre 1.5centre 8.5

Two groups after round one, with the centres moved to 1.5 and 8.5. Round two changes nothing.

Before running k-means you must choose k, the number of centres, plus the distance you measure with. K-means is happiest when points form round, similarly sized blobs, since it always builds groups around a centre point. A wrong k forces the data into neat round groups that do not really exist.

A clustering result is not meaningful just because the algorithm finished. It is meaningful when the groups are tight inside, well separated from each other, and say something true about the data. Other shapes need other tools: DBScan walks point to point pulling in close neighbours, so it can find long stretched groups and label stray points as noise.

Alternate assign and move, choose k and distance with care, and trust only groups that are tight, separated and true.

The rewritten reading was written for this dataset.

۲ · ببین

به انگلیسی

دور از صفحه‌نمایش

چاپ کاربرگکاغذ A4، با یک صفحهٔ جواب‌ها برای بزرگ‌ترها. بدون صفحه‌نمایش، بدون اینترنت.

جایگاه این موضوع

سپس تمرین

۸ سؤال پشت این درس منتظرند، هر کدام با پاسخ توضیح‌داده‌شده. هر پاسخ آسمان را پر می‌کند: ستاره‌ها هنگام یادگیری روشن می‌شوند و وقتی زمان برگشتن است کمرنگ می‌شوند.

شروع یادگیری این موضوع