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

Scatterplots for outlier detection

A scatterplot is another handy method to identify outliers visually. Although it is usually used to plot two variables against each other to inspect their relationship, using the trick from the video, you can plot a scatterplot with only one variable to make the outliers stand out.

matplotlib.pyplot is loaded as plt. The data is available as prices.

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

Anomaly Detection in Python

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

Инструкции к упражнению

  • Create a list of consecutive integers with the same length as prices.
  • Create a scatterplot with integers on the x-axis and prices on the y-axis.

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

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

# Create a list of consecutive integers
integers = ____(____(prices))

plt.figure(figsize=(16, 8))

# Plot a scatterplot
plt.____(____, ____, c='red', alpha=0.5)
plt.show()
Редактировать и запускать код