AssociationRules (Spark 3.5.5 JavaDoc) (original) (raw)
Object
- org.apache.spark.mllib.fpm.AssociationRules
All Implemented Interfaces:
java.io.Serializable, org.apache.spark.internal.Logging
public class AssociationRules
extends Object
implements org.apache.spark.internal.Logging, scala.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:
Serialized Form
Nested Class Summary
Nested Classes
Modifier and Type Class and Description static class AssociationRules.Rule<Item> An association rule between sets of items. * ### Nested classes/interfaces inherited from interface org.apache.spark.internal.Logging `org.apache.spark.internal.Logging.SparkShellLoggingFilter`
Constructor Summary
Constructors
Constructor and Description AssociationRules() Constructs a default instance with default parameters {minConfidence = 0.8}. Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type Method and Description JavaRDD<AssociationRules.Rule> run(JavaRDD<FPGrowth.FreqItemset> freqItemsets) Java-friendly version of run. RDD<AssociationRules.Rule> run(RDD<FPGrowth.FreqItemset> freqItemsets, scala.reflect.ClassTag evidence$1) Computes the association rules with confidence above minConfidence. RDD<AssociationRules.Rule> run(RDD<FPGrowth.FreqItemset> freqItemsets, scala.collection.Map<Item,Object> itemSupport, scala.reflect.ClassTag evidence$2) Computes the association rules with confidence above minConfidence. AssociationRules setMinConfidence(double minConfidence) Sets the minimal confidence (default: 0.8). * ### Methods inherited from class Object `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait` * ### Methods inherited from interface org.apache.spark.internal.Logging `$init$, initializeForcefully, initializeLogIfNecessary, initializeLogIfNecessary, initializeLogIfNecessary$default$2, initLock, isTraceEnabled, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning, org$apache$spark$internal$Logging$$log__$eq, org$apache$spark$internal$Logging$$log_, uninitialize`
Constructor Detail
* #### AssociationRules public AssociationRules() Constructs a default instance with default parameters {minConfidence = 0.8}.
Method Detail
* #### setMinConfidence public [AssociationRules](../../../../../org/apache/spark/mllib/fpm/AssociationRules.html "class in org.apache.spark.mllib.fpm") setMinConfidence(double minConfidence) Sets the minimal confidence (default: `0.8`). Parameters: `minConfidence` \- (undocumented) Returns: (undocumented) * #### run public <Item> [RDD](../../../../../org/apache/spark/rdd/RDD.html "class in org.apache.spark.rdd")<[AssociationRules.Rule](../../../../../org/apache/spark/mllib/fpm/AssociationRules.Rule.html "class in org.apache.spark.mllib.fpm")<Item>> run([RDD](../../../../../org/apache/spark/rdd/RDD.html "class in org.apache.spark.rdd")<[FPGrowth.FreqItemset](../../../../../org/apache/spark/mllib/fpm/FPGrowth.FreqItemset.html "class in org.apache.spark.mllib.fpm")<Item>> freqItemsets, scala.reflect.ClassTag<Item> evidence$1) Computes the association rules with confidence above `minConfidence`. Parameters: `freqItemsets` \- frequent itemset model obtained from [FPGrowth](../../../../../org/apache/spark/mllib/fpm/FPGrowth.html "class in org.apache.spark.mllib.fpm") `evidence$1` \- (undocumented) Returns: a `RDD[Rule[Item}` containing the association rules. * #### run public <Item> [RDD](../../../../../org/apache/spark/rdd/RDD.html "class in org.apache.spark.rdd")<[AssociationRules.Rule](../../../../../org/apache/spark/mllib/fpm/AssociationRules.Rule.html "class in org.apache.spark.mllib.fpm")<Item>> run([RDD](../../../../../org/apache/spark/rdd/RDD.html "class in org.apache.spark.rdd")<[FPGrowth.FreqItemset](../../../../../org/apache/spark/mllib/fpm/FPGrowth.FreqItemset.html "class in org.apache.spark.mllib.fpm")<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](../../../../../org/apache/spark/mllib/fpm/FPGrowth.html "class in org.apache.spark.mllib.fpm") `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](../../../../../org/apache/spark/api/java/JavaRDD.html "class in org.apache.spark.api.java")<[AssociationRules.Rule](../../../../../org/apache/spark/mllib/fpm/AssociationRules.Rule.html "class in org.apache.spark.mllib.fpm")<Item>> run([JavaRDD](../../../../../org/apache/spark/api/java/JavaRDD.html "class in org.apache.spark.api.java")<[FPGrowth.FreqItemset](../../../../../org/apache/spark/mllib/fpm/FPGrowth.FreqItemset.html "class in org.apache.spark.mllib.fpm")<Item>> freqItemsets) Java-friendly version of `run`. Parameters: `freqItemsets` \- (undocumented) Returns: (undocumented)