BaşlayınÜcretsiz Başlayın

Create the ellipses

The area enclosed by the ellipse represents the 95% of cluster's observations, so this curve is useful to picture where is the cluster situated. Since we have already extracted the means (mean_comp_number) and the covariance matrices (covariance_comp_number), we can easily create the ellipses for the two clusters.

Be aware though that the ellipses do not consider the proportions and only show you where the clusters are, but not their importance.

Bu egzersiz

Mixture Models in R

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Use the function ellipse() to create these curves. The function has the covariance matrix as x argument and the mean as centre argument.
  • Use the number of rows in the gender dataset as npoints.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Create ellipse curve 1
ellipse_comp_1 <- ___(x = ___, 
                          centre = ___,
                          npoints = nrow(___))
head(ellipse_comp_1)

# Create ellipse curve 2
ellipse_comp_2 <- ___(x = ___, 
                          centre = ___,
                          npoints = ___(gender))
head(ellipse_comp_2)
Kodu Düzenle ve Çalıştır