interview task: break down a notebook into a portable, collaborative & easily deployable project.
The initial project is a recommendation tool that is ready to be deployed.
Taking this example, we would like to deploy it server-side on our PostgreSQL server by embedding it into a simple python function.
To deploy it according to the best practice we'll break it down into a nbdev project. This will allow us to continue developing the core components of our recommendations with collaborative jupyter notebooks :
- features_store notebooks : for getting cleaned data & features for our recommendations
- similarities notebooks : where we develop the notions of similarity for our recommendations
- recommendation: the way we deploy/access our recommendations
pip install -e .
Getting the recommendation for user_id 999
with the dot_product_similarity
from moviesrec.features_store import movies , ratings , users , genre_and_title_cols , genre_cols
from moviesrec.similarities import dot_product_similarity
from moviesrec.recommendation import get_recommendations
get_recommendations(user_id=999 , similarity = dot_product_similarity(movies[genre_cols]))