{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Rank Estimation" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "%%capture\n", "# execute the creation & training notebook first\n", "%run \"02-01-creation_and_training.ipynb\"\n", "# execute the outlier detection notebook\n", "%run \"02-05-outlier_detection.ipynb\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In the [outlier detection section](./02-05-outlier_detection.ipynb) we saw how to detect outliers in a test data set and how the outlier threshold influenced the detection results.\n", "\n", "In this section we take a look at the ``.estimate_ranks`` method. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The corresponding class ``RankEstimator`` is actually used by the ``OutlierDetector`` under the hood to estimate the typicality of individual data points. Let us apply the rank estimator to the modified test data set from the outlier detection example." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | (a) | \n", "(b|a) | \n", "(c|a,b) | \n", "graph | \n", "
---|---|---|---|---|
0 | \n", "0.547 | \n", "0.267 | \n", "0.742 | \n", "0.660 | \n", "
1 | \n", "0.974 | \n", "0.839 | \n", "0.876 | \n", "0.987 | \n", "
2 | \n", "0.452 | \n", "0.873 | \n", "0.757 | \n", "0.877 | \n", "
3 | \n", "0.089 | \n", "0.575 | \n", "0.555 | \n", "0.313 | \n", "
4 | \n", "0.880 | \n", "0.891 | \n", "0.869 | \n", "0.991 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
95 | \n", "0.171 | \n", "0.840 | \n", "0.540 | \n", "0.506 | \n", "
96 | \n", "0.660 | \n", "0.576 | \n", "0.800 | \n", "0.897 | \n", "
97 | \n", "0.684 | \n", "0.761 | \n", "0.850 | \n", "0.946 | \n", "
98 | \n", "0.903 | \n", "0.830 | \n", "0.863 | \n", "0.985 | \n", "
99 | \n", "0.879 | \n", "0.369 | \n", "0.879 | \n", "0.853 | \n", "
100 rows × 4 columns
\n", "\n", " | (a) | \n", "(b|a) | \n", "(c|a,b) | \n", "graph | \n", "
---|---|---|---|---|
25 | \n", "0.814 | \n", "0.030 | \n", "0.794 | \n", "0.173 | \n", "
31 | \n", "0.045 | \n", "0.769 | \n", "0.507 | \n", "0.193 | \n", "
50 | \n", "0.366 | \n", "0.000 | \n", "0.000 | \n", "0.000 | \n", "
60 | \n", "0.262 | \n", "0.712 | \n", "0.000 | \n", "0.000 | \n", "
74 | \n", "0.009 | \n", "0.523 | \n", "0.403 | \n", "0.045 | \n", "