Package org.apache.spark.mllib.fpm
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
Modifier and TypeClassDescriptionstatic 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
ConstructorDescriptionConstructs a default instance with default parameters {minConfidence = 0.8}. -
Method Summary
Modifier and TypeMethodDescription<Item> JavaRDD<AssociationRules.Rule<Item>>
run
(JavaRDD<FPGrowth.FreqItemset<Item>> freqItemsets) Java-friendly version ofrun
.<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 aboveminConfidence
.<Item> RDD<AssociationRules.Rule<Item>>
run
(RDD<FPGrowth.FreqItemset<Item>> freqItemsets, scala.reflect.ClassTag<Item> evidence$1) Computes the association rules with confidence aboveminConfidence
.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
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 aboveminConfidence
.- Parameters:
freqItemsets
- frequent itemset model obtained fromFPGrowth
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 aboveminConfidence
.- Parameters:
freqItemsets
- frequent itemset model obtained fromFPGrowth
itemSupport
- map containing an item and its supportevidence$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 ofrun
.- Parameters:
freqItemsets
- (undocumented)- Returns:
- (undocumented)
-