@@ -116,10 +116,7 @@ def _bound_state_log_lik(X, initial_bound, precs, means, covariance_type):
116
116
return bound
117
117
118
118
119
- @deprecated ("The DPGMM class is not working correctly and it's better "
120
- "to not use it. DPGMM is deprecated in 0.18 and "
121
- "will be removed in 0.20." )
122
- class DPGMM (_GMMBase ):
119
+ class _DPGMMBase (_GMMBase ):
123
120
"""Variational Inference for the Infinite Gaussian Mixture Model.
124
121
125
122
DPGMM stands for Dirichlet Process Gaussian Mixture Model, and it
@@ -211,16 +208,16 @@ class DPGMM(_GMMBase):
211
208
algorithm, better for situations where there might be too little
212
209
data to get a good estimate of the covariance matrix.
213
210
"""
214
-
215
211
def __init__ (self , n_components = 1 , covariance_type = 'diag' , alpha = 1.0 ,
216
212
random_state = None , tol = 1e-3 , verbose = 0 , min_covar = None ,
217
213
n_iter = 10 , params = 'wmc' , init_params = 'wmc' ):
218
214
self .alpha = alpha
219
- super (DPGMM , self ).__init__ (n_components , covariance_type ,
220
- random_state = random_state ,
221
- tol = tol , min_covar = min_covar ,
222
- n_iter = n_iter , params = params ,
223
- init_params = init_params , verbose = verbose )
215
+ super (_DPGMMBase , self ).__init__ (n_components , covariance_type ,
216
+ random_state = random_state ,
217
+ tol = tol , min_covar = min_covar ,
218
+ n_iter = n_iter , params = params ,
219
+ init_params = init_params ,
220
+ verbose = verbose )
224
221
225
222
def _get_precisions (self ):
226
223
"""Return precisions as a full matrix."""
@@ -619,10 +616,24 @@ def _fit(self, X, y=None):
619
616
return z
620
617
621
618
622
- @deprecated ("The VBGMM class is not working correctly and it's better"
623
- " to not use it. VBGMM is deprecated in 0.18 and "
619
+ @deprecated ("The DPGMM class is not working correctly and it's better "
620
+ "to not use it. DPGMM is deprecated in 0.18 and "
621
+ "will be removed in 0.20." )
622
+ class DPGMM (_DPGMMBase ):
623
+ def __init__ (self , n_components = 1 , covariance_type = 'diag' , alpha = 1.0 ,
624
+ random_state = None , tol = 1e-3 , verbose = 0 , min_covar = None ,
625
+ n_iter = 10 , params = 'wmc' , init_params = 'wmc' ):
626
+ super (DPGMM , self ).__init__ (
627
+ n_components = n_components , covariance_type = covariance_type ,
628
+ alpha = alpha , random_state = random_state , tol = tol , verbose = verbose ,
629
+ min_covar = min_covar , n_iter = n_iter , params = params ,
630
+ init_params = init_params )
631
+
632
+
633
+ @deprecated ("The VBGMM class is not working correctly and it's better "
634
+ "to not use it. VBGMM is deprecated in 0.18 and "
624
635
"will be removed in 0.20." )
625
- class VBGMM (DPGMM ):
636
+ class VBGMM (_DPGMMBase ):
626
637
"""Variational Inference for the Gaussian Mixture Model
627
638
628
639
Variational inference for a Gaussian mixture model probability
0 commit comments