ft_count_vectorizer
Feature Tranformation -- CountVectorizer
Extracts a vocabulary from document collections.
Usage
ft_count_vectorizer(x, input.col, output.col, min.df = NULL, min.tf = NULL,
vocab.size = NULL, vocabulary.only = FALSE, ...)
Arguments
- x
An object (usually a
spark_tbl
) coercable to a Spark DataFrame.- input.col
The name of the input column(s).
- output.col
The name of the output column.
- min.df
Specifies the minimum number of different documents a term must appear in to be included in the vocabulary. If this is an integer greater than or equal to 1, this specifies the number of documents the term must appear in; if this is a double in [0,1), then this specifies the fraction of documents
- min.tf
Filter to ignore rare words in a document. For each document, terms with frequency/count less than the given threshold are ignored. If this is an integer greater than or equal to 1, then this specifies a count (of times the term must appear in the document); if this is a double in [0,1), then this specifies a fraction (out of the document's token count).
- vocab.size
Build a vocabulary that only considers the top vocab.size terms ordered by term frequency across the corpus.
- vocabulary.only
Boolean; should the vocabulary only be returned?
- ...
Optional arguments; currently unused.
See Also
See http://spark.apache.org/docs/latest/ml-features.html for more information on the set of transformations available for DataFrame columns in Spark.
Other feature transformation routines: ft_binarizer
,
ft_bucketizer
,
ft_discrete_cosine_transform
,
ft_elementwise_product
,
ft_index_to_string
,
ft_one_hot_encoder
,
ft_quantile_discretizer
,
ft_regex_tokenizer
,
ft_stop_words_remover
,
ft_string_indexer
,
ft_tokenizer
,
ft_vector_assembler
,
sdf_mutate