FPGrowthModel (Spark 3.5.5 JavaDoc) (original) (raw)
Object
- org.apache.spark.mllib.fpm.FPGrowthModel
Type Parameters:
Item
- item type
All Implemented Interfaces:
java.io.Serializable, Saveable
public class FPGrowthModel
extends Object
implements Saveable, scala.Serializable
Model trained by FPGrowth, which holds frequent itemsets. param: freqItemsets frequent itemset, which is an RDD of FreqItemset
See Also:
Serialized Form
Nested Class Summary
Nested Classes
Modifier and Type Class and Description static class FPGrowthModel.SaveLoadV1_0$ Constructor Summary
Constructors
Constructor and Description FPGrowthModel(RDD<FPGrowth.FreqItemset<Item>> freqItemsets, scala.reflect.ClassTag<Item> evidence$2) FPGrowthModel(RDD<FPGrowth.FreqItemset<Item>> freqItemsets, scala.collection.immutable.Map<Item,Object> itemSupport, scala.reflect.ClassTag<Item> evidence$1) Method Summary
All Methods Static Methods Instance Methods Concrete Methods
Modifier and Type Method and Description RDD<FPGrowth.FreqItemset<Item>> freqItemsets() RDD<AssociationRules.Rule<Item>> generateAssociationRules(double confidence) Generates association rules for the Items in freqItemsets. scala.collection.immutable.Map<Item,Object> itemSupport() static FPGrowthModel<?> load(SparkContext sc, String path) void save(SparkContext sc, String path) Save this model to the given path. * ### Methods inherited from class Object `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
Constructor Detail
* #### FPGrowthModel public FPGrowthModel([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](../../../../../org/apache/spark/mllib/fpm/FPGrowthModel.html "type parameter in FPGrowthModel")>> freqItemsets, scala.collection.immutable.Map<[Item](../../../../../org/apache/spark/mllib/fpm/FPGrowthModel.html "type parameter in FPGrowthModel"),Object> itemSupport, scala.reflect.ClassTag<[Item](../../../../../org/apache/spark/mllib/fpm/FPGrowthModel.html "type parameter in FPGrowthModel")> evidence$1) * #### FPGrowthModel public FPGrowthModel([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](../../../../../org/apache/spark/mllib/fpm/FPGrowthModel.html "type parameter in FPGrowthModel")>> freqItemsets, scala.reflect.ClassTag<[Item](../../../../../org/apache/spark/mllib/fpm/FPGrowthModel.html "type parameter in FPGrowthModel")> evidence$2)
Method Detail
* #### load public static [FPGrowthModel](../../../../../org/apache/spark/mllib/fpm/FPGrowthModel.html "class in org.apache.spark.mllib.fpm")<?> load([SparkContext](../../../../../org/apache/spark/SparkContext.html "class in org.apache.spark") sc, String path) * #### freqItemsets public [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](../../../../../org/apache/spark/mllib/fpm/FPGrowthModel.html "type parameter in FPGrowthModel")>> freqItemsets() * #### itemSupport public scala.collection.immutable.Map<[Item](../../../../../org/apache/spark/mllib/fpm/FPGrowthModel.html "type parameter in FPGrowthModel"),Object> itemSupport() * #### generateAssociationRules public [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](../../../../../org/apache/spark/mllib/fpm/FPGrowthModel.html "type parameter in FPGrowthModel")>> generateAssociationRules(double confidence) Generates association rules for the `Item`s in `freqItemsets`. Parameters: `confidence` \- minimal confidence of the rules produced Returns: (undocumented) * #### save public void save([SparkContext](../../../../../org/apache/spark/SparkContext.html "class in org.apache.spark") sc, String path) 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`. Specified by: `[save](../../../../../org/apache/spark/mllib/util/Saveable.html#save-org.apache.spark.SparkContext-java.lang.String-)` in interface `[Saveable](../../../../../org/apache/spark/mllib/util/Saveable.html "interface in org.apache.spark.mllib.util")` Parameters: `sc` \- Spark context used to save model data. `path` \- Path specifying the directory in which to save this model. If the directory already exists, this method throws an exception.