Skip to content

Commit 04e1e31

Browse files
committed
added numpy style docs to private function _support
1 parent 699b18a commit 04e1e31

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

mlxtend/frequent_patterns/apriori.py

+19-6
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,26 @@ def apriori(df, min_support=0.5, use_colnames=False, max_len=None, verbose=0,
113113
"""
114114

115115
def _support(_x, _n_rows, _is_sparse):
116-
"""
117-
DRY local method to calculate support as the
116+
"""DRY private method to calculate support as the
118117
row-wise sum of values / number of rows
119-
:param _x: matrix of bools or binary
120-
:param _n_rows: numeric, number of rows
121-
:param _is_sparse: bool True if _x is sparse
122-
:return: np.array, shape = (n_rows, )
118+
Parameters
119+
-----------
120+
121+
_x : matrix of bools or binary
122+
123+
_n_rows : numeric, number of rows in _x
124+
125+
_is_sparse : bool True if _x is sparse
126+
127+
Returns
128+
-----------
129+
np.array, shape = (n_rows, )
130+
131+
Examples
132+
-----------
133+
For usage examples, please see
134+
http://rasbt.github.io/mlxtend/user_guide/frequent_patterns/apriori/
135+
123136
"""
124137
out = (np.sum(_x, axis=0) / _n_rows)
125138
return np.array(out).reshape(-1)

0 commit comments

Comments
 (0)