Files
Campus-Plug/recommondation-engine/__pycache__/example1.cpython-313.pyc

30 lines
3.9 KiB
Plaintext
Raw Normal View History

2025-04-03 12:15:32 -06:00
<EFBFBD>
<00><><EFBFBD>g^ <00><00>D<00>SSKrSSKJr SSKrSSKrSrSrSr SSjr
g)<08>N)<01>cosine_similarityc<00>F<00>[RRSSSSS9nU$)N<> localhost<73>3306<30>root<6F> Marketplace)<04>host<73>port<72>user<65>database)<03>mysql<71> connector<6F>connect)<01> db_connections <20>O/Users/mannpatel/Documents/GitHub/Campus-Plug/recommondation-engine/example1.pyr r s/<00><00><19>O<EFBFBD>O<EFBFBD>+<2B>+<2B><1A><15><15> <20> ,<2C><06>M<EFBFBD> <19><18>c<00><><00>[5nUR5nURS5 UR5nSnUHnUSnUSUSUS3- nM SUS3nURU5 UR5n/nUH0n [ U 5n
U
R S5 UR U
5 M2 UR5 UR5 U$) N<>SELECT CategoryID FROM Category<72>SELECT p.ProductIDr<00> , MAX(CASE WHEN pc.CategoryID = <20> THEN 1 ELSE 0 END) AS `Cat_<74>`<60>
z<>
FROM Product p
LEFT JOIN Product_Category pc ON p.ProductID = pc.ProductID
LEFT JOIN Category c ON pc.CategoryID = c.CategoryID
GROUP BY p.ProductID;
<20>r <00>cursor<6F>execute<74>fetchall<6C>list<73>pop<6F>append<6E>close) <0B>db_conr<00>
categories<EFBFBD> select_clause<73>category<72> category_id<69> final_query<72>results<74>final<61>row<6F> text_lists r<00>get_all_productsr,s<><00><00> <15>Z<EFBFBD>F<EFBFBD> <13>]<5D>]<5D>_<EFBFBD>F<EFBFBD>
<EFBFBD>N<EFBFBD>N<EFBFBD>4<>5<><17><1F><1F>"<22>J<EFBFBD>(<28>M<EFBFBD><1E><08><1E>q<EFBFBD>k<EFBFBD> <0B><15>;<3B>K<EFBFBD>=<3D>Hd<48>ep<65>dq<64>qr<71>s<>s<> <0A><1F> <09> <16><0F> <09> <0C>K<EFBFBD> <0B>N<EFBFBD>N<EFBFBD>;<3B><1F><14>o<EFBFBD>o<EFBFBD><1F>G<EFBFBD> <0E>E<EFBFBD><16><03><18><13>I<EFBFBD> <09><11> <0A> <0A>a<EFBFBD><18> <0A> <0C> <0C>Y<EFBFBD><1F><17>
 <0B>L<EFBFBD>L<EFBFBD>N<EFBFBD>
<EFBFBD>L<EFBFBD>L<EFBFBD>N<EFBFBD> <10>Lrc<00><><00>[5nUR5nURS5 UR5nSnUHnUSnUSUSUS3- nM SUSUS 3nURU5 UR5n/n UH0n
[ U
5n U R S5 U R U 5 M2 UR5 UR5 U $)
Nrrrrrrrz<>
FROM Product p
LEFT JOIN Product_Category pc ON p.ProductID = pc.ProductID
LEFT JOIN Category c ON pc.CategoryID = c.CategoryID
where p.ProductID in (select ProductID from History where UserID = z()
GROUP BY p.ProductID;
r) <0C>user_idr"rr#r$r%r&r'r(r)r*r+s r<00>get_user_historyr/4s<><00><00> <15>Z<EFBFBD>F<EFBFBD> <13>]<5D>]<5D>_<EFBFBD>F<EFBFBD>
<EFBFBD>N<EFBFBD>N<EFBFBD>4<>5<><17><1F><1F>"<22>J<EFBFBD>(<28>M<EFBFBD><1E><08><1E>q<EFBFBD>k<EFBFBD> <0B><15>;<3B>K<EFBFBD>=<3D>Hd<48>ep<65>dq<64>qr<71>s<>s<> <0A><1F> <09> <16><0F>L<01>MT<01>9<EFBFBD>U <09>  <0C>K<EFBFBD> <0B>N<EFBFBD>N<EFBFBD>;<3B><1F><14>o<EFBFBD>o<EFBFBD><1F>G<EFBFBD> <0E>E<EFBFBD><16><03><18><13>I<EFBFBD> <09><11> <0A> <0A>a<EFBFBD><18> <0A> <0C> <0C>Y<EFBFBD><1F><17>
 <0B>L<EFBFBD>L<EFBFBD>N<EFBFBD>
<EFBFBD>L<EFBFBD>L<EFBFBD>N<EFBFBD> <10>Lrc <00>v<00>[5n[U5n[R"USS9n[ U/U5nUSR 5U*SSSS2n[ SU5 UVs/sH
orUSPM sn$s snf![a/n[R"SUS[U535 SnAgSnAff=f)Nr)<01>axis<69><73><EFBFBD><EFBFBD><EFBFBD><EFBFBD>productzRecommendation error for user z: ) r,r/<00>np<6E>meanr<00>argsort<72>print<6E> Exception<6F>logging<6E>error<6F>str) r.<00>top_n<5F> all_products<74> user_history<72> user_profile<6C> similarities<65>product_indices<65>i<>es r<00>get_recommendationsrDVs<><00><00>L<01>'<27>)<29> <0C>'<27><07>0<> <0C><1A>w<EFBFBD>w<EFBFBD>|<7C>!<21>4<> <0C>(<28>,<2C><1E><1C>F<> <0C>'<27>q<EFBFBD>/<2F>1<>1<>3<>U<EFBFBD>F<EFBFBD>G<EFBFBD><<3C>T<EFBFBD>r<EFBFBD>T<EFBFBD>B<><0F> <0A>i<EFBFBD><1F>)<29>-<<3C><<3C>O<EFBFBD>q<EFBFBD>Q<EFBFBD><0F><01>"<22>O<EFBFBD><<3C><<3C><><<3C><> <14>L<01><0F> <0A> <0A>6<>w<EFBFBD>i<EFBFBD>r<EFBFBD>#<23>a<EFBFBD>&<26><18>J<>K<>K<><4B>L<01>s*<00>A$A?<00>&A:<04>7A?<00>:A?<00>?
B8<03> %B3<03>3B8)<01>() <0B>mysql.connectorr <00>sklearn.metrics.pairwiser<00>numpyr4r9r r,r/rD<00>rr<00><module>rJs*<00><01><17>6<><12><0E><19> <11>D<11>DLr