class_docstr: Theil-Sen Estimator: robust multivariate regression model.
  
  The algorithm calculates least square solutions on subsets with size
  n_subsamples of the samples in X. Any value of n_subsamples between the
  number of features and samples leads to an estimator with a compromise
  between robustness and efficiency. Since the number of least square
  solutions is "n_samples choose n_subsamples", it can be extremely large
  and can therefore be limited with max_subpopulation. If this limit is
  reached, the subsets are chosen randomly. In a final step, the spatial
  median (or L1 median) is calculated of all least square solutions.
  
  Read more in the :ref:`User Guide <theil_sen_regression>`.
  
  Parameters
  ----------
  fit_intercept : boolean, optional, default True
      Whether to calculate the intercept for this model. If set
      to false, no intercept will be used in calculations.
  
  copy_X : boolean, optional, default True
      If True, X will be copied; else, it may be overwritten.
  
  max_subpopulation : int, optional, default 1e4
      Instead of computing with a set of cardinality 'n choose k', where n is
      the number of samples and k is the number of subsamples (at least
      number of features), consider only a stochastic subpopulation of a
      given maximal size if 'n choose k' is larger than max_subpopulation.
      For other than small problem sizes this parameter will determine
      memory usage and runtime if n_subsamples is not changed.
  
  n_subsamples : int, optional, default None
      Number of samples to calculate the parameters. This is at least the
      number of features (plus 1 if fit_intercept=True) and the number of
      samples as a maximum. A lower number leads to a higher breakdown
      point and a low efficiency while a high number leads to a low
      breakdown point and a high efficiency. If None, take the
      minimum number of subsamples leading to maximal robustness.
      If n_subsamples is set to n_samples, Theil-Sen is identical to least
      squares.
  
  max_iter : int, optional, default 300
      Maximum number of iterations for the calculation of spatial median.
  
  tol : float, optional, default 1.e-3
      Tolerance when calculating spatial median.
  
  random_state : RandomState or an int seed, optional, default None
      A random number generator instance to define the state of the
      random permutations generator.
  
  n_jobs : integer, optional, default 1
      Number of CPUs to use during the cross validation. If ``-1``, use
      all the CPUs.
  
  verbose : boolean, optional, default False
      Verbose mode when fitting the model.
  
  Attributes
  ----------
  coef_ : array, shape = (n_features)
      Coefficients of the regression model (median of distribution).
  
  intercept_ : float
      Estimated intercept of regression model.
  
  breakdown_ : float
      Approximated breakdown point.
  
  n_iter_ : int
      Number of iterations needed for the spatial median.
  
  n_subpopulation_ : int
      Number of combinations taken into account from 'n choose k', where n is
      the number of samples and k is the number of subsamples.
  
  References
  ----------
  - Theil-Sen Estimators in a Multiple Linear Regression Model, 2009
    Xin Dang, Hanxiang Peng, Xueqin Wang and Heping Zhang
    http://home.olemiss.edu/~xdang/papers/MTSE.pdf
docstr: Fit linear model.
  
  Parameters
  ----------
  X : numpy array of shape [n_samples, n_features]
      Training data
  y : numpy array of shape [n_samples]
      Target values
  
  Returns
  -------
  self : returns an instance of self.
docstr_tok: ["Fit","linear","model",".","Parameters","--","--","--","--","--","X",":","numpy","array","of","shape","[","n_samples",",","n_features","]","Training","data","y",":","numpy","array","of","shape","[","n_samples","]","Target","values","Returns","--","--","--","-","self",":","returns","an","instance","of","self","."]
code: def fit(self, X, y):
      """Fit linear model.
  
      Parameters
      ----------
      X : numpy array of shape [n_samples, n_features]
          Training data
      y : numpy array of shape [n_samples]
          Target values
  
      Returns
      -------
      self : returns an instance of self.
      """
      random_state = check_random_state(self.random_state)
      X, y = check_X_y(X, y, y_numeric=True)
      n_samples, n_features = X.shape
      n_subsamples, self.n_subpopulation_ = self._check_subparams(
          n_samples, n_features
      )
      self.breakdown_ = _breakdown_point(n_samples, n_subsamples)
  
      if self.verbose:
          print("Breakdown point: {0}".format(self.breakdown_))
          print("Number of samples: {0}".format(n_samples))
          tol_outliers = int(self.breakdown_ * n_samples)
          print("Tolerable outliers: {0}".format(tol_outliers))
          print(
              "Number of subpopulations: {0}".format(
                  self.n_subpopulation_
              )
          )
  
      # Determine indices of subpopulation
      if (
          np.rint(binom(n_samples, n_subsamples))
          <= self.max_subpopulation
      ):
          indices = list(combinations(range(n_samples), n_subsamples))
      else:
          indices = [
              choice(
                  n_samples,
                  size=n_subsamples,
                  replace=False,
                  random_state=random_state,
              )
              for _ in range(self.n_subpopulation_)
          ]
  
      n_jobs = _get_n_jobs(self.n_jobs)
      index_list = np.array_split(indices, n_jobs)
      weights = Parallel(n_jobs=n_jobs, verbose=self.verbose)(
          delayed(_lstsq)(X, y, index_list[job], self.fit_intercept)
          for job in range(n_jobs)
      )
      weights = np.vstack(weights)
      self.n_iter_, coefs = _spatial_median(
          weights, max_iter=self.max_iter, tol=self.tol
      )
  
      if self.fit_intercept:
          self.intercept_ = coefs[0]
          self.coef_ = coefs[1:]
      else:
          self.intercept_ = 0.0
          self.coef_ = coefs
  
      return self
  
imports: from __future__ import division, print_function, absolute_import
  import warnings
  from itertools import combinations
  import numpy
  from scipy import linalg
  from scipy.special import binom
  from scipy.linalg.lapack import get_lapack_funcs
  from .base import LinearModel
  from ..base import RegressorMixin
  from ..utils import check_random_state
  from ..utils import check_X_y, _get_n_jobs
  from ..utils.random import choice
  from ..externals.joblib import Parallel, delayed
  from ..externals.six.moves import xrange
  from ..exceptions import ConvergenceWarning
label_desc: Use image node_id 3 for calling the TheilSenRegressor obj's underlying member method code with example usage: obj.fit(X, y) and returns: self