Merge pull request '3rd meeting' (#3) from 3rd_meeting into master
Reviewed-on: #3
This commit is contained in:
commit
2139ec70a4
@ -9,12 +9,12 @@
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"['dimensions: 1, cases when observation is the nearest: 0.0%',\n",
|
||||
" 'dimensions: 2, cases when observation is the nearest: 0.0%',\n",
|
||||
" 'dimensions: 3, cases when observation is the nearest: 0.0%',\n",
|
||||
" 'dimensions: 10, cases when observation is the nearest: 13.0%',\n",
|
||||
" 'dimensions: 20, cases when observation is the nearest: 61.0%',\n",
|
||||
" 'dimensions: 30, cases when observation is the nearest: 96.0%',\n",
|
||||
" 'dimensions: 40, cases when observation is the nearest: 98.0%',\n",
|
||||
" 'dimensions: 2, cases when observation is the nearest: 1.0%',\n",
|
||||
" 'dimensions: 3, cases when observation is the nearest: 1.0%',\n",
|
||||
" 'dimensions: 10, cases when observation is the nearest: 8.0%',\n",
|
||||
" 'dimensions: 20, cases when observation is the nearest: 68.0%',\n",
|
||||
" 'dimensions: 30, cases when observation is the nearest: 93.0%',\n",
|
||||
" 'dimensions: 40, cases when observation is the nearest: 100.0%',\n",
|
||||
" 'dimensions: 50, cases when observation is the nearest: 100.0%',\n",
|
||||
" 'dimensions: 60, cases when observation is the nearest: 100.0%',\n",
|
||||
" 'dimensions: 70, cases when observation is the nearest: 100.0%',\n",
|
||||
@ -46,15 +46,15 @@
|
||||
" i1, i2 = random.sample(range(nb_vectors), 2)\n",
|
||||
" target = (vectors[i1] + vectors[i2]) / 2\n",
|
||||
"\n",
|
||||
" distances = pd.DataFrame(\n",
|
||||
" similarities = pd.DataFrame(\n",
|
||||
" enumerate(\n",
|
||||
" np.dot(target, vectors.transpose())\n",
|
||||
" / norm(target)\n",
|
||||
" / norm(vectors.transpose(), axis=0)\n",
|
||||
" )\n",
|
||||
" )\n",
|
||||
" distances = distances.sort_values(by=[1], ascending=False)\n",
|
||||
" if (i1 in (list(distances[0][:k]))) | (i2 in (list(distances[0][:k]))):\n",
|
||||
" similarities = similarities.sort_values(by=[1], ascending=False)\n",
|
||||
" if (i1 in (list(similarities[0][:k]))) | (i2 in (list(similarities[0][:k]))):\n",
|
||||
" successes += 1\n",
|
||||
" result.append(successes / trials)\n",
|
||||
"\n",
|
||||
@ -63,13 +63,6 @@
|
||||
" for i, j in zip(dimensions, result)\n",
|
||||
"]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
|
File diff suppressed because one or more lines are too long
BIN
P5. Graph-based models.pdf
Normal file
BIN
P5. Graph-based models.pdf
Normal file
Binary file not shown.
1431
P5. Graph-based.ipynb
Normal file
1431
P5. Graph-based.ipynb
Normal file
File diff suppressed because one or more lines are too long
1711
P6. WRMF (Implicit ALS).ipynb
Normal file
1711
P6. WRMF (Implicit ALS).ipynb
Normal file
File diff suppressed because one or more lines are too long
BIN
P6. WRMF (Implicit_ALS).pdf
Normal file
BIN
P6. WRMF (Implicit_ALS).pdf
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user