Skip to content

Commit

Permalink
documentation add tokenizer->fit required to build the dictionary (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmonllao authored and akondas committed Nov 16, 2017
1 parent a11e3f6 commit f7537c0
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,18 @@ $samples = [
];
$vectorizer = new TokenCountVectorizer(new WhitespaceTokenizer());
$vectorizer->transform($samples)
// return $vector = [
// Build the dictionary.
$vectorizer->fit($samples);
// Transform the provided text samples into a vectorized list.
$vectorizer->transform($samples);
// return $samples = [
// [0 => 1, 1 => 1, 2 => 2, 3 => 1, 4 => 1],
// [5 => 1, 6 => 1, 1 => 1, 2 => 1],
// [5 => 1, 7 => 2, 8 => 1, 9 => 1],
//];
```

### Vocabulary
Expand Down

0 comments on commit f7537c0

Please sign in to comment.