code: def fit(self, endog, exog, session=None, **kwargs):
      num_partitions = (
          None
          if self._factor is not None
          else self._sm_model.partitions
      )
      run_kwargs = kwargs.pop("run_kwargs", dict())
      op = StatsModelsTrain(
          endog=endog,
          exog=exog,
          num_partitions=num_partitions,
          factor=self._factor,
          model_class=self._sm_model.model_class,
          init_kwds=self._sm_model.init_kwds,
          fit_kwds=kwargs,
          estimation_method=self._sm_model.estimation_method,
          estimation_kwds=self._sm_model.estimation_kwds,
          join_method=self._sm_model.join_method,
          join_kwds=self._sm_model.join_kwds,
          results_class=self._sm_model.results_class,
          results_kwds=self._sm_model.results_kwds,
      )
      result = (
          op(exog, endog)
          .execute(session=session, **run_kwargs)
          .fetch(session=session)
      )
      return MarsResults(pickle.loads(result))
  
file_path: mars/mars/learn/contrib/statsmodels/api.py
imports: import pickle
  from .train import StatsModelsTrain
  from .predict import StatsModelsPredict
label_desc: Use image node_id 2 for calling the MarsDistributedModel obj's underlying member method code with example usage: obj.fit(endog, exog, session) and returns: MarsResults