public function __construct($config)
 {
     $this->dm = GlassDatabaseManager::getInstance();
     $this->name = $config['name'];
     if ($this->name == KEY_LINK_JACCARD) {
         if (isset($config['jaccard'])) {
             $this->jaccard = $config['jaccard'];
         } else {
             echo "warning: jaccard is not set <br/>";
             $this->jaccard = 0.2;
         }
     } else {
         if ($this->name == KEY_LINK_COSINE) {
             if (isset($config['cosine'])) {
                 $this->cosine = $config['cosine'];
             } else {
                 echo "warning: cosine is not set <br/>";
                 $this->cosine = 0.2;
             }
         }
     }
     if ($this->name != KEY_NO_EXPANSION) {
         if (isset($config['expand_weight'])) {
             $this->expand_weight = $config['expand_weight'];
             assert('$this->expand_weight > 0 && $this->expand_weight <= 1');
         } else {
             echo "warning: expand_weight is not set <br/>";
             $this->expand_weight = 0.1;
         }
     }
     $this->lock = false;
     $this->hottestItems = array();
 }
 public function __construct($config)
 {
     $this->dm = GlassDatabaseManager::getInstance();
     $this->rawDataProcessor = new GlassRawDataProcessor();
     $this->system = new KeywordRecommenderSystem();
     $this->topN = $config['topN'];
     $this->recommenders = array();
     $total_weight = 0;
     foreach ($config['recommenders'] as $key => $recommender) {
         $recommender_name = $recommender['name'];
         $this->recommenders[$key] = new $recommender_name($recommender['config']);
         $this->system->addRecommender($key, $recommender['weight'], $this->recommenders[$key]);
         $total_weight += $recommender['weight'];
     }
     assert("{$total_weight} == 1");
     $this->splitters = array();
     foreach ($config['splitters'] as $key => $splitter) {
         $splitter_name = $splitter['name'];
         $this->splitters[$key] = new $splitter_name($splitter['config']);
     }
     $this->evaluators = array();
     foreach ($config['evaluators'] as $key => $evaluator) {
         $evaluator_name = $evaluator['name'];
         $this->evaluators[$key] = new $evaluator_name($evaluator['config']);
     }
 }
 public static function getInstance()
 {
     if (!self::$dm) {
         self::$dm = new self();
     }
     return self::$dm;
 }
示例#4
0
 public function __construct($config)
 {
     $this->dm = GlassDatabaseManager::getInstance();
     $this->hit_threshold = $config['hit_threshold'];
     if (!isset($this->hit_threshold)) {
         $this->hit_threshold = 1;
         echo 'Dude, give me [hit_threshold] param';
         flush();
         ob_flush();
     }
 }
 public function __construct($config)
 {
     $this->dm = GlassDatabaseManager::getInstance();
     $this->keyword_recommender = new KeywordRecommender(array('name' => '', 'jaccard' => 0.001));
     $this->min_support = $config['min_support'];
     if (!isset($this->min_support)) {
         echo 'Dude, give me [min_support] param';
         flush();
         ob_flush();
     }
     $this->hottestItems = array();
 }
 public function __construct($config)
 {
     $this->dm = GlassDatabaseManager::getInstance();
     $this->iteration_count = 0;
     $this->k = $config['k_fold'];
     if (!isset($this->k)) {
         $this->k = 10;
         echo 'Dude, give me [k_fold] param<br/>';
         flush();
         ob_flush();
     }
 }
 public function __construct($argArray = '')
 {
     $this->dm = GlassDatabaseManager::getInstance();
     $this->name = $argArray['name'];
     if ($this->name == KEY_LINK_JACCARD && key_exists('jaccard', $argArray)) {
         $this->jaccard = $argArray['jaccard'];
     } else {
         if ($this->name == KEY_LINK_JACCARD && !key_exists('jaccard', $argArray)) {
             echo "warning: jaccard is not set<br />";
         } else {
             $this->jaccard = 0.2;
         }
     }
     $this->lock = false;
 }
 public function __construct($config)
 {
     $this->dm = GlassDatabaseManager::getInstance();
     $this->trainPercentage = $config['train_percentage'];
     $this->testPercentage = $config['test_percentage'];
     if (!isset($this->trainPercentage)) {
         $this->trainPercentage = 0.7;
         echo 'Dude, give me [train_percentage] param<br/>';
         flush();
         ob_flush();
     }
     if (!isset($this->testPercentage)) {
         $this->testPercentage = 0.3;
         echo 'Dude, give me [test_percentage] param<br/>';
         flush();
         ob_flush();
     }
 }
 public function __construct($config)
 {
     $this->dm = GlassDatabaseManager::getInstance();
 }
 public function __construct()
 {
     $this->dm = GlassDatabaseManager::getInstance();
     $this->qe = new GlassQueryExtractor();
     $this->delimiter = " ";
 }
示例#11
0
<?php

include_once "../database/glass-database-manager.php";
$dm = GlassDatabaseManager::getInstance();
$result = $dm->query('Select COUNT(*) from query_train;');
$row = mysql_fetch_array($result);
echo $row[0];
echo 1 / 2;
echo 'aaaa' . 12.2;
 public function __construct($config)
 {
     $this->dm = GlassDatabaseManager::getInstance();
     $this->hottestItems = array();
 }