Package org.apache.spark.mllib.fpm
Class FPGrowthModel<Item>
Object
org.apache.spark.mllib.fpm.FPGrowthModel<Item>
- Type Parameters:
Item
- item type
- All Implemented Interfaces:
Serializable
,Saveable
,scala.Serializable
Model trained by
FPGrowth
, which holds frequent itemsets.
param: freqItemsets frequent itemset, which is an RDD of FreqItemset
- See Also:
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionFPGrowthModel
(RDD<FPGrowth.FreqItemset<Item>> freqItemsets, scala.collection.immutable.Map<Item, Object> itemSupport, scala.reflect.ClassTag<Item> evidence$1) FPGrowthModel
(RDD<FPGrowth.FreqItemset<Item>> freqItemsets, scala.reflect.ClassTag<Item> evidence$2) -
Method Summary
Modifier and TypeMethodDescriptiongenerateAssociationRules
(double confidence) Generates association rules for theItem
s infreqItemsets()
.static FPGrowthModel<?>
load
(SparkContext sc, String path) void
save
(SparkContext sc, String path) Save this model to the given path.
-
Constructor Details
-
FPGrowthModel
-
FPGrowthModel
public FPGrowthModel(RDD<FPGrowth.FreqItemset<Item>> freqItemsets, scala.reflect.ClassTag<Item> evidence$2)
-
-
Method Details
-
load
-
freqItemsets
-
itemSupport
-
generateAssociationRules
Generates association rules for theItem
s infreqItemsets()
.- Parameters:
confidence
- minimal confidence of the rules produced- Returns:
- (undocumented)
-
save
Save this model to the given path. It only works for Item datatypes supported by DataFrames.This saves: - human-readable (JSON) model metadata to path/metadata/ - Parquet formatted data to path/data/
The model may be loaded using
FPGrowthModel.load
.
-