4 * Custom UserPreferences:
5 * A list of name => _UserPreference class pairs.
6 * Rationale: Certain themes should be able to extend the predefined list
7 * of preferences. Display/editing is done in the theme specific userprefs.tmpl
8 * but storage/sanification/update/... must be extended to the Get/SetPreferences methods.
10 * This is just at alpha stage, a recommendation to the wikilens group.
13 class _UserPreference_recengine // recommendation engine method
14 extends _UserPreference
16 var $valid_values = array('php', 'mysuggest', 'mymovielens', 'mycluto');
17 var $default_value = 'php';
19 function sanify($value)
21 if (!in_array($value, $this->valid_values)) return $this->default_value;
26 class _UserPreference_recalgo // recommendation engine algorithm
27 extends _UserPreference
29 var $valid_values = array
31 'itemCos', // Item-based Top-N recommendation algorithm with cosine-based similarity function
32 'itemProb', // Item-based Top-N recommendation algorithm with probability-based similarity function.
33 // This algorithms tends to outperform the rest.
34 'userCos', // User-based Top-N recommendation algorithm with cosine-based similarity function.
35 'bayes'); // Naïve Bayesian Classifier
36 var $default_value = 'itemProb';
38 function sanify($value)
40 if (!in_array($value, $this->valid_values)) return $this->default_value;
45 class _UserPreference_recnnbr // recommendation engine key clustering, neighborhood size
46 extends _UserPreference_numeric
50 $WikiTheme->customUserPreferences
53 'recengine' => new _UserPreference_recengine('php'),
54 'recalgo' => new _UserPreference_recalgo('itemProb'),
55 //recnnbr: typically 15-30 for item-based, 40-80 for user-based algos
56 'recnnbr' => new _UserPreference_recnnbr(10, 14, 80),
63 // c-hanging-comment-ender-p: nil
64 // indent-tabs-mode: nil