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

39 lines
5.6 KiB
Plaintext
Raw Normal View History

2025-04-18 10:37:19 -06:00
<EFBFBD>
2025-04-18 19:05:20 -06:00
X<>h<><00><00>b<00>SSKrSSKJr SSKrSSKrSSKJr Sr Sr
2025-04-18 10:37:19 -06:00
Sr Sr Sr S S jrS
rg) <0C>N)<01>cosine_similarity)<01>resultc<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>D/home/mann/Documents/GitHub/Campus-Plug/recommondation-engine/app.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>g)N<>rrr<00>get_popular_productsrs<00><00>rc<00><><00>[5nUR5nUH+nUS-n[U5 URSUSUS35 M- UR 5 g! g=f)N<>z;INTO Recommendation (UserID, RecommendedProductID) VALUES (<28>, <20>);)r <00>cursor<6F>print<6E>execute<74>commit)<06>userID<49>Array<61>db_conr<00>item<65>
item_values r<00>delete_user_recommendationr$sk<00><00> <15>Z<EFBFBD>F<EFBFBD> <13>]<5D>]<5D>_<EFBFBD>F<EFBFBD>  <0A><19>D<EFBFBD><1D><01><18>J<EFBFBD> <11>*<2A> <1D> <12>N<EFBFBD>N<EFBFBD>X<>Y_<59>X`<60>`b<>cm<63>bn<62>np<6E>q<> r<> <1A> <0F> <0A> <0A><0F><> <0A> <0C>s <00>AA<00>A"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 rr<00>fetchall<6C>list<73>pop<6F>append<6E>close) r!r<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 $)
Nr&r'rr(r)r*r+z<>
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!rr2r3r4r5r6r7r8r9r:s r<00>get_user_historyr>Js<><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><><00>[5n[U5n[R"USS9n[ U/U5nUSR 5U*SSSS2n[ SU5 UVs/sH
orUSPM nn[X5 U$s snf![a/n [R"SUS[U 535 Sn A gSn A ff=f)Nr)<01>axis<69><73><EFBFBD><EFBFBD><EFBFBD><EFBFBD>productzRecommendation error for user z: ) r;r><00>np<6E>meanr<00>argsortr<00>history_upload<61> 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<>recommended_products<74>es
r<00>get_recommendationsrTks<><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>=L<01>L<>O<EFBFBD>q<EFBFBD>Q<EFBFBD><0F><01> 2<>O<EFBFBD><1C>L<> <17>w<EFBFBD>0<>$<24>#<23><> M<01><> <15>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$B <00>&B<04>7B <00>B <00>
C<03>%B?<03>?Cc<00><><00>[5nUR5nUH+nUS-n[U5 URSUSUS35 M- UR 5 UR5 UR5 g![
a(n[SU35 UR 5 SnANNSnAff=f!UR5 UR5 f=f)NrzBINSERT INTO Recommendation (UserID, RecommendedProductID) VALUES (rrzError: )r rrrrrG<00>rollbackr1)r<00>anrrr!rr"r#rSs rrFrF<00>s<><00><00> <15>Z<EFBFBD>F<EFBFBD> <13>]<5D>]<5D>_<EFBFBD>F<EFBFBD><17><18>D<EFBFBD><1D><01><18>J<EFBFBD> <11>*<2A> <1D> <12>N<EFBFBD>N<EFBFBD>_<>`f<>_g<5F>gi<67>jt<6A>iu<69>uw<75>x<> y<> <19> <0F> <0A> <0A><0F> <0F> <0C> <0C><0E><0E> <0C> <0C><0E><> <15><1A> <0A><07><01>s<EFBFBD>m<EFBFBD><1C><0E><0F><0F><19><19><><1A><>
<0F> <0C> <0C><0E><0E> <0C> <0C><0E>s*<00>AA><00>>
B0<03>B+<03>&B3<00>+B0<03>0B3<00>3"C)<01>
)<10>mysql.connectorr<00>sklearn.metrics.pairwiser<00>numpyrCrH<00>unittestrr rr$r;r>rTrFrrr<00><module>r]s:<00><01><16>6<><12><0E><1B><19> <09> <0A>& <11>D<11>BL<01>8r