class_docstr: Mean signal Diffusion Kurtosis Model
      
class_docstr_tok: ["Mean","signal","Diffusion","Kurtosis","Model"]
docstr: Fit method of the MSDKI model class
  
  Parameters
  ----------
  data : ndarray ([X, Y, Z, ...], g)
      ndarray containing the data signals in its last dimension.
  
  mask : array
      A boolean array used to mark the coordinates in the data that
      should be analyzed that has the shape data.shape[:-1]
docstr_tok: ["Fit","method","of","the","MSDKI","model","class","Parameters","--","--","--","--","--","data",":","ndarray","(","[","X",",","Y",",","Z",",","...","]",",","g",")","ndarray","containing","the","data","signals","in","its","last","dimension",".","mask",":","array","A","boolean","array","used","to","mark","the","coordinates","in","the","data","that","should","be","analyzed","that","has","the","shape","data.shape","[",":","-1","]"]
code: def fit(self, data, mask=None):
      """Fit method of the MSDKI model class
  
      Parameters
      ----------
      data : ndarray ([X, Y, Z, ...], g)
          ndarray containing the data signals in its last dimension.
  
      mask : array
          A boolean array used to mark the coordinates in the data that
          should be analyzed that has the shape data.shape[:-1]
      """
      S0_params = None
  
      # Compute mean signal for each unique b-value
      mdata, ng = mean_signal_bvalue(data, self.gtab, bmag=self.bmag)
  
      # Remove mdata zeros
      mdata = np.maximum(mdata, self.min_signal)
  
      params = wls_fit_msdki(
          self.design_matrix,
          mdata,
          ng,
          mask=mask,
          return_S0_hat=self.return_S0_hat,
          *self.args,
          **self.kwargs,
      )
      if self.return_S0_hat:
          params, S0_params = params
  
      return MeanDiffusionKurtosisFit(self, params, model_S0=S0_params)
  
imports: import numpy
  import scipy.optimize
  from dipy.core.gradients import check_multi_b, unique_bvals_magnitude, round_bvals
  from dipy.reconst.base import ReconstModel
  from dipy.reconst.dti import MIN_POSITIVE_SIGNAL
  from dipy.core.ndindex import ndindex
  from dipy.core.onetime import auto_attr
label_desc: Use image node_id 2 for calling the MeanDiffusionKurtosisModel obj's underlying member method code with example usage: obj.fit(data, mask) and returns: MeanDiffusionKurtosisFit