НачатьНачать бесплатно

Feature exploration

Using the same Avazu dataset, you will explore how the values of device_type and banner_pos are distributed, as well as how CTR varies based on them.

Sample data in DataFrame form is loaded as df. The X and y variables that you created in the last exercise are available in your workspace. pandas as pd are also available in your workspace.

Это упражнение является частью курса

Predicting CTR with Machine Learning in Python

Посмотреть курс

Интерактивное практическое упражнение

Попробуйте выполнить это упражнение, дополнив этот пример кода.

# Distribution of values for device type
print("Distribution of device type: ")
print(X.device_type.____()/len(X))

# Sample CTR by device type 
print("CTR by device type: ")
print(df.____('device_type')['click'].____/len(y))
Редактировать и запускать код