@@ -24,8 +24,8 @@ Recommend a product using collaborative filtering
2424 **/
2525 use Tigo\Recommend; // import class
2626 $client = new Recommend();
27- $client->ranking($table,$user) // It is recommended to use "rating: liked and disliked"
28- $client->euclidean($table,$user,0); // It is recommended to use this algorithm in "star-based rating"
27+ $client->ranking($table,$user)
28+ $client->euclidean($table,$user,0);
2929```
3030
3131### Configuration
@@ -42,6 +42,10 @@ Sometimes, it may be necessary to rename the value of the constants (According t
4242### Syntax Example
4343A simple didactic demonstration of the algorithm
4444``` php
45+ /**
46+ Example using "rating: liked and disliked"
47+ like: score = 1; dislike: score = 0
48+ **/
4549 $table = [
4650 ['product_id'=> 'A',
4751 'score'=> 1,
@@ -64,8 +68,9 @@ A simple didactic demonstration of the algorithm
6468 'user_id'=> 'João'
6569 ]
6670 ];
67- use Tigo\Recommend; // import
71+ use Tigo\Recommend; // import class
6872 $client = new Recommend();
6973 print_r($client->ranking($table,"Pedro")); // result = ['C' => 2]
70-
74+ print_r($client->euclidean($table,"Pedro", 0)); // result = ['C' => 1]
75+ print_r($client->euclidean($table,"Pedro", 2)); // result = [] ;
7176```
0 commit comments