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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSpecifies theEncoderfor 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 theEncoderfor 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:AggregatorSpecifies theEncoderfor the intermediate value type.- Specified by:
bufferEncoderin 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:AggregatorTransform 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:AggregatorMerge two intermediate values. -
outputEncoder
Description copied from class:AggregatorSpecifies theEncoderfor the final output value type.- Specified by:
outputEncoderin 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:AggregatorCombine two values to produce a new value. For performance, the function may modifyband return it instead of constructing new object for b. -
zero
Description copied from class:AggregatorA zero value for this aggregation. Should satisfy the property that any b + zero = b.
-