Hello everyone again !
![]()
While going through the code for the get_relevant_products_from_query function, I noticed a few tiny details and wanted to kindly ask
for some clarification to make sure I understand the logic correctly. I suspect there might be a couple of minor bugs, but Iβd love to hear your thoughts! ![]()
Here is what I observed:
-
Duplicate Item: In the
importance_orderlist, the item'masterCategory'is written twice. I assume this is just a small typo?
importance_order = ['baseColour', 'masterCategory', 'usage', 'masterCategory', 'season', 'gender'] -
Filter Reduction Logic: In the loop where the code tries to broaden the search by reducing filters, the logic is:
filtered_filters = [x for x in filters if x.target not in importance_order[i+1:]]If I understand correctly, wheni=0, it excludes almost all targets and only keeps the first one ('baseColour'). Then, asiincreases, it starts adding the filters back. Doesnβt this mean it goes from the broadest search to the narrowest? Shouldnβt it ideally drop the least important filters one by one instead?
I might be completely wrong here, so please feel free to correct me! Just wanted to share my observations in case it helps improve the code.
Thanks again for the great course and for your time!
Happy learning to everyone! ![]()
