Class AssociationRules

Object
org.apache.spark.mllib.fpm.AssociationRules
All Implemented Interfaces:
Serializable, org.apache.spark.internal.Logging

public class AssociationRules extends Object implements org.apache.spark.internal.Logging, Serializable
Generates association rules from a RDD[FreqItemset[Item}. This method only generates association rules which have a single item as the consequent.

See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    An association rule between sets of items.

    Nested classes/interfaces inherited from interface org.apache.spark.internal.Logging

    org.apache.spark.internal.Logging.LogStringContext, org.apache.spark.internal.Logging.SparkShellLoggingFilter
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a default instance with default parameters {minConfidence = 0.8}.
  • Method Summary

    Modifier and Type
    Method
    Description
    run(JavaRDD<FPGrowth.FreqItemset<Item>> freqItemsets)
    Java-friendly version of run.
    <Item> RDD<AssociationRules.Rule<Item>>
    run(RDD<FPGrowth.FreqItemset<Item>> freqItemsets, scala.collection.Map<Item,Object> itemSupport, scala.reflect.ClassTag<Item> evidence$2)
    Computes the association rules with confidence above minConfidence.
    <Item> RDD<AssociationRules.Rule<Item>>
    run(RDD<FPGrowth.FreqItemset<Item>> freqItemsets, scala.reflect.ClassTag<Item> evidence$1)
    Computes the association rules with confidence above minConfidence.
    setMinConfidence(double minConfidence)
    Sets the minimal confidence (default: 0.8).

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.spark.internal.Logging

    initializeForcefully, initializeLogIfNecessary, initializeLogIfNecessary, initializeLogIfNecessary$default$2, isTraceEnabled, log, logDebug, logDebug, logDebug, logDebug, logError, logError, logError, logError, logInfo, logInfo, logInfo, logInfo, logName, LogStringContext, logTrace, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, logWarning, org$apache$spark$internal$Logging$$log_, org$apache$spark$internal$Logging$$log__$eq, withLogContext
  • Constructor Details

    • AssociationRules

      public AssociationRules()
      Constructs a default instance with default parameters {minConfidence = 0.8}.
  • Method Details

    • setMinConfidence

      public AssociationRules setMinConfidence(double minConfidence)
      Sets the minimal confidence (default: 0.8).
      Parameters:
      minConfidence - (undocumented)
      Returns:
      (undocumented)
    • run

      public <Item> RDD<AssociationRules.Rule<Item>> run(RDD<FPGrowth.FreqItemset<Item>> freqItemsets, scala.reflect.ClassTag<Item> evidence$1)
      Computes the association rules with confidence above minConfidence.
      Parameters:
      freqItemsets - frequent itemset model obtained from FPGrowth
      evidence$1 - (undocumented)
      Returns:
      a RDD[Rule[Item} containing the association rules.

    • run

      public <Item> RDD<AssociationRules.Rule<Item>> run(RDD<FPGrowth.FreqItemset<Item>> freqItemsets, scala.collection.Map<Item,Object> itemSupport, scala.reflect.ClassTag<Item> evidence$2)
      Computes the association rules with confidence above minConfidence.
      Parameters:
      freqItemsets - frequent itemset model obtained from FPGrowth
      itemSupport - map containing an item and its support
      evidence$2 - (undocumented)
      Returns:
      a RDD[Rule[Item} containing the association rules. The rules will be able to compute also the lift metric.
    • run

      public <Item> JavaRDD<AssociationRules.Rule<Item>> run(JavaRDD<FPGrowth.FreqItemset<Item>> freqItemsets)
      Java-friendly version of run.
      Parameters:
      freqItemsets - (undocumented)
      Returns:
      (undocumented)