CountVectorizerModel Class

Definition

public class CountVectorizerModel : Microsoft.Spark.ML.Feature.FeatureBase<Microsoft.Spark.ML.Feature.CountVectorizerModel>
type CountVectorizerModel = class
    inherit FeatureBase<CountVectorizerModel>
Public Class CountVectorizerModel
Inherits FeatureBase(Of CountVectorizerModel)
Inheritance
CountVectorizerModel

Constructors

CountVectorizerModel(List<String>)

Creates a CountVectorizerModel without any parameters

CountVectorizerModel(String, List<String>)

Creates a CountVectorizerModel with a UID that is used to give the CountVectorizerModel a unique ID

Methods

Clear(Param)

Clears any value that was previously set for this Microsoft.Spark.ML.Feature.Param. The value is reset to the default value.

(Inherited from FeatureBase<T>)
ExplainParam(Param)

Returns a description of how a specific Microsoft.Spark.ML.Feature.Param works and is currently set.

(Inherited from FeatureBase<T>)
ExplainParams()

Returns a description of how all of the Microsoft.Spark.ML.Feature.Param's that apply to this object work and how they are currently set.

(Inherited from FeatureBase<T>)
GetBinary()

Gets the 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

GetInputCol()

Gets the column that the CountVectorizerModel should read from and convert into buckets. This would have been set by SetInputCol

GetMaxDF()

Gets 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.

GetMinDF()

Gets 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.

GetMinTF()

Gets the 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.

GetOutputCol()

Gets the name of the new column the CountVectorizerModel will create in the DataFrame.

GetParam(String)

Retrieves a Microsoft.Spark.ML.Feature.Param so that it can be used to set the value of the Microsoft.Spark.ML.Feature.Param on the object.

(Inherited from FeatureBase<T>)
GetVocabSize()

Gets the max size of the vocabulary. CountVectorizerModel will build a vocabulary that only considers the top vocabSize terms ordered by term frequency across the corpus.

Load(String)

Loads the CountVectorizerModel that was previously saved using Save

Save(String)

Saves the object so that it can be loaded later using Load. Note that these objects can be shared with Scala by Loading or Saving in Scala.

(Inherited from FeatureBase<T>)
Set(Param, Object)

Sets the value of a specific Microsoft.Spark.ML.Feature.Param.

(Inherited from FeatureBase<T>)
SetBinary(Boolean)

Sets the 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

SetInputCol(String)

Sets the column that the CountVectorizerModel should read from.

SetMinTF(Double)

Sets the 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.

SetOutputCol(String)

Sets the name of the new column the CountVectorizerModel will create in the DataFrame.

ToString()

Returns the JVM toString value rather than the .NET ToString default

(Inherited from FeatureBase<T>)
Transform(DataFrame)

Converts a DataFrame with a text document to a sparse vector of token counts.

TransformSchema(StructType)

Check transform validity and derive the output schema from the input schema.

This checks for validity of interactions between parameters during Transform and raises an exception if any parameter value is invalid.

Typical implementation should first conduct verification on schema change and parameter validity, including complex parameter interaction checks.

Uid()

The UID that was used to create the object. If no UID is passed in when creating the object then a random UID is created when the object is created.

(Inherited from FeatureBase<T>)

Applies to