开始使用免费开始使用

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.

本练习是课程的一部分

HR Analytics: Predicting Employee Churn in R

查看课程

练习说明

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

交互式实操练习

通过完成这段示例代码来试试这个练习。

# 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))
编辑并运行代码