![](/img/trans.png)
[英]Phpml\Exception\MatrixException Message: Matrix is singular
[英]PHPML library issue
我一直在努力讓 PHPML 庫工作,
我遵循的步驟:
<html> <head> <title>Test</title> </head> <body> <h1>Testing</h1> <table width = 100% > <tr> <?php use Phpml\\Classification\\NaiveBayes; require './vendor/autoload.php'; $samples = [[176, 70], [180, 80], [161, 45], [163, 47], [186, 86], [165, 49]]; $labels = ['a', 'b', 'a', 'b', 'a', 'b']; $classifier = new NaiveBayes(); $classifier->train($samples, $labels); print_r($classifier->predict([[172,40]])); ?> </tr> </table> </body> </html>
當我嘗試瀏覽頁面時,我面臨的問題如下:
Testing
Fatal error: Uncaught Error: Class 'Phpml\Classification\NaiveBayes' not found in /home4/ab12960/reviewsclassification.com/test.php:17 Stack trace: #0 {main} thrown in /home4/ab12960/reviewsclassification.com/test.php on line 17
我感謝幫助
問候,
在使用命名空間之前加載供應商文件,例如,
<?php
require './vendor/autoload.php';
use Phpml\Classification\NaiveBayes;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.