Skip to content

Commit

Permalink
Word Relatedness: change the order of the knn functions to match the …
Browse files Browse the repository at this point in the history
…implementation order
  • Loading branch information
SebastianHurubaru committed Jan 5, 2023
1 parent 20539ec commit 451efb9
Showing 1 changed file with 23 additions and 18 deletions.
41 changes: 23 additions & 18 deletions hw_wordrelatedness.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,21 @@
"from sklearn.model_selection import train_test_split\n",
"from sklearn.neighbors import KNeighborsRegressor\n",
"\n",
"\n",
"def knn_represent(word1, word2, vsm_df):\n",
" pass\n",
" # Use `vsm_df` to get vectors for `word1` and `word2`\n",
" # and concatenate them into a single vector:\n",
" ##### YOUR CODE HERE\n",
"\n",
"\n",
"def knn_feature_matrix(vsm_df, rel_df):\n",
" pass\n",
" # Complete `knn_represent` and use it to create a feature\n",
" # matrix `np.array`:\n",
" ##### YOUR CODE HERE\n",
" \n",
"\n",
"def run_knn_score_model(vsm_df, dev_df, test_size=0.20):\n",
" pass\n",
"\n",
Expand All @@ -830,22 +845,7 @@
"\n",
" # Return the value of `score` for your model on the test split\n",
" # you created above:\n",
" ##### YOUR CODE HERE\n",
"\n",
"\n",
"def knn_feature_matrix(vsm_df, rel_df):\n",
" pass\n",
" # Complete `knn_represent` and use it to create a feature\n",
" # matrix `np.array`:\n",
" ##### YOUR CODE HERE\n",
"\n",
"\n",
"def knn_represent(word1, word2, vsm_df):\n",
" pass\n",
" # Use `vsm_df` to get vectors for `word1` and `word2`\n",
" # and concatenate them into a single vector:\n",
" ##### YOUR CODE HERE\n",
"\n"
" ##### YOUR CODE HERE\n"
]
},
{
Expand Down Expand Up @@ -1023,7 +1023,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "nlu",
"language": "python",
"name": "python3"
},
Expand All @@ -1037,7 +1037,12 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
"version": "3.9.12 (main, Apr 5 2022, 01:53:17) \n[Clang 12.0.0 ]"
},
"vscode": {
"interpreter": {
"hash": "81ef301a63437b26d6f879bc64646dce7fed7674109198cc71f09ca02787000d"
}
},
"widgets": {
"state": {},
Expand Down

0 comments on commit 451efb9

Please sign in to comment.