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

Accuracy of your model

Accuracy of the model can be calculated as:

$$\text{Accuracy} = \frac{\text{ TP + TN }}{\text{ TP + TN + FP + FN }}$$

where

  • True negatives (TN): You correctly identified active employees
  • True positives (TP): You correctly identified inactive employees
  • False positives (FP): You predicted employees as inactive, but they are actually active
  • False negatives (FN): You predicted employees as active, but they are actually inactive

confusionMatrix() function from caret package automatically calculates the accuracy of the model along with other relevant statistics.

Bu egzersiz

HR Analytics: Predicting Employee Churn in R

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

Egzersiz talimatları

  • Load the caret package.
  • Call confusionMatrix() on conf_matrix to print the accuracy of the model.
  • Review the output of confusionMatrix() and assign the accuracy of the model to accuracy.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Load caret
library(___)

# Call confusionMatrix
___

# Choose the model's accuracy as per confusionMatrix output (0.9283 or 92.83)?
accuracy <- ___
Kodu Düzenle ve Çalıştır