Skip to content

Commit 0772026

Browse files
rahulpalamuttammengxr
authored andcommitted
[SPARK-8923] [DOCUMENTATION, MLLIB] Add @SInCE tags to mllib.fpm
Author: rahulpalamuttam <rahulpalamut@gmail.com> Closes #7341 from rahulpalamuttam/TaggingMLlibfpm and squashes the following commits: bef2843 [rahulpalamuttam] fix @SInCE tags in mmlib.fpm cd86252 [rahulpalamuttam] Add @SInCE tags to mllib.fpm
1 parent 05ac023 commit 0772026

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

mllib/src/main/scala/org/apache/spark/mllib/fpm/AssociationRules.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,24 @@ import org.apache.spark.rdd.RDD
3131
*
3232
* Generates association rules from a [[RDD[FreqItemset[Item]]]. This method only generates
3333
* association rules which have a single item as the consequent.
34+
*
35+
* @since 1.5.0
3436
*/
3537
@Experimental
3638
class AssociationRules private[fpm] (
3739
private var minConfidence: Double) extends Logging with Serializable {
3840

3941
/**
4042
* Constructs a default instance with default parameters {minConfidence = 0.8}.
43+
*
44+
* @since 1.5.0
4145
*/
4246
def this() = this(0.8)
4347

4448
/**
4549
* Sets the minimal confidence (default: `0.8`).
50+
*
51+
* @since 1.5.0
4652
*/
4753
def setMinConfidence(minConfidence: Double): this.type = {
4854
require(minConfidence >= 0.0 && minConfidence <= 1.0)
@@ -54,6 +60,8 @@ class AssociationRules private[fpm] (
5460
* Computes the association rules with confidence above [[minConfidence]].
5561
* @param freqItemsets frequent itemset model obtained from [[FPGrowth]]
5662
* @return a [[Set[Rule[Item]]] containing the assocation rules.
63+
*
64+
* @since 1.5.0
5765
*/
5866
def run[Item: ClassTag](freqItemsets: RDD[FreqItemset[Item]]): RDD[Rule[Item]] = {
5967
// For candidate rule X => Y, generate (X, (Y, freq(X union Y)))
@@ -90,6 +98,8 @@ object AssociationRules {
9098
* @param antecedent hypotheses of the rule
9199
* @param consequent conclusion of the rule
92100
* @tparam Item item type
101+
*
102+
* @since 1.5.0
93103
*/
94104
@Experimental
95105
class Rule[Item] private[fpm] (

mllib/src/main/scala/org/apache/spark/mllib/fpm/FPGrowth.scala

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,15 @@ import org.apache.spark.storage.StorageLevel
3838
* Model trained by [[FPGrowth]], which holds frequent itemsets.
3939
* @param freqItemsets frequent itemset, which is an RDD of [[FreqItemset]]
4040
* @tparam Item item type
41+
*
42+
* @since 1.3.0
4143
*/
4244
@Experimental
4345
class FPGrowthModel[Item: ClassTag](val freqItemsets: RDD[FreqItemset[Item]]) extends Serializable {
4446
/**
4547
* Generates association rules for the [[Item]]s in [[freqItemsets]].
4648
* @param confidence minimal confidence of the rules produced
49+
* @since 1.5.0
4750
*/
4851
def generateAssociationRules(confidence: Double): RDD[AssociationRules.Rule[Item]] = {
4952
val associationRules = new AssociationRules(confidence)
@@ -67,6 +70,8 @@ class FPGrowthModel[Item: ClassTag](val freqItemsets: RDD[FreqItemset[Item]]) ex
6770
*
6871
* @see [[http://en.wikipedia.org/wiki/Association_rule_learning Association rule learning
6972
* (Wikipedia)]]
73+
*
74+
* @since 1.3.0
7075
*/
7176
@Experimental
7277
class FPGrowth private (
@@ -76,11 +81,15 @@ class FPGrowth private (
7681
/**
7782
* Constructs a default instance with default parameters {minSupport: `0.3`, numPartitions: same
7883
* as the input data}.
84+
*
85+
* @since 1.3.0
7986
*/
8087
def this() = this(0.3, -1)
8188

8289
/**
8390
* Sets the minimal support level (default: `0.3`).
91+
*
92+
* @since 1.3.0
8493
*/
8594
def setMinSupport(minSupport: Double): this.type = {
8695
this.minSupport = minSupport
@@ -89,6 +98,8 @@ class FPGrowth private (
8998

9099
/**
91100
* Sets the number of partitions used by parallel FP-growth (default: same as input data).
101+
*
102+
* @since 1.3.0
92103
*/
93104
def setNumPartitions(numPartitions: Int): this.type = {
94105
this.numPartitions = numPartitions
@@ -99,6 +110,8 @@ class FPGrowth private (
99110
* Computes an FP-Growth model that contains frequent itemsets.
100111
* @param data input data set, each element contains a transaction
101112
* @return an [[FPGrowthModel]]
113+
*
114+
* @since 1.3.0
102115
*/
103116
def run[Item: ClassTag](data: RDD[Array[Item]]): FPGrowthModel[Item] = {
104117
if (data.getStorageLevel == StorageLevel.NONE) {
@@ -199,6 +212,8 @@ class FPGrowth private (
199212

200213
/**
201214
* :: Experimental ::
215+
*
216+
* @since 1.3.0
202217
*/
203218
@Experimental
204219
object FPGrowth {
@@ -208,11 +223,15 @@ object FPGrowth {
208223
* @param items items in this itemset. Java users should call [[FreqItemset#javaItems]] instead.
209224
* @param freq frequency
210225
* @tparam Item item type
226+
*
227+
* @since 1.3.0
211228
*/
212229
class FreqItemset[Item](val items: Array[Item], val freq: Long) extends Serializable {
213230

214231
/**
215232
* Returns items in a Java List.
233+
*
234+
* @since 1.3.0
216235
*/
217236
def javaItems: java.util.List[Item] = {
218237
items.toList.asJava

0 commit comments

Comments
 (0)