PHP Class Camspiers\StatisticalClassifier\Classifier\ComplementNaiveBayes

This classifier is based off *Tackling the Poor Assumptions of Naive Bayes Text Classifiers* by Jason Rennie
Author: Cam Spiers ([email protected])
Inheritance: extends Classifier
Show file Open project: camspiers/statistical-classifier Class Usage Examples

Protected Properties

Property Type Description
$documentNormalizer Camspiers\StatisticalClassifier\Normalizer\Document\NormalizerInterface Takes document and makes it consistent
$tokenNormalizer Camspiers\StatisticalClassifier\Normalizer\Token\NormalizerInterface Takes tokenized data and makes it consistent or stem it
$tokenizer Camspiers\StatisticalClassifier\Tokenizer\TokenizerInterface Tokenizer (the way of breaking up documents)

Public Methods

Method Description
__construct ( Camspiers\StatisticalClassifier\DataSource\DataSourceInterface $dataSource, Camspiers\StatisticalClassifier\Model\ModelInterface $model = null, Camspiers\StatisticalClassifier\Normalizer\Document\NormalizerInterface $documentNormalizer = null, Camspiers\StatisticalClassifier\Tokenizer\TokenizerInterface $tokenizer = null, Camspiers\StatisticalClassifier\Normalizer\Token\NormalizerInterface $tokenNormalizer = null ) Create the Naive Bayes Classifier
classify ( $document )
prepareModel ( )

Method Details

__construct() public method

Create the Naive Bayes Classifier
public __construct ( Camspiers\StatisticalClassifier\DataSource\DataSourceInterface $dataSource, Camspiers\StatisticalClassifier\Model\ModelInterface $model = null, Camspiers\StatisticalClassifier\Normalizer\Document\NormalizerInterface $documentNormalizer = null, Camspiers\StatisticalClassifier\Tokenizer\TokenizerInterface $tokenizer = null, Camspiers\StatisticalClassifier\Normalizer\Token\NormalizerInterface $tokenNormalizer = null )
$dataSource Camspiers\StatisticalClassifier\DataSource\DataSourceInterface
$model Camspiers\StatisticalClassifier\Model\ModelInterface An model to store data in
$documentNormalizer Camspiers\StatisticalClassifier\Normalizer\Document\NormalizerInterface The normalizer to make document consistent
$tokenizer Camspiers\StatisticalClassifier\Tokenizer\TokenizerInterface The tokenizer to break up the documents
$tokenNormalizer Camspiers\StatisticalClassifier\Normalizer\Token\NormalizerInterface The normaizer to make tokens consistent

classify() public method

public classify ( $document )

prepareModel() public method

public prepareModel ( )

Property Details

$documentNormalizer protected property

Takes document and makes it consistent
protected NormalizerInterface,Camspiers\StatisticalClassifier\Normalizer\Document $documentNormalizer
return Camspiers\StatisticalClassifier\Normalizer\Document\NormalizerInterface

$tokenNormalizer protected property

Takes tokenized data and makes it consistent or stem it
protected NormalizerInterface,Camspiers\StatisticalClassifier\Normalizer\Token $tokenNormalizer
return Camspiers\StatisticalClassifier\Normalizer\Token\NormalizerInterface

$tokenizer protected property

Tokenizer (the way of breaking up documents)
protected TokenizerInterface,Camspiers\StatisticalClassifier\Tokenizer $tokenizer
return Camspiers\StatisticalClassifier\Tokenizer\TokenizerInterface