in 11-recommendation/helper_functions.py [0:0]
def get_propensity_recommendations() -> List[Dict[str, Any]]:
"""
Mocks the behavior of a propensity scoring algorithm by returning a list of recommended products.
:return: A list of recommended product dictionaries.
"""
logger.info(f"Generating dummy propensity recommendations for user:")
# Dummy recommendation pool
recommended_products = [
{
"id": "3551ddc5-791d-4041-b531-61b170ce7afd",
"product_name": "EmberGlow Fire Pit",
"category": "Outdoor: Fire Pits",
"price": 274.83,
"predicted_score": 0.87
},
{
"id": "8d2f5bd2-ed64-4aec-8c7a-540d696ce8d0",
"product_name": "Terrain Tamer Vacuum",
"category": "Cleaning: Vacuum Cleaners",
"price": 169.19,
"predicted_score": 0.97
},
{
"id": "86e28c57-2e74-4096-8308-280d333b3706",
"product_name": "Starlight Hanging Pendant",
"category": "Electrical: Lighting Fixtures",
"price": 83.48,
"predicted_score": 0.89
},
{
"id": "eccbc6d7-82d2-46fd-93ce-697773b052da",
"product_name": "Nomad Grill Station",
"category": "Outdoor: Grills and Outdoor Cooking",
"price": 430.29,
"predicted_score": 0.8
},
{
"id": "9c9b7b07-fa1c-47c9-8168-1824faf31d45",
"product_name": "Quick-Install Gazebo Support",
"category": "Hardware: Brackets and Supports",
"price": 377.87,
"predicted_score": 0.85
},
{
"id": "190ec085-9b85-4cef-9de3-c0a7200ff0a3",
"product_name": "Telescoping Pruner",
"category": "Tools: Garden Tools",
"price": 488.71,
"predicted_score": 0.89
},
{
"id": "f76752f8-bb1d-47ea-b863-f09c8ebf8e99",
"product_name": "Nimbus Outdoor Ceiling Fixture",
"category": "Electrical: Lighting Fixtures",
"price": 420.41,
"predicted_score": 1.0
},
{
"id": "f1e4b7ec-1159-4600-a17e-e817f6fa6c83",
"product_name": "RuggedGrip Self-Locking Hook",
"category": "Hardware: Locks and Latches",
"price": 40.84,
"predicted_score": 0.83
}
]
# Filter recommendations based on purchased categories
logger.info(f"Recommended {len(recommended_products)} products based on past purchases.")
return recommended_products