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

Exploring the traffic sign dataset

To better understand how the knn() function was able to classify the stop sign, it may help to examine the training dataset it used.

Each previously observed street sign was divided into a 4x4 grid, and the red, green, and blue level for each of the 16 center pixels is recorded as illustrated here.

Stop Sign Data Encoding

The result is a dataset that records the sign_type as well as 16 x 3 = 48 color properties of each sign.

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

Supervised Learning in R: Classification

Kursa Göz Atın

Egzersiz talimatları

  • Use the str() function to examine the signs dataset.
  • Use table() to count the number of observations of each sign type by passing it the column containing the labels.
  • Run the provided aggregate() command to see whether the average red level might vary by sign type.

Uygulamalı etkileşimli egzersiz

Bu egzersizi bu örnek kodu tamamlayarak deneyin.

# Examine the structure of the signs dataset


# Count the number of signs of each type
table(___)

# Check r10's average red level by sign type
aggregate(r10 ~ sign_type, data = signs, mean)
Kodu Düzenle ve Çalıştır