public function testTrainChanged() { $svm = new CM_SVM_Model(1); CMTest_TH::timeInit(); CMTest_TH::timeForward(10); $svm->addTraining(-1, array(1 => 1.0, 2 => 0.0)); $svm->addTraining(1, array(1 => 0.0, 2 => 1.0)); $this->assertNotSame(1, $svm->predict(array(1 => 0.0, 2 => 1.0))); CM_SVM_Model::trainChanged(); $svm = new CM_SVM_Model(1); $this->assertSame(1, $svm->predict(array(1 => 0.0, 2 => 1.0))); $svm->flush(); }
protected function _registerCallbacksLocal() { $this->_registerClockworkCallbacks('1 minute', array('CM_Cli_CommandManager::monitorSynchronizedCommands' => function () { $commandManager = new CM_Cli_CommandManager(); $commandManager->monitorSynchronizedCommands(); }, 'CM_SVM_Model::trainChanged' => function () { CM_SVM_Model::trainChanged(); })); }