Package org.apache.spark.mllib.rdd
Class MLPairRDDFunctions<K,V>
Object
org.apache.spark.mllib.rdd.MLPairRDDFunctions<K,V>
- All Implemented Interfaces:
Serializable
Machine learning specific Pair RDD functions.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <K,
V> MLPairRDDFunctions<K, V> fromPairRDD
(RDD<scala.Tuple2<K, V>> rdd, scala.reflect.ClassTag<K> evidence$3, scala.reflect.ClassTag<V> evidence$4) Implicit conversion from a pair RDD to MLPairRDDFunctions.Returns the top k (largest) elements for each key from this RDD as defined by the specified implicit Ordering[T].
-
Constructor Details
-
MLPairRDDFunctions
-
-
Method Details
-
fromPairRDD
public static <K,V> MLPairRDDFunctions<K,V> fromPairRDD(RDD<scala.Tuple2<K, V>> rdd, scala.reflect.ClassTag<K> evidence$3, scala.reflect.ClassTag<V> evidence$4) Implicit conversion from a pair RDD to MLPairRDDFunctions. -
topByKey
Returns the top k (largest) elements for each key from this RDD as defined by the specified implicit Ordering[T]. If the number of elements for a certain key is less than k, all of them will be returned.- Parameters:
num
- k, the number of top elements to returnord
- the implicit ordering for T- Returns:
- an RDD that contains the top k values for each key
-