Skip to content

Commit 43fcdfa

Browse files
committed
recommendation doc update
1 parent 5693bf6 commit 43fcdfa

File tree

2 files changed

+73
-10
lines changed

2 files changed

+73
-10
lines changed

docs/source/user_guide/operators/recommender_operator/index.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ This operator is ideal for a variety of applications, including:
3838
- **Streaming Services**: Suggesting movies, TV shows, or music based on user viewing or listening habits.
3939
- **Content Platforms**: Proposing articles, blogs, or news stories tailored to user interests.
4040

41-
**Recommender Documentation**
42-
43-
This documentation will delve into these concepts comprehensively, showcasing how to utilize the versatility and adaptability of the recommender operator within the Python library module to build recommendation systems.
44-
4541
.. versionadded:: 2.11.14
4642

4743
.. toctree::

docs/source/user_guide/operators/recommender_operator/quickstart.rst

Lines changed: 73 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,58 @@ Initialize your recommender job through the ads cli command:
2121
ads operator init -t recommender
2222
2323
24-
Input Data
25-
-----------
24+
Prepare Input Data
25+
-------------------
26+
27+
The Recommender Operator requires three essential input files:
28+
29+
1. **Users File**: Contains user information.
30+
2. **Items File**: Contains item information.
31+
3. **Interactions File**: Interactions between users and items.
32+
33+
Sample Data
34+
===========
35+
36+
**users.csv**:
37+
38+
========= === ====== ============ =========
39+
user_id age gender occupation zip_code
40+
========= === ====== ============ =========
41+
1 24 M technician 85711
42+
2 53 F other 94043
43+
3 23 M writer 32067
44+
4 24 M technician 43537
45+
5 33 F other 15213
46+
========= === ====== ============ =========
47+
48+
**items.csv**:
49+
50+
=========== ================= ============ ====== ========= ========== ========
51+
movie_id movie_title release_date Action Adventure Animation Children
52+
=========== ================= ============ ====== ========= ========== ========
53+
1 Toy Story (1995) 01-Jan-1995 0 0 1 1
54+
2 GoldenEye (1995) 01-Jan-1995 1 1 0 0
55+
3 Four Rooms (1995) 01-Jan-1995 0 0 0 0
56+
4 Get Shorty (1995) 01-Jan-1995 1 0 0 0
57+
=========== ================= ============ ====== ========= ========== ========
58+
59+
**interactions.csv**:
60+
61+
======= ========= ====== ============
62+
user_id movie_id rating timestamp
63+
======= ========= ====== ============
64+
2 1 3 881250949
65+
4 2 3 891717742
66+
3 3 1 878887116
67+
1 4 2 880606923
68+
5 2 1 886397596
69+
2 3 4 884182806
70+
4 1 2 881171488
71+
======= ========= ====== ============
72+
73+
74+
Configure the YAML File
75+
----------------------
2676

2777
Within the ``recommender`` folder created above there will be a ``recommender.yaml`` file. This file should be updated to contain the details about your data and recommender.
2878

@@ -49,8 +99,8 @@ Within the ``recommender`` folder created above there will be a ``recommender.ya
4999
interaction_column: rating
50100
51101
52-
Run
53-
---
102+
Run the Recommender Operator
103+
----------------------------
54104

55105
Now run the recommender job locally:
56106

@@ -62,8 +112,25 @@ Now run the recommender job locally:
62112
Results
63113
-------
64114

65-
If not specified in the YAML, all results will be placed in a new folder called ``results``. Performance is summarized in the ``report.html`` file.
115+
If not specified in the YAML, all results will be placed in a new folder called ``results``. Performance is summarized in the ``report.html`` file, and the recommendation results can be found in results/recommendations.csv.
66116

67117
.. code-block:: bash
68118
69-
open results/report.html
119+
vi results/recommendations.csv
120+
open results/report.html
121+
122+
Example Output (recommendations.csv):
123+
====================================
124+
125+
======= ========= ======
126+
user_id movie_id rating
127+
======= ========= ======
128+
1 1 4.9424
129+
1 2 4.7960
130+
1 3 4.7314
131+
1 4 4.6951
132+
2 1 4.7893
133+
2 2 4.7870
134+
2 3 4.7624
135+
2 4 4.6802
136+
======= ========= ======

0 commit comments

Comments
 (0)