{ "cells": [ { "cell_type": "code", "execution_count": 9, "id": "2aa1b034", "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import pickle" ] }, { "cell_type": "code", "execution_count": 10, "id": "6407f398", "metadata": {}, "outputs": [], "source": [ "users= pd.read_json('../dataset/users.json')" ] }, { "cell_type": "code", "execution_count": 11, "id": "940e1795", "metadata": {}, "outputs": [], "source": [ "events = pickle.load(open('../model/events.pkl', 'rb'))" ] }, { "cell_type": "code", "execution_count": 12, "id": "3f129665", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
user_idnameinterestsskillslearningGoalsroleslocation
068e0e01c6fbdb8a90b76129bJacob Jennings[Game Development, Blockchain, FinTech, Cloud ...[UI/UX, Node.js, Docker, Data Science, Finance][Win a hackathon, Contribute to open source, I...[student, host]Brianbury
168e0e01c6fbdb8a90b76129cMrs. Julie Martinez[Sports, Entrepreneurship, DevOps, Robotics, C...[Data Science, UI/UX, C++, Vue.js][Win a hackathon, Master AI][student]Lake Johnfort
268e0e01c6fbdb8a90b76129dMrs. Lynn Lambert[Robotics, DevOps, EdTech][Leadership, React][Improve DSA, Contribute to open source, Win a...[student]Kendraview
368e0e01c6fbdb8a90b76129eAllison Johnson[AI/ML, FinTech, DevOps, EdTech, Game Developm...[Data Science, C++, Leadership, Finance, Docke...[Improve DSA, Publish a paper, Win a hackathon...[student, verifier]Wallertown
468e0e01c6fbdb8a90b76129fThomas Davidson[Cultural, Blockchain, Sports, Hackathons, Gam...[Cloud, Node.js, Leadership, Python, C++, Fina...[Master AI, Get internship, Learn design][student, verifier]West Danielside
\n", "
" ], "text/plain": [ " user_id name \\\n", "0 68e0e01c6fbdb8a90b76129b Jacob Jennings \n", "1 68e0e01c6fbdb8a90b76129c Mrs. Julie Martinez \n", "2 68e0e01c6fbdb8a90b76129d Mrs. Lynn Lambert \n", "3 68e0e01c6fbdb8a90b76129e Allison Johnson \n", "4 68e0e01c6fbdb8a90b76129f Thomas Davidson \n", "\n", " interests \\\n", "0 [Game Development, Blockchain, FinTech, Cloud ... \n", "1 [Sports, Entrepreneurship, DevOps, Robotics, C... \n", "2 [Robotics, DevOps, EdTech] \n", "3 [AI/ML, FinTech, DevOps, EdTech, Game Developm... \n", "4 [Cultural, Blockchain, Sports, Hackathons, Gam... \n", "\n", " skills \\\n", "0 [UI/UX, Node.js, Docker, Data Science, Finance] \n", "1 [Data Science, UI/UX, C++, Vue.js] \n", "2 [Leadership, React] \n", "3 [Data Science, C++, Leadership, Finance, Docke... \n", "4 [Cloud, Node.js, Leadership, Python, C++, Fina... \n", "\n", " learningGoals roles \\\n", "0 [Win a hackathon, Contribute to open source, I... [student, host] \n", "1 [Win a hackathon, Master AI] [student] \n", "2 [Improve DSA, Contribute to open source, Win a... [student] \n", "3 [Improve DSA, Publish a paper, Win a hackathon... [student, verifier] \n", "4 [Master AI, Get internship, Learn design] [student, verifier] \n", "\n", " location \n", "0 Brianbury \n", "1 Lake Johnfort \n", "2 Kendraview \n", "3 Wallertown \n", "4 West Danielside " ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "users.head()" ] }, { "cell_type": "code", "execution_count": 13, "id": "5cb09d89", "metadata": {}, "outputs": [], "source": [ "# Combine user interests and skills for event history (no explored_history, liked_events, attended_events columns)\n", "users['events'] = users['interests'] + users['skills']" ] }, { "cell_type": "code", "execution_count": 14, "id": "c195102e", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
user_idnameinterestsskillslearningGoalsroleslocationevents
068e0e01c6fbdb8a90b76129bJacob Jennings[Game Development, Blockchain, FinTech, Cloud ...[UI/UX, Node.js, Docker, Data Science, Finance][Win a hackathon, Contribute to open source, I...[student, host]Brianbury[Game Development, Blockchain, FinTech, Cloud ...
\n", "
" ], "text/plain": [ " user_id name \\\n", "0 68e0e01c6fbdb8a90b76129b Jacob Jennings \n", "\n", " interests \\\n", "0 [Game Development, Blockchain, FinTech, Cloud ... \n", "\n", " skills \\\n", "0 [UI/UX, Node.js, Docker, Data Science, Finance] \n", "\n", " learningGoals roles \\\n", "0 [Win a hackathon, Contribute to open source, I... [student, host] \n", "\n", " location events \n", "0 Brianbury [Game Development, Blockchain, FinTech, Cloud ... " ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "users.head(1)" ] }, { "cell_type": "code", "execution_count": 15, "id": "77071797", "metadata": {}, "outputs": [], "source": [ "# Combine interests and skills for user profile\n", "users['key'] = users['interests'] + users['skills']" ] }, { "cell_type": "code", "execution_count": 16, "id": "a3989ab3", "metadata": {}, "outputs": [], "source": [ "users['key'] = users['key'].apply(lambda x: \" \".join(x))" ] }, { "cell_type": "code", "execution_count": 17, "id": "959a34bb", "metadata": {}, "outputs": [], "source": [ "users['key'] = users['key'] + \" \" + users['location']" ] }, { "cell_type": "code", "execution_count": 18, "id": "3a8a4751", "metadata": {}, "outputs": [], "source": [ "users = users[['user_id','name','key', 'events']]" ] }, { "cell_type": "code", "execution_count": 19, "id": "0fa7020e", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
user_idnamekeyevents
068e0e01c6fbdb8a90b76129bJacob JenningsGame Development Blockchain FinTech Cloud Comp...[Game Development, Blockchain, FinTech, Cloud ...
168e0e01c6fbdb8a90b76129cMrs. Julie MartinezSports Entrepreneurship DevOps Robotics Cultur...[Sports, Entrepreneurship, DevOps, Robotics, C...
268e0e01c6fbdb8a90b76129dMrs. Lynn LambertRobotics DevOps EdTech Leadership React Kendra...[Robotics, DevOps, EdTech, Leadership, React]
368e0e01c6fbdb8a90b76129eAllison JohnsonAI/ML FinTech DevOps EdTech Game Development D...[AI/ML, FinTech, DevOps, EdTech, Game Developm...
468e0e01c6fbdb8a90b76129fThomas DavidsonCultural Blockchain Sports Hackathons Game Dev...[Cultural, Blockchain, Sports, Hackathons, Gam...
...............
49568e0e01c6fbdb8a90b76148aJoshua MooreHackathons AI/ML Cloud Computing Robotics Entr...[Hackathons, AI/ML, Cloud Computing, Robotics,...
49668e0e01c6fbdb8a90b76148bKeith SandersEdTech DevOps Robotics Vue.js Data Science C++...[EdTech, DevOps, Robotics, Vue.js, Data Scienc...
49768e0e01c6fbdb8a90b76148cMorgan KelleyGame Development Robotics Blockchain Sports Cu...[Game Development, Robotics, Blockchain, Sport...
49868e0e01c6fbdb8a90b76148dNathaniel SanchezEdTech Sports Game Development DevOps Cloud Co...[EdTech, Sports, Game Development, DevOps, Clo...
49968e0e01c6fbdb8a90b76148eBlake WardSports Cloud Computing EdTech AI/ML Node.js Re...[Sports, Cloud Computing, EdTech, AI/ML, Node....
\n", "

500 rows × 4 columns

\n", "
" ], "text/plain": [ " user_id name \\\n", "0 68e0e01c6fbdb8a90b76129b Jacob Jennings \n", "1 68e0e01c6fbdb8a90b76129c Mrs. Julie Martinez \n", "2 68e0e01c6fbdb8a90b76129d Mrs. Lynn Lambert \n", "3 68e0e01c6fbdb8a90b76129e Allison Johnson \n", "4 68e0e01c6fbdb8a90b76129f Thomas Davidson \n", ".. ... ... \n", "495 68e0e01c6fbdb8a90b76148a Joshua Moore \n", "496 68e0e01c6fbdb8a90b76148b Keith Sanders \n", "497 68e0e01c6fbdb8a90b76148c Morgan Kelley \n", "498 68e0e01c6fbdb8a90b76148d Nathaniel Sanchez \n", "499 68e0e01c6fbdb8a90b76148e Blake Ward \n", "\n", " key \\\n", "0 Game Development Blockchain FinTech Cloud Comp... \n", "1 Sports Entrepreneurship DevOps Robotics Cultur... \n", "2 Robotics DevOps EdTech Leadership React Kendra... \n", "3 AI/ML FinTech DevOps EdTech Game Development D... \n", "4 Cultural Blockchain Sports Hackathons Game Dev... \n", ".. ... \n", "495 Hackathons AI/ML Cloud Computing Robotics Entr... \n", "496 EdTech DevOps Robotics Vue.js Data Science C++... \n", "497 Game Development Robotics Blockchain Sports Cu... \n", "498 EdTech Sports Game Development DevOps Cloud Co... \n", "499 Sports Cloud Computing EdTech AI/ML Node.js Re... \n", "\n", " events \n", "0 [Game Development, Blockchain, FinTech, Cloud ... \n", "1 [Sports, Entrepreneurship, DevOps, Robotics, C... \n", "2 [Robotics, DevOps, EdTech, Leadership, React] \n", "3 [AI/ML, FinTech, DevOps, EdTech, Game Developm... \n", "4 [Cultural, Blockchain, Sports, Hackathons, Gam... \n", ".. ... \n", "495 [Hackathons, AI/ML, Cloud Computing, Robotics,... \n", "496 [EdTech, DevOps, Robotics, Vue.js, Data Scienc... \n", "497 [Game Development, Robotics, Blockchain, Sport... \n", "498 [EdTech, Sports, Game Development, DevOps, Clo... \n", "499 [Sports, Cloud Computing, EdTech, AI/ML, Node.... \n", "\n", "[500 rows x 4 columns]" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "users" ] }, { "cell_type": "code", "execution_count": 20, "id": "7f39a684", "metadata": {}, "outputs": [], "source": [ "users_event=users[['user_id','events']]" ] }, { "cell_type": "code", "execution_count": 21, "id": "836ba8c7", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
user_idevents
068e0e01c6fbdb8a90b76129b[Game Development, Blockchain, FinTech, Cloud ...
\n", "
" ], "text/plain": [ " user_id events\n", "0 68e0e01c6fbdb8a90b76129b [Game Development, Blockchain, FinTech, Cloud ..." ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "users_event.head(1)" ] }, { "cell_type": "code", "execution_count": 22, "id": "8031a76c", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
event_idkey
068e0d68abee8a0e226e6fe96versatile homogeneous interface jaclynborough ...
168e0d68abee8a0e226e6fe97intuitive empowering orchestration new mariabe...
268e0d68abee8a0e226e6fe98reduced contentbased product port alexis stone...
368e0d68abee8a0e226e6fe99objectbased intermediate artificial intelligen...
468e0d68abee8a0e226e6fe9agrassroots global hub new chrisport fletcherje...
\n", "
" ], "text/plain": [ " event_id key\n", "0 68e0d68abee8a0e226e6fe96 versatile homogeneous interface jaclynborough ...\n", "1 68e0d68abee8a0e226e6fe97 intuitive empowering orchestration new mariabe...\n", "2 68e0d68abee8a0e226e6fe98 reduced contentbased product port alexis stone...\n", "3 68e0d68abee8a0e226e6fe99 objectbased intermediate artificial intelligen...\n", "4 68e0d68abee8a0e226e6fe9a grassroots global hub new chrisport fletcherje..." ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "events.head()" ] }, { "cell_type": "code", "execution_count": 23, "id": "be5e6731", "metadata": {}, "outputs": [], "source": [ "# No event history columns, so skip mapping event_ids to event_names" ] }, { "cell_type": "code", "execution_count": 24, "id": "7344bcf0", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
user_idnamekeyevents
068e0e01c6fbdb8a90b76129bJacob JenningsGame Development Blockchain FinTech Cloud Comp...[Game Development, Blockchain, FinTech, Cloud ...
168e0e01c6fbdb8a90b76129cMrs. Julie MartinezSports Entrepreneurship DevOps Robotics Cultur...[Sports, Entrepreneurship, DevOps, Robotics, C...
\n", "
" ], "text/plain": [ " user_id name \\\n", "0 68e0e01c6fbdb8a90b76129b Jacob Jennings \n", "1 68e0e01c6fbdb8a90b76129c Mrs. Julie Martinez \n", "\n", " key \\\n", "0 Game Development Blockchain FinTech Cloud Comp... \n", "1 Sports Entrepreneurship DevOps Robotics Cultur... \n", "\n", " events \n", "0 [Game Development, Blockchain, FinTech, Cloud ... \n", "1 [Sports, Entrepreneurship, DevOps, Robotics, C... " ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "users.head(2)" ] }, { "cell_type": "code", "execution_count": 25, "id": "4ad2a239", "metadata": {}, "outputs": [], "source": [ "users['events']= users['events'].apply(lambda x:\" \".join(x))" ] }, { "cell_type": "code", "execution_count": 26, "id": "34b0b8ce", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
user_idnamekeyevents
068e0e01c6fbdb8a90b76129bJacob JenningsGame Development Blockchain FinTech Cloud Comp...Game Development Blockchain FinTech Cloud Comp...
168e0e01c6fbdb8a90b76129cMrs. Julie MartinezSports Entrepreneurship DevOps Robotics Cultur...Sports Entrepreneurship DevOps Robotics Cultur...
\n", "
" ], "text/plain": [ " user_id name \\\n", "0 68e0e01c6fbdb8a90b76129b Jacob Jennings \n", "1 68e0e01c6fbdb8a90b76129c Mrs. Julie Martinez \n", "\n", " key \\\n", "0 Game Development Blockchain FinTech Cloud Comp... \n", "1 Sports Entrepreneurship DevOps Robotics Cultur... \n", "\n", " events \n", "0 Game Development Blockchain FinTech Cloud Comp... \n", "1 Sports Entrepreneurship DevOps Robotics Cultur... " ] }, "execution_count": 26, "metadata": {}, "output_type": "execute_result" } ], "source": [ "users.head(2)" ] }, { "cell_type": "code", "execution_count": 27, "id": "53c32ccb", "metadata": {}, "outputs": [], "source": [ "users['key'] = users['key'] + \" \" + users['events'].apply(lambda x: \" \".join(x))" ] }, { "cell_type": "code", "execution_count": 28, "id": "b0150858", "metadata": {}, "outputs": [], "source": [ "users.drop(columns=['events'], inplace=True)" ] }, { "cell_type": "code", "execution_count": 29, "id": "b81cd07e", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
user_idnamekey
068e0e01c6fbdb8a90b76129bJacob JenningsGame Development Blockchain FinTech Cloud Comp...
\n", "
" ], "text/plain": [ " user_id name \\\n", "0 68e0e01c6fbdb8a90b76129b Jacob Jennings \n", "\n", " key \n", "0 Game Development Blockchain FinTech Cloud Comp... " ] }, "execution_count": 29, "metadata": {}, "output_type": "execute_result" } ], "source": [ "users.head(1)" ] }, { "cell_type": "code", "execution_count": 30, "id": "fe88b6f9", "metadata": {}, "outputs": [], "source": [ "from sklearn.metrics.pairwise import cosine_similarity\n", "from sklearn.feature_extraction.text import CountVectorizer" ] }, { "cell_type": "code", "execution_count": 31, "id": "a40779a8", "metadata": {}, "outputs": [], "source": [ "cv = CountVectorizer(max_features=5000,stop_words='english')" ] }, { "cell_type": "code", "execution_count": 32, "id": "6218582b", "metadata": {}, "outputs": [], "source": [ "user_vector = cv.fit_transform(users['key']).toarray()" ] }, { "cell_type": "code", "execution_count": 33, "id": "06a9f093", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,\n", " 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,\n", " 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n", " 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n", " 0])" ] }, "execution_count": 33, "metadata": {}, "output_type": "execute_result" } ], "source": [ "user_vector[2]" ] }, { "cell_type": "code", "execution_count": 34, "id": "b59ce2e2", "metadata": {}, "outputs": [], "source": [ "user_similarity = cosine_similarity(user_vector)" ] }, { "cell_type": "code", "execution_count": 35, "id": "f5164e33", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(500, 500)" ] }, "execution_count": 35, "metadata": {}, "output_type": "execute_result" } ], "source": [ "user_similarity.shape" ] }, { "cell_type": "code", "execution_count": 36, "id": "9b879898", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[(0, np.float64(1.0)),\n", " (1, np.float64(0.4160251471689219)),\n", " (2, np.float64(0.10206207261596577)),\n", " (3, np.float64(0.5809475019311123)),\n", " (4, np.float64(0.4244373438135828)),\n", " (5, np.float64(0.33407655239053047)),\n", " (6, np.float64(0.5809475019311123)),\n", " (7, np.float64(0.20801257358446093)),\n", " (8, np.float64(0.32274861218395134)),\n", " (9, np.float64(0.31622776601683794)),\n", " (10, np.float64(0.16666666666666666)),\n", " (11, np.float64(0.48507125007266605)),\n", " (12, np.float64(0.6681531047810608)),\n", " (13, np.float64(0.40089186286863654)),\n", " (14, np.float64(0.4853626716970756)),\n", " (15, np.float64(0.6240377207533829)),\n", " (16, np.float64(0.41247895569215276)),\n", " (17, np.float64(0.43301270189221935)),\n", " (18, np.float64(0.4160251471689219)),\n", " (19, np.float64(0.20801257358446093)),\n", " (20, np.float64(0.39528470752104744)),\n", " (21, np.float64(0.25)),\n", " (22, np.float64(0.45883146774112354)),\n", " (23, np.float64(0.33407655239053047)),\n", " (24, np.float64(0.4160251471689219)),\n", " (25, np.float64(0.4472135954999579)),\n", " (26, np.float64(0.22613350843332272)),\n", " (27, np.float64(0.47140452079103173)),\n", " (28, np.float64(0.5276448530110864)),\n", " (29, np.float64(0.42443734381358267)),\n", " (30, np.float64(0.2651650429449553)),\n", " (31, np.float64(0.3872983346207416)),\n", " (32, np.float64(0.3333333333333333)),\n", " (33, np.float64(0.36084391824351614)),\n", " (34, np.float64(0.22613350843332272)),\n", " (35, np.float64(0.30151134457776363)),\n", " (36, np.float64(0.5051814855409226)),\n", " (37, np.float64(0.16666666666666666)),\n", " (38, np.float64(0.37688918072220456)),\n", " (39, np.float64(0.4160251471689219)),\n", " (40, np.float64(0.2165063509461097)),\n", " (41, np.float64(0.5)),\n", " (42, np.float64(0.32274861218395134)),\n", " (43, np.float64(0.6669729688499159)),\n", " (44, np.float64(0.5303300858899107)),\n", " (45, np.float64(0.5345224838248487)),\n", " (46, np.float64(0.2672612419124244)),\n", " (47, np.float64(0.40147753427348304)),\n", " (48, np.float64(0.23717082451262844)),\n", " (49, np.float64(0.670820393249937)),\n", " (50, np.float64(0.6030226891555274)),\n", " (51, np.float64(0.41666666666666663)),\n", " (52, np.float64(0.36084391824351614)),\n", " (53, np.float64(0.31622776601683794)),\n", " (54, np.float64(0.41247895569215276)),\n", " (55, np.float64(0.4677071733467426)),\n", " (56, np.float64(0.5892556509887896)),\n", " (57, np.float64(0.49999999999999994)),\n", " (58, np.float64(0.33541019662496846)),\n", " (59, np.float64(0.375)),\n", " (60, np.float64(0.25)),\n", " (61, np.float64(0.2672612419124244)),\n", " (62, np.float64(0.23570226039551587)),\n", " (63, np.float64(0.30151134457776363)),\n", " (64, np.float64(0.670820393249937)),\n", " (65, np.float64(0.37688918072220456)),\n", " (66, np.float64(0.6240377207533829)),\n", " (67, np.float64(0.36084391824351614)),\n", " (68, np.float64(0.43301270189221935)),\n", " (69, np.float64(0.47140452079103173)),\n", " (70, np.float64(0.3872983346207416)),\n", " (71, np.float64(0.5)),\n", " (72, np.float64(0.43301270189221935)),\n", " (73, np.float64(0.5163977794943221)),\n", " (74, np.float64(0.6669729688499159)),\n", " (75, np.float64(0.17677669529663687)),\n", " (76, np.float64(0.5303300858899107)),\n", " (77, np.float64(0.4853626716970756)),\n", " (78, np.float64(0.5303300858899107)),\n", " (79, np.float64(0.40089186286863654)),\n", " (80, np.float64(0.4677071733467426)),\n", " (81, np.float64(0.48507125007266605)),\n", " (82, np.float64(0.6013377943029548)),\n", " (83, np.float64(0.6669729688499159)),\n", " (84, np.float64(0.5276448530110864)),\n", " (85, np.float64(0.4244373438135828)),\n", " (86, np.float64(0.49099025303098287)),\n", " (87, np.float64(0.3638034375544995)),\n", " (88, np.float64(0.3333333333333333)),\n", " (89, np.float64(0.31622776601683794)),\n", " (90, np.float64(0.5735393346764044)),\n", " (91, np.float64(0.5625)),\n", " (92, np.float64(0.33407655239053047)),\n", " (93, np.float64(0.23717082451262844)),\n", " (94, np.float64(0.45184805705753184)),\n", " (95, np.float64(0.2004459314343183)),\n", " (96, np.float64(0.5303300858899107)),\n", " (97, np.float64(0.45184805705753184)),\n", " (98, np.float64(0.4472135954999579)),\n", " (99, np.float64(0.31622776601683794)),\n", " (100, np.float64(0.4677071733467426)),\n", " (101, np.float64(0.43301270189221935)),\n", " (102, np.float64(0.39528470752104744)),\n", " (103, np.float64(0.4375)),\n", " (104, np.float64(0.45184805705753184)),\n", " (105, np.float64(0.5345224838248487)),\n", " (106, np.float64(0.37688918072220456)),\n", " (107, np.float64(0.36084391824351614)),\n", " (108, np.float64(0.5863019699779286)),\n", " (109, np.float64(0.3872983346207416)),\n", " (110, np.float64(0.43301270189221935)),\n", " (111, np.float64(0.2165063509461097)),\n", " (112, np.float64(0.48507125007266605)),\n", " (113, np.float64(0.5625)),\n", " (114, np.float64(0.4677071733467426)),\n", " (115, np.float64(0.2886751345948129)),\n", " (116, np.float64(0.3779644730092272)),\n", " (117, np.float64(0.43301270189221935)),\n", " (118, np.float64(0.6063390625908326)),\n", " (119, np.float64(0.41666666666666663)),\n", " (120, np.float64(0.23717082451262844)),\n", " (121, np.float64(0.5533985905294664)),\n", " (122, np.float64(0.41247895569215276)),\n", " (123, np.float64(0.5833333333333333)),\n", " (124, np.float64(0.39528470752104744)),\n", " (125, np.float64(0.45883146774112354)),\n", " (126, np.float64(0.6875)),\n", " (127, np.float64(0.36084391824351614)),\n", " (128, np.float64(0.2886751345948129)),\n", " (129, np.float64(0.48507125007266605)),\n", " (130, np.float64(0.5051814855409226)),\n", " (131, np.float64(0.4522670168666455)),\n", " (132, np.float64(0.15811388300841897)),\n", " (133, np.float64(0.4472135954999579)),\n", " (134, np.float64(0.5051814855409226)),\n", " (135, np.float64(0.4677071733467426)),\n", " (136, np.float64(0.5809475019311123)),\n", " (137, np.float64(0.2581988897471611)),\n", " (138, np.float64(0.31622776601683794)),\n", " (139, np.float64(0.43301270189221935)),\n", " (140, np.float64(0.3125)),\n", " (141, np.float64(0.3638034375544995)),\n", " (142, np.float64(0.4160251471689219)),\n", " (143, np.float64(0.6454972243679026)),\n", " (144, np.float64(0.43301270189221935)),\n", " (145, np.float64(0.15075567228888181)),\n", " (146, np.float64(0.34668762264076824)),\n", " (147, np.float64(0.32274861218395134)),\n", " (148, np.float64(0.47140452079103173)),\n", " (149, np.float64(0.75)),\n", " (150, np.float64(0.5051814855409226)),\n", " (151, np.float64(0.3125)),\n", " (152, np.float64(0.5345224838248487)),\n", " (153, np.float64(0.6030226891555274)),\n", " (154, np.float64(0.4853626716970756)),\n", " (155, np.float64(0.45184805705753184)),\n", " (156, np.float64(0.4160251471689219)),\n", " (157, np.float64(0.4375)),\n", " (158, np.float64(0.3872983346207416)),\n", " (159, np.float64(0.37688918072220456)),\n", " (160, np.float64(0.25)),\n", " (161, np.float64(0.45184805705753184)),\n", " (162, np.float64(0.3872983346207416)),\n", " (163, np.float64(0.2165063509461097)),\n", " (164, np.float64(0.2581988897471611)),\n", " (165, np.float64(0.4160251471689219)),\n", " (166, np.float64(0.37688918072220456)),\n", " (167, np.float64(0.49999999999999994)),\n", " (168, np.float64(0.07905694150420949)),\n", " (169, np.float64(0.6255432421712244)),\n", " (170, np.float64(0.30151134457776363)),\n", " (171, np.float64(0.32274861218395134)),\n", " (172, np.float64(0.17677669529663687)),\n", " (173, np.float64(0.5303300858899107)),\n", " (174, np.float64(0.36084391824351614)),\n", " (175, np.float64(0.5547001962252293)),\n", " (176, np.float64(0.4160251471689219)),\n", " (177, np.float64(0.33407655239053047)),\n", " (178, np.float64(0.43301270189221935)),\n", " (179, np.float64(0.08333333333333333)),\n", " (180, np.float64(0.375)),\n", " (181, np.float64(0.14433756729740646)),\n", " (182, np.float64(0.2773500981126146)),\n", " (183, np.float64(0.5)),\n", " (184, np.float64(0.4522670168666455)),\n", " (185, np.float64(0.375)),\n", " (186, np.float64(0.12909944487358055)),\n", " (187, np.float64(0.4160251471689219)),\n", " (188, np.float64(0.23717082451262844)),\n", " (189, np.float64(0.15075567228888181)),\n", " (190, np.float64(0.4375)),\n", " (191, np.float64(0.34668762264076824)),\n", " (192, np.float64(0.32274861218395134)),\n", " (193, np.float64(0.36084391824351614)),\n", " (194, np.float64(0.22613350843332272)),\n", " (195, np.float64(0.3333333333333333)),\n", " (196, np.float64(0.22613350843332272)),\n", " (197, np.float64(0.5163977794943221)),\n", " (198, np.float64(0.19364916731037082)),\n", " (199, np.float64(0.20801257358446093)),\n", " (200, np.float64(0.3779644730092272)),\n", " (201, np.float64(0.41666666666666663)),\n", " (202, np.float64(0.33407655239053047)),\n", " (203, np.float64(0.24253562503633297)),\n", " (204, np.float64(0.2004459314343183)),\n", " (205, np.float64(0.3333333333333333)),\n", " (206, np.float64(0.3638034375544995)),\n", " (207, np.float64(0.5)),\n", " (208, np.float64(0.37688918072220456)),\n", " (209, np.float64(0.5590169943749475)),\n", " (210, np.float64(0.3333333333333333)),\n", " (211, np.float64(0.3872983346207416)),\n", " (212, np.float64(0.41247895569215276)),\n", " (213, np.float64(0.18190171877724973)),\n", " (214, np.float64(0.39528470752104744)),\n", " (215, np.float64(0.3333333333333333)),\n", " (216, np.float64(0.3872983346207416)),\n", " (217, np.float64(0.31622776601683794)),\n", " (218, np.float64(0.07216878364870323)),\n", " (219, np.float64(0.48507125007266605)),\n", " (220, np.float64(0.5031152949374527)),\n", " (221, np.float64(0.47140452079103173)),\n", " (222, np.float64(0.45184805705753184)),\n", " (223, np.float64(0.37688918072220456)),\n", " (224, np.float64(0.30151134457776363)),\n", " (225, np.float64(0.3535533905932738)),\n", " (226, np.float64(0.3125)),\n", " (227, np.float64(0.31622776601683794)),\n", " (228, np.float64(0.5457051563317493)),\n", " (229, np.float64(0.28347335475692037)),\n", " (230, np.float64(0.48507125007266605)),\n", " (231, np.float64(0.3333333333333333)),\n", " (232, np.float64(0.4160251471689219)),\n", " (233, np.float64(0.14433756729740646)),\n", " (234, np.float64(0.4244373438135828)),\n", " (235, np.float64(0.2773500981126146)),\n", " (236, np.float64(0.5051814855409226)),\n", " (237, np.float64(0.16666666666666666)),\n", " (238, np.float64(0.6013377943029548)),\n", " (239, np.float64(0.35355339059327373)),\n", " (240, np.float64(0.15811388300841897)),\n", " (241, np.float64(0.45184805705753184)),\n", " (242, np.float64(0.625)),\n", " (243, np.float64(0.2165063509461097)),\n", " (244, np.float64(0.2672612419124244)),\n", " (245, np.float64(0.48507125007266605)),\n", " (246, np.float64(0.40089186286863654)),\n", " (247, np.float64(0.5809475019311123)),\n", " (248, np.float64(0.39528470752104744)),\n", " (249, np.float64(0.4244373438135828)),\n", " (250, np.float64(0.2004459314343183)),\n", " (251, np.float64(0.41247895569215276)),\n", " (252, np.float64(0.3333333333333333)),\n", " (253, np.float64(0.23717082451262844)),\n", " (254, np.float64(0.3125)),\n", " (255, np.float64(0.5163977794943221)),\n", " (256, np.float64(0.2773500981126146)),\n", " (257, np.float64(0.5303300858899107)),\n", " (258, np.float64(0.4522670168666455)),\n", " (259, np.float64(0.5303300858899107)),\n", " (260, np.float64(0.5051814855409226)),\n", " (261, np.float64(0.34412360080584264)),\n", " (262, np.float64(0.30151134457776363)),\n", " (263, np.float64(0.125)),\n", " (264, np.float64(0.5773502691896258)),\n", " (265, np.float64(0.4014775342734831)),\n", " (266, np.float64(0.45883146774112354)),\n", " (267, np.float64(0.32274861218395134)),\n", " (268, np.float64(0.48507125007266605)),\n", " (269, np.float64(0.2581988897471611)),\n", " (270, np.float64(0.4244373438135828)),\n", " (271, np.float64(0.6030226891555274)),\n", " (272, np.float64(0.43301270189221935)),\n", " (273, np.float64(0.2773500981126146)),\n", " (274, np.float64(0.16666666666666666)),\n", " (275, np.float64(0.6681531047810608)),\n", " (276, np.float64(0.22613350843332272)),\n", " (277, np.float64(0.44194173824159216)),\n", " (278, np.float64(0.32274861218395134)),\n", " (279, np.float64(0.2672612419124244)),\n", " (280, np.float64(0.31622776601683794)),\n", " (281, np.float64(0.07905694150420949)),\n", " (282, np.float64(0.5163977794943221)),\n", " (283, np.float64(0.23717082451262844)),\n", " (284, np.float64(0.34668762264076824)),\n", " (285, np.float64(0.28347335475692037)),\n", " (286, np.float64(0.34668762264076824)),\n", " (287, np.float64(0.25)),\n", " (288, np.float64(0.48507125007266605)),\n", " (289, np.float64(0.31622776601683794)),\n", " (290, np.float64(0.35355339059327373)),\n", " (291, np.float64(0.2165063509461097)),\n", " (292, np.float64(0.4853626716970756)),\n", " (293, np.float64(0.43301270189221935)),\n", " (294, np.float64(0.5051814855409226)),\n", " (295, np.float64(0.19364916731037082)),\n", " (296, np.float64(0.2773500981126146)),\n", " (297, np.float64(0.4375)),\n", " (298, np.float64(0.15811388300841897)),\n", " (299, np.float64(0.2886751345948129)),\n", " (300, np.float64(0.34668762264076824)),\n", " (301, np.float64(0.07537783614444091)),\n", " (302, np.float64(0.31622776601683794)),\n", " (303, np.float64(0.5625)),\n", " (304, np.float64(0.5625)),\n", " (305, np.float64(0.40089186286863654)),\n", " (306, np.float64(0.37688918072220456)),\n", " (307, np.float64(0.5276448530110864)),\n", " (308, np.float64(0.7100469468046928)),\n", " (309, np.float64(0.4677071733467426)),\n", " (310, np.float64(0.22613350843332272)),\n", " (311, np.float64(0.375)),\n", " (312, np.float64(0.2886751345948129)),\n", " (313, np.float64(0.41247895569215276)),\n", " (314, np.float64(0.48507125007266605)),\n", " (315, np.float64(0.25)),\n", " (316, np.float64(0.2165063509461097)),\n", " (317, np.float64(0.22613350843332272)),\n", " (318, np.float64(0.15811388300841897)),\n", " (319, np.float64(0.3638034375544995)),\n", " (320, np.float64(0.48507125007266605)),\n", " (321, np.float64(0.3779644730092272)),\n", " (322, np.float64(0.2773500981126146)),\n", " (323, np.float64(0.3872983346207416)),\n", " (324, np.float64(0.41666666666666663)),\n", " (325, np.float64(0.5051814855409226)),\n", " (326, np.float64(0.43301270189221935)),\n", " (327, np.float64(0.4160251471689219)),\n", " (328, np.float64(0.25)),\n", " (329, np.float64(0.4677071733467426)),\n", " (330, np.float64(0.17677669529663687)),\n", " (331, np.float64(0.41247895569215276)),\n", " (332, np.float64(0.3333333333333333)),\n", " (333, np.float64(0.375)),\n", " (334, np.float64(0.41666666666666663)),\n", " (335, np.float64(0.3872983346207416)),\n", " (336, np.float64(0.6546536707079773)),\n", " (337, np.float64(0.16666666666666666)),\n", " (338, np.float64(0.1889822365046136)),\n", " (339, np.float64(0.4244373438135828)),\n", " (340, np.float64(0.45184805705753184)),\n", " (341, np.float64(0.5625)),\n", " (342, np.float64(0.45184805705753184)),\n", " (343, np.float64(0.6454972243679026)),\n", " (344, np.float64(0.45184805705753184)),\n", " (345, np.float64(0.4244373438135828)),\n", " (346, np.float64(0.19364916731037082)),\n", " (347, np.float64(0.28347335475692037)),\n", " (348, np.float64(0.30316953129541624)),\n", " (349, np.float64(0.15075567228888181)),\n", " (350, np.float64(0.2886751345948129)),\n", " (351, np.float64(0.2651650429449553)),\n", " (352, np.float64(0.3638034375544995)),\n", " (353, np.float64(0.3333333333333333)),\n", " (354, np.float64(0.37688918072220456)),\n", " (355, np.float64(0.41666666666666663)),\n", " (356, np.float64(0.5590169943749475)),\n", " (357, np.float64(0.41247895569215276)),\n", " (358, np.float64(0.32274861218395134)),\n", " (359, np.float64(0.2672612419124244)),\n", " (360, np.float64(0.3872983346207416)),\n", " (361, np.float64(0.47970161180012344)),\n", " (362, np.float64(0.47970161180012344)),\n", " (363, np.float64(0.33407655239053047)),\n", " (364, np.float64(0.2773500981126146)),\n", " (365, np.float64(0.3535533905932738)),\n", " (366, np.float64(0.4160251471689219)),\n", " (367, np.float64(0.5051814855409226)),\n", " (368, np.float64(0.3638034375544995)),\n", " (369, np.float64(0.625)),\n", " (370, np.float64(0.20801257358446093)),\n", " (371, np.float64(0.37688918072220456)),\n", " (372, np.float64(0.4522670168666455)),\n", " (373, np.float64(0.41666666666666663)),\n", " (374, np.float64(0.20801257358446093)),\n", " (375, np.float64(0.15811388300841897)),\n", " (376, np.float64(0.46915743162841816)),\n", " (377, np.float64(0.08838834764831843)),\n", " (378, np.float64(0.43301270189221935)),\n", " (379, np.float64(0.20801257358446093)),\n", " (380, np.float64(0.30151134457776363)),\n", " (381, np.float64(0.34668762264076824)),\n", " (382, np.float64(0.2004459314343183)),\n", " (383, np.float64(0.2004459314343183)),\n", " (384, np.float64(0.37688918072220456)),\n", " (385, np.float64(0.5163977794943221)),\n", " (386, np.float64(0.5)),\n", " (387, np.float64(0.5547001962252293)),\n", " (388, np.float64(0.4375)),\n", " (389, np.float64(0.4853626716970756)),\n", " (390, np.float64(0.15075567228888181)),\n", " (391, np.float64(0.47434164902525694)),\n", " (392, np.float64(0.30151134457776363)),\n", " (393, np.float64(0.39528470752104744)),\n", " (394, np.float64(0.4677071733467426)),\n", " (395, np.float64(0.37688918072220456)),\n", " (396, np.float64(0.1386750490563073)),\n", " (397, np.float64(0.45184805705753184)),\n", " (398, np.float64(0.4677071733467426)),\n", " (399, np.float64(0.4677071733467426)),\n", " (400, np.float64(0.2165063509461097)),\n", " (401, np.float64(0.4853626716970756)),\n", " (402, np.float64(0.36084391824351614)),\n", " (403, np.float64(0.5)),\n", " (404, np.float64(0.5345224838248487)),\n", " (405, np.float64(0.45184805705753184)),\n", " (406, np.float64(0.4522670168666455)),\n", " (407, np.float64(0.46915743162841816)),\n", " (408, np.float64(0.25)),\n", " (409, np.float64(0.7071067811865475)),\n", " (410, np.float64(0.07537783614444091)),\n", " (411, np.float64(0.5625)),\n", " (412, np.float64(0.2672612419124244)),\n", " (413, np.float64(0.28347335475692037)),\n", " (414, np.float64(0.45184805705753184)),\n", " (415, np.float64(0.30151134457776363)),\n", " (416, np.float64(0.30151134457776363)),\n", " (417, np.float64(0.35355339059327373)),\n", " (418, np.float64(0.5345224838248487)),\n", " (419, np.float64(0.4160251471689219)),\n", " (420, np.float64(0.5051814855409226)),\n", " (421, np.float64(0.17677669529663687)),\n", " (422, np.float64(0.2886751345948129)),\n", " (423, np.float64(0.5773502691896258)),\n", " (424, np.float64(0.32274861218395134)),\n", " (425, np.float64(0.40089186286863654)),\n", " (426, np.float64(0.1386750490563073)),\n", " (427, np.float64(0.45184805705753184)),\n", " (428, np.float64(0.6063390625908326)),\n", " (429, np.float64(0.40089186286863654)),\n", " (430, np.float64(0.4160251471689219)),\n", " (431, np.float64(0.20801257358446093)),\n", " (432, np.float64(0.48507125007266605)),\n", " (433, np.float64(0.15811388300841897)),\n", " (434, np.float64(0.45184805705753195)),\n", " (435, np.float64(0.4160251471689219)),\n", " (436, np.float64(0.33407655239053047)),\n", " (437, np.float64(0.4160251471689219)),\n", " (438, np.float64(0.48507125007266605)),\n", " (439, np.float64(0.45184805705753184)),\n", " (440, np.float64(0.16666666666666666)),\n", " (441, np.float64(0.20412414523193154)),\n", " (442, np.float64(0.2946278254943948)),\n", " (443, np.float64(0.49099025303098287)),\n", " (444, np.float64(0.5031152949374527)),\n", " (445, np.float64(0.07537783614444091)),\n", " (446, np.float64(0.4677071733467426)),\n", " (447, np.float64(0.3638034375544995)),\n", " (448, np.float64(0.5345224838248487)),\n", " (449, np.float64(0.5625)),\n", " (450, np.float64(0.47140452079103173)),\n", " (451, np.float64(0.30151134457776363)),\n", " (452, np.float64(0.37688918072220456)),\n", " (453, np.float64(0.2004459314343183)),\n", " (454, np.float64(0.4244373438135828)),\n", " (455, np.float64(0.33541019662496846)),\n", " (456, np.float64(0.33407655239053047)),\n", " (457, np.float64(0.6308932681440447)),\n", " (458, np.float64(0.22613350843332272)),\n", " (459, np.float64(0.1875)),\n", " (460, np.float64(0.47434164902525694)),\n", " (461, np.float64(0.5163977794943221)),\n", " (462, np.float64(0.5031152949374527)),\n", " (463, np.float64(0.3333333333333333)),\n", " (464, np.float64(0.4522670168666455)),\n", " (465, np.float64(0.20801257358446093)),\n", " (466, np.float64(0.5276448530110864)),\n", " (467, np.float64(0.36084391824351614)),\n", " (468, np.float64(0.34668762264076824)),\n", " (469, np.float64(0.5457051563317493)),\n", " (470, np.float64(0.5457051563317493)),\n", " (471, np.float64(0.5051814855409226)),\n", " (472, np.float64(0.5051814855409226)),\n", " (473, np.float64(0.2165063509461097)),\n", " (474, np.float64(0.5625)),\n", " (475, np.float64(0.6063390625908326)),\n", " (476, np.float64(0.07537783614444091)),\n", " (477, np.float64(0.25)),\n", " (478, np.float64(0.32274861218395134)),\n", " (479, np.float64(0.4160251471689219)),\n", " (480, np.float64(0.40089186286863654)),\n", " (481, np.float64(0.23717082451262844)),\n", " (482, np.float64(0.4160251471689219)),\n", " (483, np.float64(0.2773500981126146)),\n", " (484, np.float64(0.4677071733467426)),\n", " (485, np.float64(0.4853626716970756)),\n", " (486, np.float64(0.2773500981126146)),\n", " (487, np.float64(0.2165063509461097)),\n", " (488, np.float64(0.30316953129541624)),\n", " (489, np.float64(0.3872983346207416)),\n", " (490, np.float64(0.23717082451262844)),\n", " (491, np.float64(0.4160251471689219)),\n", " (492, np.float64(0.25)),\n", " (493, np.float64(0.0)),\n", " (494, np.float64(0.34412360080584264)),\n", " (495, np.float64(0.3872983346207416)),\n", " (496, np.float64(0.4160251471689219)),\n", " (497, np.float64(0.5051814855409226)),\n", " (498, np.float64(0.36084391824351614)),\n", " (499, np.float64(0.40089186286863654))]" ] }, "execution_count": 36, "metadata": {}, "output_type": "execute_result" } ], "source": [ "list(enumerate(user_similarity[0]))\n" ] }, { "cell_type": "code", "execution_count": 37, "id": "23c62729", "metadata": {}, "outputs": [], "source": [ "def recommend_user(user_id):\n", " index = users[users['user_id']== user_id].index[0]\n", " distances = user_similarity[index]\n", " users_list = sorted(list(enumerate(distances)),reverse=True , key=lambda x:x[1])[1:6]\n", "\n", " for i in users_list:\n", " print(users.iloc[i[0]].user_id)\n", "\n", " return" ] }, { "cell_type": "code", "execution_count": 39, "id": "66a58a1d", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "68e0e01c6fbdb8a90b761330\n", "68e0e01c6fbdb8a90b7613cf\n", "68e0e01c6fbdb8a90b761434\n", "68e0e01c6fbdb8a90b761319\n", "68e0e01c6fbdb8a90b7612cc\n" ] } ], "source": [ "recommend_user('68e0e01c6fbdb8a90b76129b')" ] }, { "cell_type": "code", "execution_count": 40, "id": "926715f1", "metadata": {}, "outputs": [], "source": [ "import pickle\n" ] }, { "cell_type": "code", "execution_count": 41, "id": "0fc756c2", "metadata": {}, "outputs": [], "source": [ "import os\n", "os.makedirs('../model', exist_ok=True)\n", "pickle.dump(users, open('../model/users.pkl', 'wb'))\n", "pickle.dump(users_event, open('../model/users_event.pkl', 'wb'))" ] }, { "cell_type": "code", "execution_count": 42, "id": "67600b85", "metadata": {}, "outputs": [], "source": [ "pickle.dump(user_similarity, open('../model/users_similarity.pkl', 'wb'))" ] }, { "cell_type": "code", "execution_count": 43, "id": "179906fd", "metadata": {}, "outputs": [], "source": [ "pickle.dump(user_vector, open('../model/users_vector.pkl', 'wb'))" ] }, { "cell_type": "code", "execution_count": null, "id": "3e929faf", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.6" } }, "nbformat": 4, "nbformat_minor": 5 }