为什么PHP机器学习(PhpML)中的SVC分类器不起作用?

时间:2019-08-28 12:19:04

标签: machine-learning svm

我完全困惑为什么在php机器学习中使用SVC进行分类会引发错误。在重新安装操作系统之前,它一直在工作。我在Windows 10上,我使用作曲家下载了PhpML库。如图所示,即使是测试SVC分类器的最简单示例也无法使用该错误。SVC Error

use Phpml\Regression\SVR;
use Phpml\SupportVectorMachine\Kernel;
use Phpml\Association\Apriori;
use Phpml\Classification\SVC;
$samples = [[1, 3], [1, 4], [2, 4], [3, 1], [4, 1], [4, 2]];
$labels = ['a', 'a', 'a', 'b', 'b', 'b'];

$classifier = new SVC(Kernel::LINEAR, $cost = 1000);
$classifier->train($samples, $labels);
echo $classifier->predict([3, 2]);

`

0 个答案:

没有答案