क्लस्टरिंग विश्लेषण: क्लस्टर्स की आदर्श संख्या चुनना

Python में Machine Learning इंटरव्यू प्रश्नों का अभ्यास

Lisa Stuart

Data Scientist

आदर्श k के तरीके

  • Silhouette method
  • Elbow method
Python में Machine Learning इंटरव्यू प्रश्नों का अभ्यास

Silhouette coefficient

  • 2 स्कोर्स से बना
    • प्रत्येक observation और अन्य सभी के बीच औसत दूरी:
      • उसी क्लस्टर में
      • सबसे नज़दीकी क्लस्टर में
Python में Machine Learning इंटरव्यू प्रश्नों का अभ्यास

Silhouette coefficient के मान

  • -1 से 1 के बीच
    • 1
      • उसी क्लस्टर में दूसरों के काफ़ी पास
      • अन्य क्लस्टर्स के लोगों से बहुत दूर
    • -1
      • उसी क्लस्टर में दूसरों के पास नहीं
      • अन्य क्लस्टर्स के लोगों के क़रीब
    • 0
      • ओवरलैप होते क्लस्टर्स दर्शाता है
Python में Machine Learning इंटरव्यू प्रश्नों का अभ्यास

Silhouette स्कोर

Silhouette स्कोर प्लॉट

1 https://scikit-learn.org/stable/auto_examples/cluster/plot_kmeans_silhouette_analysis.html
Python में Machine Learning इंटरव्यू प्रश्नों का अभ्यास

Elbow method

Elbow method प्लॉट

1 https://www.datanovia.com/en/lessons/determining-the-optimal-number-of-clusters-3-must-know-methods/
Python में Machine Learning इंटरव्यू प्रश्नों का अभ्यास

आदर्श k चुनने की functions

Function/method returns
sklearn.cluster.KMeans K-Means क्लस्टरिंग एल्गोरिदम
sklearn.metrics.silhouette_score -1 से 1 के बीच स्कोर, क्लस्टर स्थिरता का माप
kmeans.inertia_ observations से नज़दीकी क्लस्टर सेंटर तक SS दूरी
range(start, stop) start से शुरू होकर, stop को छोड़कर मानों की सूची
list.append(kmeans.inertia_) सूची में inertia मान जोड़ता है
Python में Machine Learning इंटरव्यू प्रश्नों का अभ्यास

अभ्यास करते हैं!

Python में Machine Learning इंटरव्यू प्रश्नों का अभ्यास

Preparing Video For Download...