定制 fieg/bayes 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

fieg/bayes

最新稳定版本:1.0.3

Composer 安装命令:

composer require fieg/bayes

包简介

Implementation of Naive Bayes Classifier algorithm in PHP.

README 文档

README

Implementation of Naive Bayes Classifier algorithm in PHP.

Based on Machine Learning: Naive Bayes Document Classification Algorithm in Javascript by Burak Kanber.

Build Status

Getting started

use Fieg\Bayes\Classifier;
use Fieg\Bayes\Tokenizer\WhitespaceAndPunctuationTokenizer;

$tokenizer = new WhitespaceAndPunctuationTokenizer();
$classifier = new Classifier($tokenizer);

$classifier->train('en', 'This is english');
$classifier->train('fr', 'Je suis Hollandais');

$result = $classifier->classify('This is a naive bayes classifier');

Which would result in:

array(2) {
  'en' =>
  double(0.9)
  'fr' =>
  double(0.1)
}

统计信息

  • 总下载量: 93.15k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 73
  • 点击次数: 2
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 70
  • Watchers: 6
  • Forks: 16
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2014-01-22