@@ -301,8 +301,8 @@ def cluster(self, method="GaussianMixture", **kwargs):
301301 pindicator [tmpind , mapinds [i ]] += 1
302302
303303 pindicator = (pindicator .T / pindicator .sum (axis = 1 )).T
304- setattr ( self .processed_results , ' indicator' , pindicator )
305- setattr ( self .processed_results , ' labels' , all_labels )
304+ self .processed_results . indicator = pindicator
305+ self .processed_results . labels = all_labels
306306
307307 def process_gibbs (self , show = True ):
308308 r"""
@@ -329,9 +329,8 @@ def process_gibbs(self, show=True):
329329
330330 self .cluster (n_init = 117 , n_components = lmode )
331331 labels , presorts = mixture_and_plot (self , show = show )
332- setattr (self .processed_results , 'labels' , labels )
333- setattr (self .processed_results , 'indicator' ,
334- self .processed_results .indicator [:, presorts ])
332+ self .processed_results .labels = labels
333+ self .processed_results .indicator = self .processed_results .indicator [:, presorts ]
335334
336335 attrs = ["weights" , "rates" , "ncomp" , "residue" , "iteration" , "niter" ]
337336 values = [fweights , frates , lmode , self .residue , indices , self .niter ]
@@ -364,7 +363,7 @@ def _sample_indicator(self):
364363 # sample indicator
365364 s = np .argmax (rng .multinomial (1 , z ), axis = 1 )
366365 indicator [i ] = s
367- setattr ( self , ' indicator' , indicator )
366+ self . indicator = indicator
368367 return indicator [burnin_ind ::self .gskip ]
369368
370369 def save (self ):
@@ -719,8 +718,8 @@ def _estimate_params(self):
719718 params = np .array ([[wh [1 ][np .argmax (wh [0 ])], rh [1 ][np .argmax (rh [0 ])]]
720719 for wh , rh in zip (whists , rhists )])
721720
722- setattr ( rp , ' parameters' , params )
723- setattr ( rp , ' intervals' , np .array ([wbounds , rbounds ]) )
721+ rp . parameters = params
722+ rp . intervals = np .array ([wbounds , rbounds ])
724723
725724 def estimate_tau (self ):
726725 r"""
0 commit comments