Assignment BD107 AI-Komalasari-2681483783

Pertanyaan :

  1. Describe the steps of the k-Means clustering algorithm. What does the ‘k’ represent?
  2. Why is dimensionality reduction useful in machine learning?
  3. Provide a real-world application for clustering (e.g., customer segmentation).
  4. What is the main objective of PCA?

Jawaban:

1.Steps of the k-Means clustering algorithm:

  1. Choose the value of k ,Decide the number of clusters desired.
  2. Initialize centroids ,Select k initial points as centroids (cluster centers), either randomly or using the k-Means++ method.
  3. Assignment ,Calculate the distance from each data point to every centroid (usually using Euclidean Distance), then assign each data point to the nearest centroid.
  4. Update , Recalculate each centroid’s position as the mean of all data points assigned to that centroid.
  5. Iterate , Repeat steps 3 and 4 until:
    • Centroids no longer change (convergence), or
    • The maximum number of iterations is reached, or
    • The change in centroid positions falls below a certain threshold.

Meaning of ‘k’:
‘k’ represents the number of clusters (groups) to be formed from the data. The value of k is determined by the user before the algorithm runs. For example, if k = 3, the algorithm will divide the data into 3 groups.

2.

  1. Combating the Curse of Dimensionality ,The more features, the sparser the data and the harder it is for models to find patterns.
  2. Faster computation , Lower-dimensional data requires shorter training and prediction times.
  3. Reducing overfitting , Too many features can cause a model to memorize noise; dimensionality reduction helps the model generalize better.
  4. Data visualization,High-dimensional data is hard to visualize; reducing to 2D or 3D enables informative visualization.
  5. Noise reduction , Components with small variance are often noise and can be discarded.
  6. Saving storage and memory ,More compact data is more efficient to store and process.
  7. Removing multicollinearity , Highly correlated features can confuse linear models.

3.

Real-world application of clustering: Customer Segmentation

A retail company wants to better understand its customers. Using k-Means Clustering, the company groups customers based on:

  • Purchase frequency
  • Average transaction value
  • Types of products purchased
  • Recency of last purchase

As a result, the company discovers several segments, such as:

  1. Loyal Customers ,frequent shoppers, high transaction value
  2. Budget Customers , frequent shoppers, low transaction value
  3. Premium Customers , infrequent shoppers, very high transaction value
  4. Passive Customers , infrequent shoppers, low transaction value

Benefits:

  • More targeted marketing strategies
  • Personalized promotions for each segment
  • Marketing budget efficiency
  • Improved customer retention

Other examples:

  • Grouping news articles by topic
  • Anomaly detection in credit card transactions
  • Medical image segmentation (healthy vs diseased tissue)
  • Grouping genes based on expressio

4.

The main objective of PCA is to reduce the dimensionality of data from a high-dimensional space to a lower-dimensional space, while retaining as much variance (information) as possible from the original data.

PCA achieves this by:

  1. Finding new axes (principal components) that are mutually perpendicular (orthogonal)
  2. Ordering these axes by the amount of variance they capture
  3. The first principal component (PC1) captures the largest variance
  4. The second principal component (PC2) captures the next largest variance, and so on
  5. By selecting the top few principal components, we can represent the data in fewer dimensions without losing too much information

In essence: PCA transforms data into a new coordinate system where the data’s variance is maximized along the first few dimensions, allowing the remaining dimensions to be discarded.

Previous Post Previous Post
Newer Post Newer Post

Leave a comment