recommenders/examples
miguelgfierro fe13790270 Note in notebook
Signed-off-by: miguelgfierro <miguelgfierro@users.noreply.github.com>
2024-06-29 20:41:25 +02:00
..
00_quick_start breaking change in sklearn in log_loss 💥💥 2024-06-03 16:58:06 +02:00
01_prepare_data 📝 remove papermill and scrapbook references 2023-12-23 10:11:33 +01:00
02_model_collaborative_filtering Note in notebook 2024-06-29 20:41:25 +02:00
02_model_content_based_filtering Merge pull request #2031 from recommenders-team/miguel/programmatic_execution_notebook 2023-12-18 16:04:17 +01:00
03_evaluate Update new programmatic execution code 2023-10-31 12:21:56 +01:00
04_model_select_and_optimize 📝 2023-12-23 10:08:59 +01:00
05_operationalize Update license 2023-08-26 07:01:28 +02:00
06_benchmarks Update fastai usage in utils 2024-03-15 11:03:48 +08:00
07_tutorials/KDD2020-tutorial Update license 2023-08-26 07:01:28 +02:00
README.md Update hybrid to CF 2023-12-29 09:08:29 +01:00
run_notebook_on_azureml.ipynb Update license 2023-08-26 07:01:28 +02:00
template.ipynb Update notebooks with new utility 2023-10-31 12:41:19 +01:00

README.md

Recommender notebooks

This folder contains examples and best practices, written in Jupyter notebooks, for building recommendation systems.

The diagram below depicts how the best-practice examples help researchers / developers in the recommendation system development workflow.

workflow

Summary

The following summarizes each directory of the best practice notebooks.

Directory Runs Local Description
00_quick_start Yes Quick start notebooks that demonstrate workflow of developing a recommender by using an algorithm in local environment
01_prepare_data Yes Data preparation notebooks for each recommender algorithm
02_model_collaborative_filtering Yes Deep dive notebooks about model training and evaluation using collaborative filtering algorithms
02_model_content_based_filtering Yes Deep dive notebooks about model training and evaluation using content-based filtering algorithms
03_evaluate Yes Notebooks that introduce different evaluation methods for recommenders
04_model_select_and_optimize Some local, some on Azure Best practice notebooks for model tuning and selecting by using Azure Machine Learning Service and/or open source technologies
05_operationalize No, Run on Azure Operationalization notebooks that illustrate an end-to-end pipeline by using a recommender algorithm for a certain real-world use case scenario
06_benchmarks Yes Benchmark comparison of several recommender algorithms
07_tutorials Yes Tutorials for using the Recommenders library

On-premise notebooks

The notebooks that do not require Azure can be run out-of-the-box on any Linux machine, where an environment is properly set up by following the instructions.

NOTE Some of the notebooks may rely on heterogeneous computing instances like a cluster of CPU machines with Spark framework installed or machines with GPU devices incorporated. It is therefore recommended to run these notebooks on a Data Science Virtual Machine for Linux (Ubuntu), where a single-node Spark and/or GPU device are pre-configured.

Azure-enhanced notebooks

Azure products and services are used in certain notebooks to enhance the efficiency of developing recommender systems in scale.

To successfully run these notebooks, the users need an Azure subscription or can use Azure for free. The Azure products featured in the notebooks include:

  • Azure Machine Learning service - Azure Machine Learning service is a cloud service used to train, deploy, automate, and manage machine learning models, all at the broad scale that the cloud provides. It is used intensively across various notebooks for the AI model development related tasks like:
    • Hyperparameter tuning
    • Tracking and monitoring metrics to enhance the model creation process
    • Scaling up and out on Compute like DSVM and Azure Machine Learning Compute
    • Deploying a web service to Azure Kubernetes Service
    • Submitting pipelines
  • Azure Data Science Virtual Machine - Azure Data Science Virtual Machine is mainly used for a remote server where user can easily configure the local as well as the cloud environment for running the example notebooks.
  • Azure Cosmos DB - Cosmos DB is used for preserving data. This is demonstrated in the operationalization example where recommendation results generated from a model are preserved in Cosmos DB for real-time serving purpose.
  • Azure Databricks - Azure Databricks is mainly used for developing Spark based recommenders such as Spark ALS algorithm, in a distributed computing environment.
  • Azure Kubernetes Service - Azure Kubernetes Service is used for serving a recommender model or consuming the results generated from a recommender for a application service.

There may be other Azure service or products used in the notebooks. Introduction and/or reference of those will be provided in the notebooks.

Submit an existing notebook to Azure Machine Learning

The run_notebook_on_azureml notebook provides a scaffold to directly submit an existing notebook to AzureML compute targets. After setting up a compute target and creating a run configuration, simply replace the notebook file name and submit the notebook directly.

cfg = NotebookRunConfig(source_directory='../',
                            notebook='examples/00_quick_start/' + NOTEBOOK_NAME,
                            output_notebook='outputs/out.ipynb',
                            parameters={"MOVIELENS_DATA_SIZE": "100k", "TOP_K": 10},
                            run_config=run_config)

All metrics and parameters logged with store_metadata will be stored on the run as tracked metrics. The initial notebook that was submitted, will be stored as an output notebook out.ipynb in the outputs tab of the Azure Portal.