<jupyter_start><jupyter_text>Predict<jupyter_code>def predict(userId: int, movieId: int):
    userInput = torch.tensor([userIdx[userId]]).cuda().clone().detach()
    movieInput = torch.tensor([movieIdx[movieId]]).cuda().clone().detach()
    return embeddingDotBias.forward(userInput, movieInput).item()
predict(73, 1097)
predict(561, 924)
for index, row in ratings[:100].iterrows():
    print(predict(int(row['userId']), int(row['movieId'])), row['rating'])<jupyter_output>3.838888645172119 4.0
3.2899436950683594 3.5
2.838738441467285 3.5
4.705658912658691 5.0
2.3013768196105957 2.0
3.730295181274414 4.0
4.646974563598633 5.0
2.690315008163452 3.0
4.1812920570373535 4.5
3.790100336074829 4.5
2.8735952377319336 3.0
3.5290980339050293 3.0
2.928689479827881 3.0
3.100550651550293 3.0
3.948193073272705 4.0
4.284323692321777 5.0
3.9360194206237793 4.5
1.9483803510665894 2.5
4.218658447265625 5.0
4.161929130554199 4.0
4.089113235473633 4.5
4.821419715881348 5.0
2.5397820472717285 3.0
4.918349266052246 5.0
3.912986993789673 4.5
2.878478527069092 3.0
3.8700222969055176 4.5
3.651827812194824 3.5
0.6894132494926453 1.0
1.3104835748672485 1.0
5.028079509735107 5.0
4.1239848136901855 4.0
4.386385917663574 5.0
3.8329362869262695 3.0
2.9416356086730957 3.5
3.307978391647339 4.0
3.5512702465057373 3.0
4.625848770141602 5.0
4.148618221282959 4.0
3.195012331008911 4.5
4.5724287033081055 5.0
3.288559913635254 3.0
4.352843284606934 4.0
4.712601184844971 5.0
3.43427228927612[...]
{'fraction_non_alphanumeric': 0.12516914749661706, 'fraction_numerical': 0.5669824086603519, 'mean_word_length': 5.347639484978541, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '51137', 'license': 'Apache-2.0', 'n_tokens_mistral': 1181, 'n_tokens_neox': 737, 'n_words': 112, 'path': 'nbs_gil/Collab-From-Scratch.ipynb', 'repo_name': 'gilfernandes/fastai-exercises', 'size': '1478'}