File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,32 +40,32 @@ Sometimes, it may be necessary to rename the value of the constants (According t
4040 const USER_ID = 'user_id'; //Foreign key
4141```
4242### Syntax Example
43- Didactic demonstration of the algorithm
43+ A simple didactic demonstration of the algorithm
4444``` php
45- $table = [
46- ['product_id' = 'A',
47- 'score' = 1,
48- 'user_id' = 'Pedro'
49- ],
50- ['product_id' = 'B',
51- 'score' = 1,
52- 'user_id' = 'Pedro'
53- ],
54- ['product_id' = 'A',
55- 'score' = 1,
56- 'user_id' = 'João'
57- ],
58- ['product_id' = 'B',
59- 'score' = 1,
60- 'user_id' = 'João'
61- ],
62- ['product_id' = 'C',
63- 'score' = 1,
64- 'user_id' = 'João'
65- ]
66- ];
67- use Tigo\Recommend; // import
68- $client = new Recommend();
69- print_r($client->ranking($table,"Pedro"));
45+ $table = [
46+ ['product_id'=> 'A',
47+ 'score'=> 1,
48+ 'user_id'=> 'Pedro'
49+ ],
50+ ['product_id'=> 'B',
51+ 'score'=> 1,
52+ 'user_id'=> 'Pedro'
53+ ],
54+ ['product_id'=> 'A',
55+ 'score'=> 1,
56+ 'user_id'=> 'João'
57+ ],
58+ ['product_id'=> 'B',
59+ 'score'=> 1,
60+ 'user_id'=> 'João'
61+ ],
62+ ['product_id'=> 'C',
63+ 'score'=> 1,
64+ 'user_id'=> 'João'
65+ ]
66+ ];
67+ use Tigo\Recommend; // import
68+ $client = new Recommend();
69+ print_r($client->ranking($table,"Pedro")); // result = ['C' => 2]
7070
7171```
You can’t perform that action at this time.
0 commit comments