2 // $Id: CustomPrefs.php 7967 2011-03-07 13:08:01Z vargenau $
5 * Custom UserPreferences:
6 * A list of name => _UserPreference class pairs.
7 * Rationale: Certain themes should be able to extend the predefined list
8 * of preferences. Display/editing is done in the theme specific userprefs.tmpl
9 * but storage/sanification/update/... must be extended to the Get/SetPreferences methods.
11 * This is just at alpha stage, a recommendation to the wikilens group.
14 class _UserPreference_recengine // recommendation engine method
15 extends _UserPreference
17 var $valid_values = array('php','mysuggest','mymovielens','mycluto');
18 var $default_value = 'php';
20 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) {
39 if (!in_array($value, $this->valid_values)) return $this->default_value;
44 class _UserPreference_recnnbr // recommendation engine key clustering, neighborhood size
45 extends _UserPreference_numeric{};
47 $WikiTheme->customUserPreferences
50 'recengine' => new _UserPreference_recengine('php'),
51 'recalgo' => new _UserPreference_recalgo('itemProb'),
52 //recnnbr: typically 15-30 for item-based, 40-80 for user-based algos
53 'recnnbr' => new _UserPreference_recnnbr(10,14,80),
60 // c-hanging-comment-ender-p: nil
61 // indent-tabs-mode: nil