@@ -86,10 +86,20 @@ def _safe_compute_error(X, W, H):
86
86
def beta_divergence (X , W , H , beta ):
87
87
"""Compute the beta-divergence of X and dot(W, H).
88
88
89
- If beta == 2, this is the Frobenius squared norm
90
- If beta == 1, this is the generalized Kullback-Leibler divergence
91
- If beta == 0, this is the Itakura-Saito divergence
92
- Else, this is the general beta-divergence.
89
+ Parameters
90
+ ----------
91
+ X : float or array-like, shape (n_samples, n_features)
92
+
93
+ W : float or array-like, shape (n_samples, n_components)
94
+
95
+ H : float or array-like, shape (n_components, n_features)
96
+
97
+ beta : float, string in {'frobenius', 'kullback-leibler', 'itakura-saito'}
98
+ Parameter of the beta-divergence.
99
+ If beta == 2, this is the Frobenius squared norm.
100
+ If beta == 1, this is the generalized Kullback-Leibler divergence.
101
+ If beta == 0, this is the Itakura-Saito divergence.
102
+ Else, this is the general beta-divergence.
93
103
"""
94
104
beta = _beta_loss_to_float (beta )
95
105
@@ -1159,8 +1169,8 @@ def non_negative_factorization(X, W=None, H=None, n_components=None,
1159
1169
raise ValueError ("Number of components must be a positive integer;"
1160
1170
" got (n_components=%r)" % n_components )
1161
1171
if not isinstance (max_iter , INTEGER_TYPES ) or max_iter < 0 :
1162
- raise ValueError ("Maximum number of iterations must be a positive integer; "
1163
- " got (max_iter=%r)" % max_iter )
1172
+ raise ValueError ("Maximum number of iterations must be a positive "
1173
+ "integer; got (max_iter=%r)" % max_iter )
1164
1174
if not isinstance (tol , numbers .Number ) or tol < 0 :
1165
1175
raise ValueError ("Tolerance for stopping criteria must be "
1166
1176
"positive; got (tol=%r)" % tol )
0 commit comments