Skip to content

Commit 9c9243a

Browse files
vpollo11Oumaimafisaoui
authored andcommitted
docs (matrix-factorization): fix prettier fmt
1 parent d812b25 commit 9c9243a

File tree

2 files changed

+45
-37
lines changed

2 files changed

+45
-37
lines changed

subjects/ai/matrix-factorization/README.md

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -43,42 +43,45 @@ The goal of this project is to understand and apply advanced matrix factorizatio
4343
2. Provide visual comparisons between the models using **matplotlib** to plot predicted vs. actual ratings.
4444
3. Save consolidated evaluation results as JSON:
4545
`reports/model_metrics.json`
46-
46+
4747
Example format:
48-
```json
49-
{
50-
"SVD_RMSE": 0.91,
51-
"PMF_RMSE": 0.85,
52-
"PMF_vs_SVD_improvement_%": 6.6
53-
}
54-
```
55-
* Generate and save comparison plots:
56-
* Predicted vs Actual ratings: `reports/predicted_vs_actual.png`
57-
* RMSE comparison (bar chart): `reports/rmse_comparison.png`
58-
59-
* Minimum expected performance:
60-
* SVD RMSE ≤ 0.90
61-
* PMF RMSE ≤ 0.85
62-
* PMF improvement ≥ 5% over SVD
48+
49+
```json
50+
{
51+
"SVD_RMSE": 0.91,
52+
"PMF_RMSE": 0.85,
53+
"PMF_vs_SVD_improvement_%": 6.6
54+
}
55+
```
56+
57+
- Generate and save comparison plots:
58+
- Predicted vs Actual ratings: `reports/predicted_vs_actual.png`
59+
- RMSE comparison (bar chart): `reports/rmse_comparison.png`
60+
- Minimum expected performance:
61+
- SVD RMSE ≤ 0.90
62+
- PMF RMSE ≤ 0.85
63+
- PMF improvement ≥ 5% over SVD
6364

6465
#### Recommendation Generation
6566

6667
1. Implement a function that generates movie recommendations for a user based on the predicted ratings from both the SVD and PMF models.
6768
2. Display top-rated movies for users and compare recommendations from both models.
6869
3. Implement in `utils/recommendation.py`:
69-
```python
70-
def generate_recommendations(user_id, model, top_n=10):
71-
...
72-
```
70+
71+
```python
72+
def generate_recommendations(user_id, model, top_n=10):
73+
...
74+
```
75+
7376
4. Save the top-10 recommendations for each evaluated user in `reports/user_<id>_recommendations.csv`
7477

7578
#### Analysis and Visualization
7679

7780
1. Provide visualizations comparing SVD and PMF predictions for the same user.
7881
2. Offer insights into how the models differ in recommending movies for specific users based on their ratings history.
7982
3. Save the following plots under `reports/`:
80-
* `user_comparison.png` — SVD vs PMF predictions for a selected user
81-
* `top_recommendations.png` — Histogram (or bar chart) of top recommended movies
83+
- `user_comparison.png` — SVD vs PMF predictions for a selected user
84+
- `top_recommendations.png` — Histogram (or bar chart) of top recommended movies
8285

8386
#### Streamlit Dashboard
8487

subjects/ai/matrix-factorization/audit/README.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
###### Do the core files exist: `app.py`, `models/svd_model.py`, `models/pmf_model.py`, and `utils/recommendation.py`?
1212

1313
###### Do the main dependencies import without error?
14+
1415
```bash
1516
python -c "import numpy, pandas, scipy, streamlit, matplotlib"
1617
```
@@ -54,19 +55,21 @@ python -c "import numpy, pandas, scipy, streamlit, matplotlib"
5455
###### Is there a justification for when to stop training based on the learning curves?
5556

5657
###### Does `reports/model_metrics.json` exist with fields:
57-
```json
58-
{
59-
"SVD_RMSE": ...,
60-
"PMF_RMSE": ...,
61-
"PMF_vs_SVD_improvement_%": ...
62-
}
63-
```
58+
59+
```json
60+
{
61+
"SVD_RMSE": ...,
62+
"PMF_RMSE": ...,
63+
"PMF_vs_SVD_improvement_%": ...
64+
}
65+
```
6466

6567
###### Are the following thresholds met?
66-
* SVD RMSE ≤ 0.90
67-
* PMF RMSE ≤ 0.85
68-
* PMF improvement ≥ 5%
69-
* Are the plots saved? `reports/rmse_comparison.png` and `reports/predicted_vs_actual.png`.
68+
69+
- SVD RMSE ≤ 0.90
70+
- PMF RMSE ≤ 0.85
71+
- PMF improvement ≥ 5%
72+
- Are the plots saved? `reports/rmse_comparison.png` and `reports/predicted_vs_actual.png`.
7073

7174
##### Recommendation Generation
7275

@@ -75,6 +78,7 @@ python -c "import numpy, pandas, scipy, streamlit, matplotlib"
7578
###### Does the recommendation system return the top 10 movie recommendations for a given user?
7679

7780
###### Does `utils/recommendation.py` expose:
81+
7882
```python
7983
def generate_recommendations(user_id, model, top_n=10):
8084
...
@@ -99,10 +103,11 @@ def generate_recommendations(user_id, model, top_n=10):
99103
###### For the 2 users from the training set, is there an analysis of why the recommendations were accurate for one and less accurate for the other?
100104

101105
###### Are required visuals present in `reports/` with proper titles and labeled axes?
102-
* `pmf_convergence.png`
103-
* `rmse_comparison.png`
104-
* `predicted_vs_actual.png`
105-
* `user_comparison.png`
106+
107+
- `pmf_convergence.png`
108+
- `rmse_comparison.png`
109+
- `predicted_vs_actual.png`
110+
- `user_comparison.png`
106111

107112
##### Streamlit Dashboard
108113

0 commit comments

Comments
 (0)