The project is organized into the following key components:
The project is organized into the following key components:
###Configuration and Constants
###Configuration and Constants
1.**configs.py**
1.**configs.py**
- This code defines an EvalConfig class that stores configurations for evaluating multiple recommendation models. It specifies a list of models, each with its name, class, and parameters. Metrics are defined to evaluate model performance under different scenarios: split evaluation, Leave-One-Out, and on the entire dataset. Other parameters include test set size and number of recommendations to consider.
- This code defines an EvalConfig class that stores configurations for evaluating multiple recommendation models. It specifies a list of models, each with its name, class, and parameters. Metrics are defined to evaluate model performance under different scenarios: split evaluation, Leave-One-Out, and on the entire dataset. Other parameters include test set size and number of recommendations to consider.
2.**constants.py**
2.**constants.py**
- This code defines a Constant class that stores paths to datasets and column names for content and evidence data. Paths to content, evidence, and evaluation directories are defined based on the data directory path. File names and column names for article and rating data are specified, along with the rating scale.
- This code defines a Constant class that stores paths to datasets and column names for content and evidence data. Paths to content, evidence, and evaluation directories are defined based on the data directory path. File names and column names for article and rating data are specified, along with the rating scale.
###Data Loaders
3.**loaders.py**
3.**loaders.py**
- This code loads rating and item data from specified CSV files in the Constant class of the constants module. The load_ratings function loads rating data, and the load_items function loads item data. Another function, export_evaluation_report, merges rating and item data, then exports the evaluation report to a CSV file. The data is loaded into pandas DataFrames, with an option available to load rating data in the format expected by the Surprise library if needed.
- Loads rating and item data from specified CSV files in the Constant class of the constants module.
- The `load_ratings` function loads rating data.
- The `load_items` function loads item data.
- The `export_evaluation_report` function merges rating and item data, then exports the evaluation report to a CSV file.
- The data is loaded into pandas DataFrames, with an option available to load rating data in the format expected by the Surprise library if needed.
###Recommender Models
4.**models.py**
4.**models.py**
- This code defines several basic recommendation algorithms for the Surprise library. The get_top_n function takes a list of predictions and returns the top recommendations for each user. Recommendation algorithms are defined as classes inheriting from Surprise's AlgoBase class, each implementing an estimate method to predict user ratings for items.
- Defines several basic recommendation algorithms for the Surprise library.
=======
- The get_top_n function takes a list of predictions and returns the top recommendations for each user.
-
Recommendation algorithms are defined as classes inheriting from Surprise's AlgoBase class, each implementing an estimate method to predict user ratings for items.=======
Ces codes se trouveront dans le même dossier que chacun des jupyter notebook (.ipynb).
Ces codes se trouveront dans le même dossier que chacun des jupyter notebook (.ipynb).