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

Multidimensional scaling in three dimensions

In this exercise, you will perform multidimensional scaling of all numeric columns of the wine data, specifying three dimensions for the final representation.

Bu egzersiz, kursun bir parçasıdır

Multivariate Probability Distributions in R

Kursa Göz Atın

Egzersiz talimatları

  • Exclude the first column containing the wine type and compute the distance matrix for all other columns and assign it to an object wine.dist.
  • Compute the multidimensional scaling of the data to represent the distance in three dimensions.
  • Use the scatterplot3d() function to plot the representation and color them by wine type.

Uygulamalı etkileşimli egzersiz

Bu egzersizi bu örnek kodu tamamlayarak deneyin.

# Calculate distance 
wine.dist <- dist(___[,-1])

# Perform multidimensional scaling 
mds.wine <- cmdscale(___) 
mds.wine_df <- data.frame(mds.wine)

# Plot the representation of the data in three dimensions 
scatterplot3d(___, color = ___, pch = 19, type = "h", lty.hplot = 2)
Kodu Düzenle ve Çalıştır