Skip to content

Commit

Permalink
Fixes style issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
rlratzel committed Feb 4, 2025
1 parent ae4f299 commit 4f573f2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions notebooks/demo/nx_cugraph_jaccard_movie_recommender.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
" \"timestamp\": \"int32\",\n",
" }\n",
" )\n",
"ratings_df['userId'][0]\n",
"ratings_df[\"userId\"][0]\n",
"# Not using timestamp\n",
"ratings_df.drop(columns=\"timestamp\", inplace=True)\n",
"\n",
Expand Down Expand Up @@ -361,7 +361,7 @@
],
"source": [
"%%time\n",
"# Run Jaccard Similarity \n",
"# Run Jaccard Similarity\n",
"jacc_coeffs = list(nx.jaccard_coefficient(good_user_movie_G, ebunch))"
]
},
Expand Down Expand Up @@ -392,7 +392,7 @@
],
"source": [
"%%time\n",
"# Run Jaccard Similarity \n",
"# Run Jaccard Similarity\n",
"jacc_coeffs = list(nx.jaccard_coefficient(good_user_movie_G, ebunch, backend=\"networkx\"))"
]
},
Expand Down Expand Up @@ -420,7 +420,7 @@
],
"source": [
"# Sort by coefficient value, which is the 3rd item in the tuples\n",
"jacc_coeffs.sort(key=lambda t: t[2], reverse=True) \n",
"jacc_coeffs.sort(key=lambda t: t[2], reverse=True)\n",
"\n",
"# Create a list of recommendations ordered by \"best\" to \"worst\" based on the\n",
"# Jaccard Similarity coefficients and the movies already seen\n",
Expand Down Expand Up @@ -669,15 +669,15 @@
"print(f\"CPU: {cpu_name}\")\n",
"if torch.cuda.is_available():\n",
" gpu_name = torch.cuda.get_device_name(0)\n",
" gpu_memory = torch.cuda.get_device_properties(0).total_memory / (1024 ** 3) \n",
" gpu_memory = torch.cuda.get_device_properties(0).total_memory / (1024 ** 3)\n",
" print(f\"GPU: {gpu_name}\")\n",
" print(f\"GPU Memory: {gpu_memory:.2f} GB\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "gnn",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand Down

0 comments on commit 4f573f2

Please sign in to comment.