Package org.apache.spark.ml.feature
Class StringIndexerAggregator
- All Implemented Interfaces:
Serializable
,scala.Serializable
public class StringIndexerAggregator
extends Aggregator<Row,org.apache.spark.util.collection.OpenHashMap<String,Object>[],org.apache.spark.util.collection.OpenHashMap<String,Object>[]>
A SQL
Aggregator
used by StringIndexer
to count labels in string columns during fitting.- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSpecifies theEncoder
for the intermediate value type.Transform the output of the reduction.merge
(org.apache.spark.util.collection.OpenHashMap<String, Object>[] array1, org.apache.spark.util.collection.OpenHashMap<String, Object>[] array2) Merge two intermediate values.Specifies theEncoder
for the final output value type.Combine two values to produce a new value.zero()
A zero value for this aggregation.Methods inherited from class org.apache.spark.sql.expressions.Aggregator
toColumn
-
Constructor Details
-
StringIndexerAggregator
public StringIndexerAggregator(int numColumns)
-
-
Method Details
-
bufferEncoder
Description copied from class:Aggregator
Specifies theEncoder
for the intermediate value type.- Specified by:
bufferEncoder
in classAggregator<Row,
org.apache.spark.util.collection.OpenHashMap<String, Object>[], org.apache.spark.util.collection.OpenHashMap<String, Object>[]> - Returns:
- (undocumented)
-
finish
public org.apache.spark.util.collection.OpenHashMap<String,Object>[] finish(org.apache.spark.util.collection.OpenHashMap<String, Object>[] array) Description copied from class:Aggregator
Transform the output of the reduction. -
merge
public org.apache.spark.util.collection.OpenHashMap<String,Object>[] merge(org.apache.spark.util.collection.OpenHashMap<String, Object>[] array1, org.apache.spark.util.collection.OpenHashMap<String, Object>[] array2) Description copied from class:Aggregator
Merge two intermediate values. -
outputEncoder
Description copied from class:Aggregator
Specifies theEncoder
for the final output value type.- Specified by:
outputEncoder
in classAggregator<Row,
org.apache.spark.util.collection.OpenHashMap<String, Object>[], org.apache.spark.util.collection.OpenHashMap<String, Object>[]> - Returns:
- (undocumented)
-
reduce
public org.apache.spark.util.collection.OpenHashMap<String,Object>[] reduce(org.apache.spark.util.collection.OpenHashMap<String, Object>[] array, Row row) Description copied from class:Aggregator
Combine two values to produce a new value. For performance, the function may modifyb
and return it instead of constructing new object for b. -
zero
Description copied from class:Aggregator
A zero value for this aggregation. Should satisfy the property that any b + zero = b.
-