Package org.apache.spark.ml.feature
Interface CountVectorizerParams
- All Superinterfaces:
HasInputCol
,HasOutputCol
,Identifiable
,Params
,Serializable
- All Known Implementing Classes:
CountVectorizer
,CountVectorizerModel
Params for
CountVectorizer
and CountVectorizerModel
.-
Method Summary
Modifier and TypeMethodDescriptionbinary()
Binary toggle to control the output vector values.boolean
double
getMaxDF()
double
getMinDF()
double
getMinTF()
int
maxDF()
Specifies the maximum number of different documents a term could appear in to be included in the vocabulary.minDF()
Specifies the minimum number of different documents a term must appear in to be included in the vocabulary.minTF()
Filter to ignore rare words in a document.validateAndTransformSchema
(StructType schema) Validates and transforms the input schema.Max size of the vocabulary.Methods inherited from interface org.apache.spark.ml.param.shared.HasInputCol
getInputCol, inputCol
Methods inherited from interface org.apache.spark.ml.param.shared.HasOutputCol
getOutputCol, outputCol
Methods inherited from interface org.apache.spark.ml.util.Identifiable
toString, uid
Methods inherited from interface org.apache.spark.ml.param.Params
clear, copy, copyValues, defaultCopy, defaultParamMap, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, onParamChange, paramMap, params, set, set, set, setDefault, setDefault, shouldOwn
-
Method Details
-
binary
BooleanParam binary()Binary toggle to control the output vector values. If True, all nonzero counts (after minTF filter applied) are set to 1. This is useful for discrete probabilistic models that model binary events rather than integer counts. Default: false- Returns:
- (undocumented)
-
getBinary
boolean getBinary() -
getMaxDF
double getMaxDF() -
getMinDF
double getMinDF() -
getMinTF
double getMinTF() -
getVocabSize
int getVocabSize() -
maxDF
DoubleParam maxDF()Specifies the maximum number of different documents a term could appear in to be included in the vocabulary. A term that appears more than the threshold will be ignored. If this is an integer greater than or equal to 1, this specifies the maximum number of documents the term could appear in; if this is a double in [0,1), then this specifies the maximum fraction of documents the term could appear in.Default: (2^63^) - 1
- Returns:
- (undocumented)
-
minDF
DoubleParam minDF()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.Default: 1.0
- Returns:
- (undocumented)
-
minTF
DoubleParam minTF()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).Note that the parameter is only used in transform of
CountVectorizerModel
and does not affect fitting.Default: 1.0
- Returns:
- (undocumented)
-
validateAndTransformSchema
Validates and transforms the input schema. -
vocabSize
IntParam vocabSize()Max size of the vocabulary. CountVectorizer will build a vocabulary that only considers the top vocabSize terms ordered by term frequency across the corpus.Default: 2^18^
- Returns:
- (undocumented)
-