Skip to content

Commit

Permalink
fix tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
leliel12 committed Feb 24, 2016
1 parent c15c7fa commit a52623e
Showing 1 changed file with 32 additions and 36 deletions.
68 changes: 32 additions & 36 deletions notebooks/electre_1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"metadata": {
"collapsed": false
},
Expand Down Expand Up @@ -113,7 +113,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"metadata": {
"collapsed": false
},
Expand Down Expand Up @@ -166,7 +166,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"metadata": {
"collapsed": false
},
Expand Down Expand Up @@ -201,15 +201,16 @@
"source": [
"### Part 2: Exploitation\n",
"\n",
"```python\n",
"if C(a, b) > q and D(a, b) < q:\n",
" a outranks b\n",
"```"
"We need to dertermine by row and by column if **a S b** where **S** mean **dominance** and\n",
"\n",
"$$aSb = C(a, b) \\succ p \\land D(a, b) \\prec q$$\n",
"\n",
"#### By Row"
]
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 5,
"metadata": {
"collapsed": false
},
Expand All @@ -221,47 +222,51 @@
"Outrank:\n",
" [[False False False False False False]\n",
" [False False False False False False]\n",
" [ True False False False False False]\n",
" [False False False False False False]\n",
" [ True False False False False False]\n",
" [ True True True True False True]\n",
" [ True False False True False False]]\n",
"Resume:\n",
" [0 0 1 1 5 2]\n"
" [False False False False False False]]\n",
"Resume By Row:\n",
" [0 0 0 1 5 0]\n",
"Resume By Column:\n",
" [2 1 1 1 0 1]\n"
]
}
],
"source": [
"print(\"Outrank:\\n\", outrank)\n",
"print(\"Resume:\\n\", np.sum(outrank, axis=1))"
"print(\"Resume By Row:\\n\", np.sum(outrank, axis=1))\n",
"print(\"Resume By Column:\\n\", np.sum(outrank, axis=0))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Then the kernel is the alternatives that surpass all the another"
"Then we need to make the **difference aSb - bSa** and the alternative with the biggest positive difference are the kernel"
]
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 9,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"array([4])"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
"name": "stdout",
"output_type": "stream",
"text": [
"Difference:\n",
" [-2 -1 -1 0 5 -1]\n",
"Kernel:\n",
" [4]\n"
]
}
],
"source": [
"kernel"
"print(\"Difference:\\n\", np.sum(outrank, axis=1) - np.sum(outrank, axis=0))\n",
"print(\"Kernel:\\n\", kernel)"
]
},
{
Expand All @@ -275,7 +280,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 7,
"metadata": {
"collapsed": false
},
Expand All @@ -284,8 +289,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 11 s, sys: 4.29 s, total: 15.3 s\n",
"Wall time: 15.2 s\n"
"CPU times: user 11.1 s, sys: 1.19 s, total: 12.3 s\n",
"Wall time: 12.3 s\n"
]
}
],
Expand All @@ -307,15 +312,6 @@
"- Roy, B. (1968). Classement et choix en présence de points de vue multiples. Revue française d'automatique, d'informatique et de recherche opérationnelle. Recherche opérationnelle, 2(1), 57-75.\n",
"- Cebrián, L. I. G., & Porcar, A. M. (2009). Localización empresarial en Aragón: Una aplicación empírica de la ayuda a la decisión multicriterio tipo ELECTRE I y III. Robustez de los resultados obtenidos. Revista de Métodos Cuantitativos para la Economía y la Empresa, (7), 31-56."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down

0 comments on commit a52623e

Please sign in to comment.