本文整理汇总了PHP中Matrix::correlation方法的典型用法代码示例。如果您正苦于以下问题:PHP Matrix::correlation方法的具体用法?PHP Matrix::correlation怎么用?PHP Matrix::correlation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix
的用法示例。
在下文中一共展示了Matrix::correlation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: computeSimilarityMemory
protected function computeSimilarityMemory()
{
// data is already loaded by $this->loadDirectMatrix()
watchdog('recommender', "Computing similarity scores in memory. Could be CPU resource intensive. Please be patient");
$this->similarityMatrix = Matrix::correlation($this->directMatrix);
// cleanaup
$this->saveSimilarityMatrix($this->lowerbound);
$this->purgeOutdatedRecords('similarity');
if ($this->sim_pred == FALSE) {
$this->cleanupMemory();
}
}
示例2: computeSimilarity
protected function computeSimilarity()
{
// regardless of the type of preferenceMatrix, similarityMatrix will be a "SparseMatrix".
$this->similarityMatrix = Matrix::correlation($this->preferenceMatrix);
}