@@ -183,14 +183,15 @@ def monte_carlo_routine(
183183 ]
184184
185185 # get the sampling adjustment weights depending on the stratification strategy
186- if self .stratify_coalition_size and self .stratify_intersection : # this is SVARM-IQ
187- sampling_adjustment_weights = self ._svarmiq_routine (interaction )
188- elif not self .stratify_coalition_size and self .stratify_intersection :
189- sampling_adjustment_weights = self ._intersection_stratification (interaction )
190- elif self .stratify_coalition_size and not self .stratify_intersection :
191- sampling_adjustment_weights = self ._coalition_size_stratification ()
192- else : # this is SHAP-IQ
193- sampling_adjustment_weights = self ._shapiq_routine ()
186+ sampling_adjustment_weights = self ._sampler .sampling_adjustment_weights
187+ #if self.stratify_coalition_size and self.stratify_intersection: # this is SVARM-IQ
188+ # sampling_adjustment_weights = self._svarmiq_routine(interaction)
189+ #elif not self.stratify_coalition_size and self.stratify_intersection:
190+ # sampling_adjustment_weights = self._intersection_stratification(interaction)
191+ #elif self.stratify_coalition_size and not self.stratify_intersection:
192+ # sampling_adjustment_weights = self._coalition_size_stratification()
193+ #else: # this is SHAP-IQ
194+ # sampling_adjustment_weights = self._shapiq_routine()
194195
195196 # compute interaction approximation (using adjustment weights and interaction weights)
196197 shapley_interaction_values [interaction_pos ] = np .sum (
@@ -368,6 +369,11 @@ def _shapiq_routine(self) -> np.ndarray:
368369 n_samples_helper = np .array ([1 , n_samples ]) # n_samples for sampled coalitions, else 1
369370 coalitions_n_samples = n_samples_helper [self ._sampler .is_coalition_sampled .astype (int )]
370371 # Set weights by dividing through the probabilities
372+ print ()
373+ print ('sampler.coalitions_counter' , self ._sampler .coalitions_counter )
374+ print ('sampler.coalitions_size_probability' , self ._sampler .coalitions_size_probability )
375+ print ('sampler.coalitions_in_size_probability' , self ._sampler .coalitions_in_size_probability )
376+ print ('coalitions_n_samples:' , coalitions_n_samples )
371377 return self ._sampler .coalitions_counter / (
372378 self ._sampler .coalitions_size_probability
373379 * self ._sampler .coalitions_in_size_probability
0 commit comments