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 SummaryModifier and TypeMethodDescriptionbinary()Binary toggle to control the output vector values.booleandoublegetMaxDF()doublegetMinDF()doublegetMinTF()intmaxDF()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.HasInputColgetInputCol, inputColMethods inherited from interface org.apache.spark.ml.param.shared.HasOutputColgetOutputCol, outputColMethods inherited from interface org.apache.spark.ml.util.IdentifiabletoString, uidMethods inherited from interface org.apache.spark.ml.param.Paramsclear, copy, copyValues, defaultCopy, defaultParamMap, estimateMatadataSize, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, onParamChange, paramMap, params, set, set, set, setDefault, setDefault, shouldOwn
- 
Method Details- 
binaryBooleanParam 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)
 
- 
getBinaryboolean getBinary()
- 
getMaxDFdouble getMaxDF()
- 
getMinDFdouble getMinDF()
- 
getMinTFdouble getMinTF()
- 
getVocabSizeint getVocabSize()
- 
maxDFDoubleParam 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)
 
- 
minDFDoubleParam 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)
 
- 
minTFDoubleParam 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 CountVectorizerModeland does not affect fitting.Default: 1.0 - Returns:
- (undocumented)
 
- 
validateAndTransformSchemaValidates and transforms the input schema.
- 
vocabSizeIntParam 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)
 
 
-