{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"Sveučilište u Zagrebu
\n",
"Fakultet elektrotehnike i računarstva\n",
"\n",
"# Strojno učenje\n",
"\n",
"http://www.fer.unizg.hr/predmet/su\n",
"\n",
"Ak. god. 2015./2016.\n",
"\n",
"# Bilježnica 4: Bayesov klasifikator\n",
"\n",
"(c) 2015 Jan Šnajder\n",
"\n",
"Verzija: 0.7 (2015-10-31)"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Populating the interactive namespace from numpy and matplotlib\n"
]
}
],
"source": [
"import scipy as sp\n",
"import scipy.stats as stats\n",
"import matplotlib.pyplot as plt\n",
"import pandas as pd\n",
"%pylab inline"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Sadržaj:\n",
"\n",
"* Bayesovska klasifikacija\n",
"\n",
"* Naivan Bayesov klasifikator\n",
"\n",
"* Primjer: 101 Questions\n",
"\n",
"* Polunaivan Bayesov klasifikator*\n",
"\n",
"* Bayesov klasifikator za kontinuirane značajke\n",
"\n",
"* Bayesov klasifikator: komponente algoritma\n",
"\n",
"* Sažetak"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Bayesovska klasfikacija\n",
"\n",
"### Bayesovo pravilo \n",
"\n",
"$$\n",
"P(\\mathcal{C}_j|\\mathbf{x}) = \n",
"\\frac{P(\\mathbf{x},\\mathcal{C}_j)}{P(\\mathbf{x})} = \n",
"\\frac{p(\\mathbf{x}|\\mathcal{C}_j) P(\\mathcal{C}_j)}{p(\\mathbf{x})} =\n",
"\\frac{p(\\mathbf{x}|\\mathcal{C}_j)P(\\mathcal{C}_j)}{\\sum_{k=1}^K p(\\mathbf{x}|\\mathcal{C}_k)P(\\mathcal{C}_k)}\n",
"$$\n",
"\n",
"\n",
"* **Apriorna vjerojatnost klase** $\\mathcal{C}_j$:\n",
" * Binarna ($K=2)$ klasifikacija: Bernoullijeva razdioba\n",
" * Višeklasna ($K>2$) klasifikacija: kategorička razdioba\n",
"\n",
"\n",
"* **Izglednost klase** $p(\\mathbf{x}|\\mathcal{C}_j)$:\n",
" * Diskretne značajke: Bernoullijeva/kategorička razdioba\n",
" * Kontinuirane značajke: Gaussova razdioba\n",
"\n",
"\n",
"* Ovo je **parametarski** i **generativni** model\n",
" * Q: Zašto?\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Klasifikacijska odluka\n",
"\n",
"* MAP-hipoteza:\n",
"\\begin{align*}\n",
"h : \\mathcal{X} &\\to \\{\\mathcal{C}_1, \\mathcal{C}_2,\\dots, \\mathcal{C}_K\\}\\\\\n",
"h(\\mathbf{x})&=\\displaystyle\\mathrm{argmax}_{\\mathcal{C}_k}\\ p(\\mathbf{x}|\\mathcal{C}_k) P(\\mathcal{C}_k)\n",
"\\end{align*}\n",
"\n",
"* Pouzdanost klasifikacije u $\\mathcal{C}_j$:\n",
"\\begin{align*}\n",
"h_j : \\mathcal{X} &\\to [0,\\infty)\\\\\n",
"h_j(\\mathbf{x})&=p(\\mathbf{x}|\\mathcal{C}_k) P(\\mathcal{C}_k)\n",
"\\end{align*}\n",
"\n",
"* Vjerojatnost klasifikacije u $\\mathcal{C}_j$:\n",
"\\begin{align*}\n",
"h_j : \\mathcal{X} &\\to [0,1]\\\\\n",
"h_j(\\mathbf{x})&=P(\\mathcal{C}_k|\\mathbf{x})\n",
"\\end{align*}\n",
"\n",
"### Primjer\n",
"\n",
"* $P(\\mathcal{C}_1) = P(\\mathcal{C}_2)=0.3$, $P(\\mathcal{C}_3)=0.4$\n",
"* Za neki primjer $\\mathbf{x}$ imamo: $p(\\mathbf{x}|\\mathcal{C}_1)=0.9$, $p(\\mathbf{x}|\\mathcal{C}_2)=p(\\mathbf{x}|\\mathcal{C}_3)=0.4$\n",
"* U koju klasu klasificiramo $\\mathbf{x}$?\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Minimizacija pogreške klasifikacije*\n",
"\n",
"* Pretpostavimo da primjeri u stvarnosti dolaze iz dva područja: \n",
" * $\\mathcal{R}_1=\\{\\mathbf{x}\\in\\mathcal{X}\\mid h_1(\\mathbf{x})=1\\}$\n",
" * $\\mathcal{R}_2=\\mathcal{X}\\setminus\\mathcal{R}_1$\n",
"\n",
"* Vjerojatnost pogrešne klasifikacije:\n",
"\n",
"\\begin{align*}\n",
"P(\\mathbf{x}\\in\\mathcal{R}_1,\\mathcal{C}_2) &+ P(\\mathcal{x}\\in\\mathcal{R}_2,\\mathcal{C}_1)\\\\ \n",
"\\int_{\\mathbf{x}\\in\\mathcal{R}_1} p(\\mathbf{x},\\mathcal{C}_2)\\,\\mathrm{d}\\mathbf{x} &+ \n",
"\\int_{\\mathbf{x}\\in\\mathcal{R}_2} p(\\mathbf{x},\\mathcal{C}_1)\\,\\mathrm{d}\\mathbf{x}\n",
"\\end{align*}\n",
"\n",
"\n",
"* [Skica]\n",
"\n",
"\n",
"* Pogreška je minimizirana kada $\\mathcal{C}_j = \\mathrm{argmax}_{\\mathcal{C}\\in\\{\\mathcal{C_1},\\mathcal{C_2}\\}} P(\\mathbf{x},\\mathcal{C}_j) $\n",
"\n",
"\n",
"### Alternativa: Minimizacija rizika*\n",
"\n",
"* $L_{kj}$ - gubitak uslijed pogrešne klasifikacije primjera iz klase $\\mathcal{C}_k$ u klasu $\\mathcal{C}_j$\n",
"\n",
"\n",
"* Očekivani gubitak (funkcija rizika):\n",
" \n",
"$$\n",
"\\mathbb{E}[L] = \\sum_{k=1}^K\\sum_{j=1}^K \\int_{\\mathbf{x}\\in\\mathcal{R}_j}\n",
"L_{kj}\\,p(\\mathbf{x},\\mathcal{C}_k)\\,\\mathrm{d}\\mathbf{x}\n",
"$$\n",
"\n",
"\n",
"* Očekivani rizik pri klasifikaciji $\\mathbf{x}$ u $\\mathcal{C}_j$:\n",
"\n",
"$$\n",
"R(\\mathcal{C}_j|\\mathbf{x}) = \\sum_{k=1}^K L_{kj}P(\\mathcal{C}_k|\\mathbf{x})\n",
"$$\n",
"\n",
"\n",
"* Optimalna klasifikacijska odluka:\n",
"$$\n",
"h(\\mathbf{x}) = \\mathrm{argmin}_{\\mathcal{C}_k} R(\\mathcal{C}_k|\\mathbf{x})\n",
"$$\n",
"\n",
"### Primjer\n",
"\n",
"* $P(\\mathcal{C}_1|\\mathbf{x}) = 0.25$, $P(\\mathcal{C}_2|\\mathbf{x}) = 0.6$, $P(\\mathcal{C}_3|\\mathbf{x}) =\n",
"0.15$\n",
"\n",
"$$\n",
"L = {\\small\n",
"\\begin{pmatrix}\n",
"0 & 1 & 5 \\\\\n",
"1 & 0 & 5 \\\\\n",
"10 & 100 & 0\n",
"\\end{pmatrix}}\n",
"$$\n",
"\n",
"\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Naivan Bayesov klasifikator\n",
"\n",
"\n",
"* $\\mathcal{D}=\\{(\\mathbf{x}^{(i)},y^{(i)})\\}_{i=1}^N$\n",
"* $y^{(i)}\\in\\{\\mathcal{C}_1,\\dots,\\mathcal{C}_K\\}$\n",
"\n",
"\n",
"* Model:\n",
"\\begin{align*}\n",
" P(\\mathcal{C}_j|x_1,\\dots,x_n)\\ &\\propto\\ P(x_1,\\dots,x_n|\\mathcal{C}_j)P(\\mathcal{C}_j)\\\\\n",
" h(\\mathbf{x}=x_1,\\dots,x_n) &= \\mathrm{argmax}_{j}\\ P(\\mathbf{x}=x_1,\\dots,x_n|y=\\mathcal{C}_j)P(y = \\mathcal{C}_j)\n",
"\\end{align*}\n",
"\n",
"\n",
"* ML-procjena za $P(y)$ (kategorička razdioba):\n",
"\n",
"$$\n",
"\\hat{P}(\\mathcal{C}_j)=\\frac{1}{N}\\sum_{i=1}^N\\mathbf{1}\\{y^{(i)}=\\mathcal{C}_j\\} = \\frac{N_j}{N}\n",
"$$\n",
"\n",
"\n",
"* Q: Broj parametara za $\\hat{P}(\\mathcal{C}_j)$, $j=1,\\dots,K$ ?\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* Procjena parametara za $P(x_1,\\dots,x_n|\\mathcal{C}_j)$?\n",
"\n",
"\n",
"* Tretirati $\\mathbf{x} = (x_1,\\dots,x_n)$ kao kategoričku varijablu (njezine vrijednosti su sve kombinacije vrijednosti $x_i$) ?\n",
" * Broj parametara?\n",
" * Generalizacija?\n",
" \n",
" \n",
"* Pravilo lanca (uz uvjetnu varijablu $\\mathcal{C}_j$):\n",
"\n",
"\\begin{equation*}\n",
"P(x_1,\\dots,x_n|\\mathcal{C}_j)\n",
"= \\prod_{k=1}^n P(x_k|x_1,\\dots,x_{k-1},\\mathcal{C}_j)\n",
"\\end{equation*}\n",
"\n",
"* Pretpostavka: $\\color{red}{x_i\\bot x_k|\\mathcal{C}_j\\ (i\\neq k)} \\ \\Leftrightarrow \\ \\color{red}{P(x_i|x_k,\\mathcal{C}_j) = P(x_i|\\mathcal{C}_j)}$\n",
"\n",
"\\begin{equation*}\n",
"P(x_1,\\dots,x_n|\\mathcal{C}_j) = \n",
"\\prod_{k=1}^n P(x_k|x_1,\\dots,x_{k-1},\\mathcal{C}_j) =\n",
"\\prod_{k=1}^n P(x_k|\\mathcal{C}_j)\n",
"\\end{equation*}\n",
"\n",
"* Naivan Bayesov klasifikator:\n",
"$$\n",
"h(x_1,\\dots,x_n) = \\mathrm{argmax}_j\\ P(\\mathcal{C}_j)\\prod_{k=1}^n P(x_k|\\mathcal{C}_j)\n",
"$$\n",
"\n",
"* ML-procjena:\n",
"$$\n",
"\\hat{P}(x_k|\\mathcal{C}_j)=\\frac{\\sum_{i=1}^N\\mathbf{1}\\big\\{x^{(i)}_k=x_k \\land y^{(i)}=\\mathcal{C}_j\\big\\}}\n",
"{\\sum_{i=1}^N \\mathbf{1}\\{y^{(i)} = \\mathcal{C}_j\\}}\n",
"= \\frac{N_{kj}}{N_j}\n",
"$$\n",
"\n",
"* Laplaceov procjenitelj:\n",
"$$\n",
"\\hat{P}(x_k|\\mathcal{C}_j)=\\frac{\\sum_{i=1}^N\\mathbf{1}\\big\\{x^{(i)}_k=x_k \\land y^{(i)}=\\mathcal{C}_j\\big\\} + \\lambda}\n",
"{\\sum_{i=1}^N \\mathbf{1}\\{y^{(i)} = \\mathcal{C}_j\\} + \\lambda K_k}\n",
"= \\frac{N_{kj}+\\lambda}{N_j+\\lambda K_k}\n",
"$$\n",
"\n",
"\n",
"* Broj parametara: $\\sum_{k=1}^n(K_k-1)K$\n",
"\n",
"\n",
"* Binarne značajke: $nK$\n",
"\n",
"\n",
"### Uvjetna nezavisnost?\n",
"\n",
"\n",
"* Vrijedi li općenito nezavisnost $x_i\\bot x_k|\\mathcal{C}_j\\ (i\\neq k)$?\n",
"\n",
"* Primjer: Klasifikacija teksta\n",
" * Kategorija $\\mathcal{C} = \\text{Sport}$\n",
" * $D$: tekstni dokument\n",
" * Značajke: $x_1=\\mathbf{1}\\{\\text{Zagreb}\\in D\\}$, $x_2 = \\mathbf{1}\\{\\text{lopta}\\in D\\}$, $x_3=\\mathbf{1}\\{\\text{gol}\\in D\\}$\n",
" * Q: $x_1 \\bot x_2 | \\mathcal{C}$ ?\n",
" * Q: $x_2 \\bot x_3 | \\mathcal{C}$ ?\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Primjer: Dobar SF-film\n",
"\n",
"$$\n",
"\\begin{array}{r c c c c c } \n",
"\\hline \n",
"& x_1 & x_2 & x_3 & x_4 & y\\\\\n",
"i & \\text{Mjesto radnje} & \\text{Glavni lik} & \\text{Vrijeme radnje} & \\text{Vanzemaljci} & \\text{Dobar film}\\\\ \n",
"\\hline \n",
"1 & \\text{svemir} & \\text{znanstvenica} & \\text{sadašnjost} & \\text{da} & \\text{ne} \\\\ \n",
"2 & \\text{Zemlja} & \\text{kriminalac} & \\text{budućnost} & \\text{ne} & \\text{ne} \\\\ \n",
"3 & \\text{drugdje} & \\text{dijete} & \\text{prošlost} & \\text{da} & \\text{ne} \\\\ \n",
"4 & \\text{svemir} & \\text{znanstvenica} & \\text{sadašnjost} & \\text{ne} & \\text{da} \\\\ \n",
"5 & \\text{svemir} & \\text{kriminalac} & \\text{prošlost} & \\text{ne} & \\text{ne} \\\\ \n",
"6 & \\text{Zemlja} & \\text{dijete} & \\text{prošlost} & \\text{da} & \\text{da} \\\\ \n",
"7 & \\text{Zemlja} & \\text{policajac} & \\text{budućnost} & \\text{da} & \\text{ne} \\\\ \n",
"8 & \\text{svemir} & \\text{policajac} & \\text{budućnost} & \\text{ne} & \\text{da} \\\\ \n",
"\\hline \\end{array}\n",
"$$\n",
"\n",
"* Q: Koja je klasifikacija novog primjera $\\mathbf{x} = (\\text{svemir}, \\text{dijete}, \\text{sadašnjost}, \\text{da})$ ?"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Primjer: 101 Questions"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"q101 = pd.read_csv(\"http://www.fer.unizg.hr/_download/repository/questions101-2014.csv\", comment='#')"
]
},
{
"cell_type": "code",
"execution_count": 38,
"metadata": {
"collapsed": false,
"scrolled": true
},
"outputs": [
{
"data": {
"text/html": [
"
\n", " | Q1 | \n", "Q2 | \n", "Q3 | \n", "Q4 | \n", "Q5 | \n", "Q6 | \n", "Q7 | \n", "Q8 | \n", "Q9 | \n", "Q10 | \n", "... | \n", "Q92 | \n", "Q93 | \n", "Q94 | \n", "Q95 | \n", "Q96 | \n", "Q97 | \n", "Q98 | \n", "Q99 | \n", "Q100 | \n", "Q101 | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "More | \n", "Zagreb | \n", "Sok | \n", "Psi | \n", "Europa | \n", "Televizija | \n", "Messi | \n", "Gibonni | \n", "FER | \n", "Friends | \n", "... | \n", "Elektronska glazba | \n", "Virus | \n", "Kuba | \n", "Smartphone | \n", "Finska | \n", "Tenisice | \n", "Gospodar prstenova | \n", "Čokolada | \n", "Burek s mesom | \n", "Batman | \n", "
1 | \n", "More | \n", "Zagreb | \n", "Voda | \n", "Psi | \n", "Europa | \n", "Televizija | \n", "Messi | \n", "Gibonni | \n", "FER | \n", "Big Bang Theory | \n", "... | \n", "Rock | \n", "Virus | \n", "USA | \n", "Smartphone | \n", "Italija | \n", "Tenisice | \n", "Gospodar prstenova | \n", "Čokolada | \n", "Burek s mesom | \n", "Batman | \n", "
2 | \n", "More | \n", "Zagreb | \n", "Voda | \n", "Psi | \n", "Europa | \n", "Televizija | \n", "Messi | \n", "Gibonni | \n", "FER | \n", "Friends | \n", "... | \n", "Rock | \n", "Virus | \n", "USA | \n", "Smartphone | \n", "Italija | \n", "Tenisice | \n", "Gospodar prstenova | \n", "Vanilija | \n", "Burek s mesom | \n", "Batman | \n", "
3 | \n", "More | \n", "Split | \n", "Voda | \n", "Psi | \n", "Europa | \n", "Televizija | \n", "Ronaldo | \n", "Oliver | \n", "FER | \n", "Friends | \n", "... | \n", "Elektronska glazba | \n", "Bakterija | \n", "USA | \n", "Smartphone | \n", "Finska | \n", "Tenisice | \n", "Harry Potter | \n", "Čokolada | \n", "Burek s mesom | \n", "Batman | \n", "
4 | \n", "More | \n", "Zagreb | \n", "Voda | \n", "Psi | \n", "Europa | \n", "Televizija | \n", "Ronaldo | \n", "Oliver | \n", "FER | \n", "Friends | \n", "... | \n", "Rock | \n", "Virus | \n", "Kuba | \n", "Smartphone | \n", "Italija | \n", "Cipele | \n", "Gospodar prstenova | \n", "Čokolada | \n", "Burek s mesom | \n", "Batman | \n", "
5 | \n", "More | \n", "Zagreb | \n", "Sok | \n", "Psi | \n", "USA | \n", "Televizija | \n", "Ronaldo | \n", "Gibonni | \n", "FER | \n", "Friends | \n", "... | \n", "Rock | \n", "Bakterija | \n", "USA | \n", "Smartphone | \n", "Italija | \n", "Tenisice | \n", "Harry Potter | \n", "Vanilija | \n", "Burek sa sirom | \n", "Superman | \n", "
6 | \n", "More | \n", "Zagreb | \n", "Voda | \n", "Psi | \n", "Europa | \n", "Televizija | \n", "Ronaldo | \n", "Gibonni | \n", "FER | \n", "Friends | \n", "... | \n", "Rock | \n", "Virus | \n", "Kuba | \n", "Smartphone | \n", "Finska | \n", "Tenisice | \n", "Gospodar prstenova | \n", "Vanilija | \n", "Burek s mesom | \n", "Superman | \n", "
7 | \n", "More | \n", "Zagreb | \n", "Voda | \n", "Psi | \n", "Europa | \n", "Televizija | \n", "Messi | \n", "Oliver | \n", "FER | \n", "Big Bang Theory | \n", "... | \n", "Rock | \n", "Bakterija | \n", "Kuba | \n", "Obični mobitel | \n", "Finska | \n", "Tenisice | \n", "Gospodar prstenova | \n", "Čokolada | \n", "Burek sa sirom | \n", "Superman | \n", "
8 | \n", "Planina | \n", "Zagreb | \n", "Voda | \n", "Psi | \n", "Europa | \n", "Televizija | \n", "Ronaldo | \n", "Oliver | \n", "FER | \n", "Big Bang Theory | \n", "... | \n", "Rock | \n", "Virus | \n", "Kuba | \n", "Smartphone | \n", "Finska | \n", "Tenisice | \n", "Gospodar prstenova | \n", "Čokolada | \n", "Burek s mesom | \n", "Superman | \n", "
9 | \n", "More | \n", "Zagreb | \n", "Sok | \n", "Psi | \n", "Europa | \n", "Televizija | \n", "Ronaldo | \n", "Gibonni | \n", "FER | \n", "Friends | \n", "... | \n", "Elektronska glazba | \n", "Virus | \n", "Kuba | \n", "Smartphone | \n", "Finska | \n", "Tenisice | \n", "Gospodar prstenova | \n", "Čokolada | \n", "Burek s mesom | \n", "Batman | \n", "
10 | \n", "More | \n", "Zagreb | \n", "Voda | \n", "Psi | \n", "Europa | \n", "Televizija | \n", "Messi | \n", "Gibonni | \n", "FER | \n", "Big Bang Theory | \n", "... | \n", "Rock | \n", "Virus | \n", "USA | \n", "Smartphone | \n", "Finska | \n", "Tenisice | \n", "Harry Potter | \n", "Čokolada | \n", "Burek s mesom | \n", "Superman | \n", "
11 | \n", "More | \n", "Zagreb | \n", "Voda | \n", "Psi | \n", "Europa | \n", "Televizija | \n", "Ronaldo | \n", "Gibonni | \n", "FER | \n", "Friends | \n", "... | \n", "Rock | \n", "Bakterija | \n", "USA | \n", "Obični mobitel | \n", "Finska | \n", "Tenisice | \n", "Harry Potter | \n", "Čokolada | \n", "Burek s mesom | \n", "Batman | \n", "
12 | \n", "More | \n", "Zagreb | \n", "Voda | \n", "Mačke | \n", "USA | \n", "Televizija | \n", "Ronaldo | \n", "Gibonni | \n", "FER | \n", "Big Bang Theory | \n", "... | \n", "Rock | \n", "Virus | \n", "USA | \n", "Smartphone | \n", "Finska | \n", "Tenisice | \n", "Gospodar prstenova | \n", "Čokolada | \n", "Burek sa sirom | \n", "Batman | \n", "
13 | \n", "More | \n", "Zagreb | \n", "Voda | \n", "Psi | \n", "Europa | \n", "Radio | \n", "Ronaldo | \n", "Oliver | \n", "FER | \n", "Friends | \n", "... | \n", "Elektronska glazba | \n", "Virus | \n", "USA | \n", "Smartphone | \n", "Italija | \n", "Tenisice | \n", "Gospodar prstenova | \n", "Vanilija | \n", "Burek sa sirom | \n", "Batman | \n", "
14 | \n", "More | \n", "Zagreb | \n", "Voda | \n", "Psi | \n", "USA | \n", "Televizija | \n", "Messi | \n", "Gibonni | \n", "FER | \n", "Big Bang Theory | \n", "... | \n", "Rock | \n", "Virus | \n", "Kuba | \n", "Smartphone | \n", "Finska | \n", "Tenisice | \n", "Harry Potter | \n", "Čokolada | \n", "Burek s mesom | \n", "Batman | \n", "
15 | \n", "More | \n", "Zagreb | \n", "Voda | \n", "Psi | \n", "Europa | \n", "Radio | \n", "Messi | \n", "Gibonni | \n", "FER | \n", "Friends | \n", "... | \n", "Rock | \n", "Bakterija | \n", "USA | \n", "Smartphone | \n", "Finska | \n", "Cipele | \n", "Gospodar prstenova | \n", "Čokolada | \n", "Burek s mesom | \n", "Batman | \n", "
16 | \n", "Planina | \n", "Zagreb | \n", "Voda | \n", "Mačke | \n", "Europa | \n", "Televizija | \n", "Messi | \n", "Oliver | \n", "FER | \n", "Friends | \n", "... | \n", "Rock | \n", "Bakterija | \n", "Kuba | \n", "Obični mobitel | \n", "Finska | \n", "Tenisice | \n", "Gospodar prstenova | \n", "Vanilija | \n", "Burek s mesom | \n", "Batman | \n", "
17 | \n", "More | \n", "Zagreb | \n", "Sok | \n", "Psi | \n", "Europa | \n", "Televizija | \n", "Messi | \n", "Oliver | \n", "FER | \n", "Friends | \n", "... | \n", "Rock | \n", "Virus | \n", "USA | \n", "Smartphone | \n", "Finska | \n", "Tenisice | \n", "Harry Potter | \n", "Vanilija | \n", "Burek sa sirom | \n", "Batman | \n", "
18 | \n", "More | \n", "Zagreb | \n", "Voda | \n", "Psi | \n", "Europa | \n", "Radio | \n", "Messi | \n", "Gibonni | \n", "FER | \n", "Big Bang Theory | \n", "... | \n", "Rock | \n", "Bakterija | \n", "USA | \n", "Smartphone | \n", "Finska | \n", "Tenisice | \n", "Harry Potter | \n", "Čokolada | \n", "Burek sa sirom | \n", "Batman | \n", "
19 | \n", "More | \n", "Zagreb | \n", "Sok | \n", "Psi | \n", "Europa | \n", "Televizija | \n", "Messi | \n", "Oliver | \n", "FER | \n", "Friends | \n", "... | \n", "Elektronska glazba | \n", "Bakterija | \n", "USA | \n", "Smartphone | \n", "Finska | \n", "Tenisice | \n", "Gospodar prstenova | \n", "Čokolada | \n", "Burek s mesom | \n", "Batman | \n", "
20 rows × 101 columns
\n", "\n", " | Q7 | \n", "Q101 | \n", "Q97 | \n", "Q4 | \n", "
---|---|---|---|---|
0 | \n", "Messi | \n", "Batman | \n", "Tenisice | \n", "Psi | \n", "
1 | \n", "Messi | \n", "Batman | \n", "Tenisice | \n", "Psi | \n", "
2 | \n", "Messi | \n", "Batman | \n", "Tenisice | \n", "Psi | \n", "
3 | \n", "Ronaldo | \n", "Batman | \n", "Tenisice | \n", "Psi | \n", "
4 | \n", "Ronaldo | \n", "Batman | \n", "Cipele | \n", "Psi | \n", "
5 | \n", "Ronaldo | \n", "Superman | \n", "Tenisice | \n", "Psi | \n", "
6 | \n", "Ronaldo | \n", "Superman | \n", "Tenisice | \n", "Psi | \n", "
7 | \n", "Messi | \n", "Superman | \n", "Tenisice | \n", "Psi | \n", "
8 | \n", "Ronaldo | \n", "Superman | \n", "Tenisice | \n", "Psi | \n", "
9 | \n", "Ronaldo | \n", "Batman | \n", "Tenisice | \n", "Psi | \n", "
10 | \n", "Messi | \n", "Superman | \n", "Tenisice | \n", "Psi | \n", "
11 | \n", "Ronaldo | \n", "Batman | \n", "Tenisice | \n", "Psi | \n", "
12 | \n", "Ronaldo | \n", "Batman | \n", "Tenisice | \n", "Mačke | \n", "
13 | \n", "Ronaldo | \n", "Batman | \n", "Tenisice | \n", "Psi | \n", "
14 | \n", "Messi | \n", "Batman | \n", "Tenisice | \n", "Psi | \n", "
15 | \n", "Messi | \n", "Batman | \n", "Cipele | \n", "Psi | \n", "
16 | \n", "Messi | \n", "Batman | \n", "Tenisice | \n", "Mačke | \n", "
17 | \n", "Messi | \n", "Batman | \n", "Tenisice | \n", "Psi | \n", "
18 | \n", "Messi | \n", "Batman | \n", "Tenisice | \n", "Psi | \n", "
19 | \n", "Messi | \n", "Batman | \n", "Tenisice | \n", "Psi | \n", "