{ "cells": [ { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " <style>\n", " table.eli5-weights tr:hover {\n", " filter: brightness(85%);\n", " }\n", "</style>\n", "\n", "\n", "\n", " \n", "\n", " \n", "\n", " \n", "\n", " \n", "\n", " \n", "\n", " \n", "\n", "\n", " \n", "\n", " \n", "\n", " \n", "\n", " \n", " \n", "\n", " \n", " <table class=\"eli5-weights-wrapper\" style=\"border-collapse: collapse; border: none; margin-bottom: 1.5em;\">\n", " <tr>\n", " \n", " <td style=\"padding: 0.5em; border: 1px solid black; text-align: center;\">\n", " <b>\n", " \n", " y=alt.atheism\n", " \n", "</b>\n", "\n", "top features\n", " </td>\n", " \n", " <td style=\"padding: 0.5em; border: 1px solid black; text-align: center;\">\n", " <b>\n", " \n", " y=comp.graphics\n", " \n", "</b>\n", "\n", "top features\n", " </td>\n", " \n", " <td style=\"padding: 0.5em; border: 1px solid black; text-align: center;\">\n", " <b>\n", " \n", " y=sci.med\n", " \n", "</b>\n", "\n", "top features\n", " </td>\n", " \n", " <td style=\"padding: 0.5em; border: 1px solid black; text-align: center;\">\n", " <b>\n", " \n", " y=soc.religion.christian\n", " \n", "</b>\n", "\n", "top features\n", " </td>\n", " \n", " </tr>\n", " <tr>\n", " \n", " \n", " <td style=\"padding: 0px; border: 1px solid black; vertical-align: top;\">\n", " \n", " \n", " \n", " \n", " \n", " <table class=\"eli5-weights\"\n", " style=\"border-collapse: collapse; border: none; margin-top: 0em; table-layout: auto; width: 100%;\">\n", " <thead>\n", " <tr style=\"border: none;\">\n", " \n", " <th style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\" title=\"Feature weights. Note that weights do not account for feature value scales, so if feature values have different scales, features with highest weights might not be the most important.\">\n", " Weight<sup>?</sup>\n", " </th>\n", " \n", " <th style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">Feature</th>\n", " \n", " </tr>\n", " </thead>\n", " <tbody>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 83.80%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +2.261\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " atheism\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 85.34%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +1.961\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " islam\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 86.87%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +1.675\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " morality\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 87.05%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +1.642\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " islamic\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 87.23%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +1.610\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " bobby\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 87.57%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +1.550\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " objective\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 87.78%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +1.511\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " deletion\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 88.16%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +1.445\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " religion\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 89.09%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +1.285\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " motto\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 89.30%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +1.251\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " kent\n", " </td>\n", " \n", "</tr>\n", " \n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 89.30%); border: none;\">\n", " <td colspan=\"2\" style=\"padding: 0 0.5em 0 0.5em; text-align: center; border: none; white-space: nowrap;\">\n", " <i>… 6242 more positive …</i>\n", " </td>\n", " </tr>\n", " \n", "\n", " \n", " <tr style=\"background-color: hsl(0, 100.00%, 91.05%); border: none;\">\n", " <td colspan=\"2\" style=\"padding: 0 0.5em 0 0.5em; text-align: center; border: none; white-space: nowrap;\">\n", " <i>… 12274 more negative …</i>\n", " </td>\n", " </tr>\n", " \n", " \n", " <tr style=\"background-color: hsl(0, 100.00%, 91.05%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " -0.969\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " christ\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(0, 100.00%, 89.91%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " -1.149\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " christians\n", " </td>\n", " \n", "</tr>\n", " \n", "\n", " </tbody>\n", " </table>\n", "\n", " \n", " \n", " </td>\n", " \n", " <td style=\"padding: 0px; border: 1px solid black; vertical-align: top;\">\n", " \n", " \n", " \n", " \n", " \n", " <table class=\"eli5-weights\"\n", " style=\"border-collapse: collapse; border: none; margin-top: 0em; table-layout: auto; width: 100%;\">\n", " <thead>\n", " <tr style=\"border: none;\">\n", " \n", " <th style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\" title=\"Feature weights. Note that weights do not account for feature value scales, so if feature values have different scales, features with highest weights might not be the most important.\">\n", " Weight<sup>?</sup>\n", " </th>\n", " \n", " <th style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">Feature</th>\n", " \n", " </tr>\n", " </thead>\n", " <tbody>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 80.00%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +3.056\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " graphics\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 85.11%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +2.005\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " image\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 86.04%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +1.829\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " 3d\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 86.12%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +1.813\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " files\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 86.81%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +1.686\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " file\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 86.95%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +1.661\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " software\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 87.49%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +1.563\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " images\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 88.00%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +1.474\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " code\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 88.00%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +1.473\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " program\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 88.30%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +1.420\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " computer\n", " </td>\n", " \n", "</tr>\n", " \n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 88.30%); border: none;\">\n", " <td colspan=\"2\" style=\"padding: 0 0.5em 0 0.5em; text-align: center; border: none; white-space: nowrap;\">\n", " <i>… 5545 more positive …</i>\n", " </td>\n", " </tr>\n", " \n", "\n", " \n", " <tr style=\"background-color: hsl(0, 100.00%, 91.75%); border: none;\">\n", " <td colspan=\"2\" style=\"padding: 0 0.5em 0 0.5em; text-align: center; border: none; white-space: nowrap;\">\n", " <i>… 11548 more negative …</i>\n", " </td>\n", " </tr>\n", " \n", " \n", " <tr style=\"background-color: hsl(0, 100.00%, 91.75%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " -0.863\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " who\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(0, 100.00%, 90.46%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " -1.062\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " of\n", " </td>\n", " \n", "</tr>\n", " \n", "\n", " </tbody>\n", " </table>\n", "\n", " \n", " \n", " </td>\n", " \n", " <td style=\"padding: 0px; border: 1px solid black; vertical-align: top;\">\n", " \n", " \n", " \n", " \n", " \n", " <table class=\"eli5-weights\"\n", " style=\"border-collapse: collapse; border: none; margin-top: 0em; table-layout: auto; width: 100%;\">\n", " <thead>\n", " <tr style=\"border: none;\">\n", " \n", " <th style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\" title=\"Feature weights. Note that weights do not account for feature value scales, so if feature values have different scales, features with highest weights might not be the most important.\">\n", " Weight<sup>?</sup>\n", " </th>\n", " \n", " <th style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">Feature</th>\n", " \n", " </tr>\n", " </thead>\n", " <tbody>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 84.01%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +2.220\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " msg\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 84.54%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +2.116\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " doctor\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 86.23%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +1.793\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " disease\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 87.13%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +1.628\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " patients\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 87.95%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +1.482\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " pain\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 87.96%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +1.480\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " treatment\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 88.43%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +1.399\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " medical\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 88.84%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +1.328\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " cancer\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 89.04%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +1.295\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " food\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 89.37%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +1.238\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " medicine\n", " </td>\n", " \n", "</tr>\n", " \n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 89.37%); border: none;\">\n", " <td colspan=\"2\" style=\"padding: 0 0.5em 0 0.5em; text-align: center; border: none; white-space: nowrap;\">\n", " <i>… 9977 more positive …</i>\n", " </td>\n", " </tr>\n", " \n", "\n", " \n", " <tr style=\"background-color: hsl(0, 100.00%, 91.42%); border: none;\">\n", " <td colspan=\"2\" style=\"padding: 0 0.5em 0 0.5em; text-align: center; border: none; white-space: nowrap;\">\n", " <i>… 11653 more negative …</i>\n", " </td>\n", " </tr>\n", " \n", " \n", " <tr style=\"background-color: hsl(0, 100.00%, 91.42%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " -0.913\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " religion\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(0, 100.00%, 87.13%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " -1.628\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " god\n", " </td>\n", " \n", "</tr>\n", " \n", "\n", " </tbody>\n", " </table>\n", "\n", " \n", " \n", " </td>\n", " \n", " <td style=\"padding: 0px; border: 1px solid black; vertical-align: top;\">\n", " \n", " \n", " \n", " \n", " \n", " <table class=\"eli5-weights\"\n", " style=\"border-collapse: collapse; border: none; margin-top: 0em; table-layout: auto; width: 100%;\">\n", " <thead>\n", " <tr style=\"border: none;\">\n", " \n", " <th style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\" title=\"Feature weights. Note that weights do not account for feature value scales, so if feature values have different scales, features with highest weights might not be the most important.\">\n", " Weight<sup>?</sup>\n", " </th>\n", " \n", " <th style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">Feature</th>\n", " \n", " </tr>\n", " </thead>\n", " <tbody>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 82.11%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +2.606\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " church\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 82.44%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +2.537\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " god\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 82.49%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +2.528\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " christians\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 83.32%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +2.359\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " christian\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 84.04%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +2.214\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " jesus\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 84.93%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +2.039\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " christ\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 87.67%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +1.531\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " christianity\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 87.73%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +1.520\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " heaven\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 87.96%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +1.480\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " sin\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 88.36%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " +1.410\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " scripture\n", " </td>\n", " \n", "</tr>\n", " \n", " \n", " <tr style=\"background-color: hsl(120, 100.00%, 88.36%); border: none;\">\n", " <td colspan=\"2\" style=\"padding: 0 0.5em 0 0.5em; text-align: center; border: none; white-space: nowrap;\">\n", " <i>… 7403 more positive …</i>\n", " </td>\n", " </tr>\n", " \n", "\n", " \n", " <tr style=\"background-color: hsl(0, 100.00%, 90.71%); border: none;\">\n", " <td colspan=\"2\" style=\"padding: 0 0.5em 0 0.5em; text-align: center; border: none; white-space: nowrap;\">\n", " <i>… 13076 more negative …</i>\n", " </td>\n", " </tr>\n", " \n", " \n", " <tr style=\"background-color: hsl(0, 100.00%, 90.71%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " -1.023\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " <BIAS>\n", " </td>\n", " \n", "</tr>\n", " \n", " <tr style=\"background-color: hsl(0, 100.00%, 89.59%); border: none;\">\n", " <td style=\"padding: 0 1em 0 0.5em; text-align: right; border: none;\">\n", " -1.203\n", " </td>\n", " <td style=\"padding: 0 0.5em 0 0.5em; text-align: left; border: none;\">\n", " atheism\n", " </td>\n", " \n", "</tr>\n", " \n", "\n", " </tbody>\n", " </table>\n", "\n", " \n", " \n", " </td>\n", " \n", " \n", " </tr>\n", " </table>\n", " \n", "\n", " \n", " \n", "\n", "\n", " \n", " \n", "\n", "\n", " \n", " \n", "\n", "\n", " \n", " \n", "\n", "\n", " \n", "\n", "\n", " \n", "\n", " \n", "\n", " \n", "\n", "\n", " \n", "\n", " \n", "\n", " \n", "\n", " \n", "\n", " \n", "\n", " \n", "\n", "\n", " \n", "\n", " \n", "\n", " \n", "\n", " \n", "\n", " \n", "\n", " \n", "\n", "\n", "\n" ], "text/plain": [ "<IPython.core.display.HTML object>" ] }, "execution_count": 26, "metadata": {}, "output_type": "execute_result" } ], "source": [ "eli5.show_weights(text_clf, top=(10, 2),\n", " target_names=twenty_train.target_names)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.1" } }, "nbformat": 4, "nbformat_minor": 2 }