class_docstr: Uses Shapley values to explain any machine learning model or python function.
  
  This is the primary explainer interface for the SHAP library. It takes any combination
  of a model and masker and returns a callable subclass object that implements
  the particular estimation algorithm that was chosen.
docstr: A utility method to compute the main effects from a MaskedModel.
          
docstr_tok: ["A","utility","method","to","compute","the","main","effects","from","a","MaskedModel","."]
code: def _compute_main_effects(fm, expected_value, inds):
      """A utility method to compute the main effects from a MaskedModel."""
  
      # mask each input on in isolation
      masks = np.zeros(2 * len(inds) - 1, dtype=int)
      last_ind = -1
      for i in range(len(inds)):
          if i > 0:
              masks[2 * i - 1] = (
                  -last_ind - 1
              )  # turn off the last input
          masks[2 * i] = inds[i]  # turn on this input
          last_ind = inds[i]
  
      # compute the main effects for the given indexes
      main_effects = fm(masks) - expected_value
  
      # expand the vector to the full input size
      expanded_main_effects = np.zeros(len(fm))
      for i, ind in enumerate(inds):
          expanded_main_effects[ind] = main_effects[i]
  
      return expanded_main_effects
  
imports: import copy
  import time
  import numpy
  import pandas
  import scipy.sparse
  from ..None import explainers, links, maskers, models
  from .._explanation import Explanation
  from .._serializable import Deserializer, Serializable, Serializer
  from ..maskers import Masker
  from ..models import Model
  from ..utils import safe_isinstance, show_progress
  from ..utils._exceptions import InvalidAlgorithmError
  from ..utils.transformers import is_transformers_lm
label_desc: Use image node_id 5 for calling the Explainer obj's underlying member method code with example usage: obj._compute_main_effects(fm, expected_value, inds) and returns: expanded_main_effects