Aan de slagGa gratis aan de slag

Corroborate the splits

In the previous exercise, you split the dataset into train_set and test_set. It's important to make sure that the data you are training your model is representative of the test set. So let's make sure both train_set and test_set have the same proportion of active and inactive employees.

Deze oefening maakt deel uit van de cursus

HR Analytics: Predicting Employee Churn in R

Cursus bekijken

Oefeninstructies

Calculate the proportion of Active and Inactive employees in train_set and test_set.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Calculate turnover proportion in train_set
train_set %>% 
  ___(status) %>% 
  ___(prop = n / sum(n))

# Calculate turnover proportion in test_set
test_set %>% 
  ___(status) %>% 
  ___(prop = n / sum(n))
Code bewerken en uitvoeren