We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 13eb37c commit b9e3e47Copy full SHA for b9e3e47
mllib/src/main/scala/org/apache/spark/ml/fpm/FPGrowth.scala
@@ -269,12 +269,8 @@ class FPGrowthModel private[ml] (
269
val predictUDF = udf((items: Seq[_]) => {
270
if (items != null) {
271
val itemset = items.toSet
272
- brRules.value.flatMap(rule =>
273
- if (items != null && rule._1.forall(item => itemset.contains(item))) {
274
- rule._2.filter(item => !itemset.contains(item))
275
- } else {
276
- Seq.empty
277
- }).distinct
+ brRules.value.filter(_._1.forall(itemset.contains))
+ .flatMap(_._2.filter(!itemset.contains(_))).distinct
278
} else {
279
Seq.empty
280
}}, dt)
0 commit comments