Performing outlier detection

Outlier detection is used to find outliers in the data that can throw off your analysis. Outliers come in two flavors: Univariate and Multivariate. A univariate outlier is a data point that consists of an extreme value on one variable. Univariate outliers can be seen when looking at a single variable. A multivariate outlier is a combination of unusual scores on at least two variables, and are found in multidimensional data.

For this recipe, we are going to use the college dataset from An Introduction to Statistical Learning with Applications in R.

How to do it…

  1. First, import the Python libraries that you need:
    import pandas as pd import numpy as np import matplotlib as plt import matplotlib.pyplot as plt %matplotlib inline ...

Get Python Business Intelligence Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.