PHP Class Phpml\FeatureExtraction\TokenCountVectorizer

Inheritance: implements Phpml\Transformer
Exibir arquivo Open project: php-ai/php-ml Class Usage Examples

Public Methods

Method Description
__construct ( Phpml\Tokenization\Tokenizer $tokenizer, StopWords $stopWords = null, float $minDF )
fit ( array $samples )
getVocabulary ( ) : array
transform ( array &$samples )

Private Methods

Method Description
addTokenToVocabulary ( string $token )
buildVocabulary ( array &$samples )
checkDocumentFrequency ( array &$samples ) : array
getBeyondMinimumIndexes ( integer $samplesCount ) : array
getTokenIndex ( string $token ) : integer | boolean
isStopWord ( string $token ) : boolean
resetBeyondMinimum ( array &$sample, array $beyondMinimum )
transformSample ( string &$sample )
updateFrequency ( string $token )

Method Details

__construct() public method

public __construct ( Phpml\Tokenization\Tokenizer $tokenizer, StopWords $stopWords = null, float $minDF )
$tokenizer Phpml\Tokenization\Tokenizer
$stopWords StopWords
$minDF float

fit() public method

public fit ( array $samples )
$samples array

getVocabulary() public method

public getVocabulary ( ) : array
return array

transform() public method

public transform ( array &$samples )
$samples array