Class FPGrowthModel<Item>

Type Parameters:
Item - item type
All Implemented Interfaces:
Serializable, Saveable, scala.Serializable

public class FPGrowthModel<Item> 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:
  • Constructor Details

  • Method Details

    • load

      public static FPGrowthModel<?> load(SparkContext sc, String path)
    • freqItemsets

      public RDD<FPGrowth.FreqItemset<Item>> freqItemsets()
    • itemSupport

      public scala.collection.immutable.Map<Item,Object> itemSupport()
    • generateAssociationRules

      public RDD<AssociationRules.Rule<Item>> generateAssociationRules(double confidence)
      Generates association rules for the Items in freqItemsets().
      confidence - minimal confidence of the rules produced
    • save

      public void save(SparkContext 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 in interface Saveable
      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.