Spaces:
Runtime error
Runtime error
Download src/popularity_model.py from Vineetha00/commerce-recommender: direct link, hf CLI and curl.
- Browser
- Download file 160 Bytes
-
https://huggingface.co/spaces/Vineetha00/commerce-recommender/resolve/main/src/popularity_model.py
- Command line
-
hf download hf://spaces/Vineetha00/commerce-recommender/src/popularity_model.py
-
curl -L -o popularity_model.py https://huggingface.co/spaces/Vineetha00/commerce-recommender/resolve/main/src/popularity_model.py
160 Bytes
| def get_top_n_popular_items(df, n=10): | |
| top = df['product_id'].value_counts().head(n).reset_index() | |
| top.columns = ['product_id', 'count'] | |
| return top | |