PHP 클래스 Camspiers\StatisticalClassifier\Classifier\SVM

저자: Cam Spiers ([email protected])
상속: extends Classifier
파일 보기 프로젝트 열기: camspiers/statistical-classifier 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$documentNormalizer Camspiers\StatisticalClassifier\Normalizer\Document\NormalizerInterface Takes document and makes it consistent
$threshold float | boolean
$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)

공개 메소드들

메소드 설명
__construct ( Camspiers\StatisticalClassifier\DataSource\DataSourceInterface $dataSource, SVMModel $model = null, Camspiers\StatisticalClassifier\Normalizer\Document\NormalizerInterface $documentNormalizer = null, Camspiers\StatisticalClassifier\Tokenizer\TokenizerInterface $tokenizer = null, Camspiers\StatisticalClassifier\Normalizer\Token\NormalizerInterface $tokenNormalizer = null, SVM $svm = null, null $threshold = null )
classify ( $document )
getProbabilities ( string $document ) : array Returns the probabilities of the document being in each category
prepareModel ( )
setThreshold ( float $threshold ) Set the threshold probability a classifier document must meet

보호된 메소드들

메소드 설명
hasThreshold ( ) : boolean
prepareDocument ( string $document, SVMModel $model ) : array Formats the document for use in \SVMModel

메소드 상세

__construct() 공개 메소드

public __construct ( Camspiers\StatisticalClassifier\DataSource\DataSourceInterface $dataSource, SVMModel $model = null, Camspiers\StatisticalClassifier\Normalizer\Document\NormalizerInterface $documentNormalizer = null, Camspiers\StatisticalClassifier\Tokenizer\TokenizerInterface $tokenizer = null, Camspiers\StatisticalClassifier\Normalizer\Token\NormalizerInterface $tokenNormalizer = null, SVM $svm = null, null $threshold = null )
$dataSource Camspiers\StatisticalClassifier\DataSource\DataSourceInterface
$model Camspiers\StatisticalClassifier\Model\SVMModel
$documentNormalizer Camspiers\StatisticalClassifier\Normalizer\Document\NormalizerInterface
$tokenizer Camspiers\StatisticalClassifier\Tokenizer\TokenizerInterface
$tokenNormalizer Camspiers\StatisticalClassifier\Normalizer\Token\NormalizerInterface
$svm SVM
$threshold null

classify() 공개 메소드

public classify ( $document )

getProbabilities() 공개 메소드

Returns the probabilities of the document being in each category
public getProbabilities ( string $document ) : array
$document string
리턴 array

hasThreshold() 보호된 메소드

protected hasThreshold ( ) : boolean
리턴 boolean

prepareDocument() 보호된 메소드

Formats the document for use in \SVMModel
protected prepareDocument ( string $document, SVMModel $model ) : array
$document string
$model Camspiers\StatisticalClassifier\Model\SVMModel
리턴 array

prepareModel() 공개 메소드

public prepareModel ( )

setThreshold() 공개 메소드

Set the threshold probability a classifier document must meet
public setThreshold ( float $threshold )
$threshold float float value between 0-1

프로퍼티 상세

$documentNormalizer 보호되어 있는 프로퍼티

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

$threshold 보호되어 있는 프로퍼티

protected float|bool $threshold
리턴 float | boolean

$tokenNormalizer 보호되어 있는 프로퍼티

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

$tokenizer 보호되어 있는 프로퍼티

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