class_docstr: Logistic Regression (aka logit, MaxEnt) classifier.
  
  In the multiclass case, the training algorithm uses the one-vs-rest (OvR)
  scheme if the 'multi_class' option is set to 'ovr', and uses the
  cross-entropy loss if the 'multi_class' option is set to 'multinomial'.
  (Currently the 'multinomial' option is supported only by the 'lbfgs',
  'sag', 'saga' and 'newton-cg' solvers.)
  
  This class implements regularized logistic regression using the
  'liblinear' library, 'newton-cg', 'sag', 'saga' and 'lbfgs' solvers. **Note
  that regularization is applied by default**. It can handle both dense
  and sparse input. Use C-ordered arrays or CSR matrices containing 64-bit
  floats for optimal performance; any other input format will be converted
  (and copied).
  
  The 'newton-cg', 'sag', and 'lbfgs' solvers support only L2 regularization
  with primal formulation, or no regularization. The 'liblinear' solver
  supports both L1 and L2 regularization, with a dual formulation only for
  the L2 penalty. The Elastic-Net regularization is only supported by the
  'saga' solver.
  
  Read more in the :ref:`User Guide <logistic_regression>`.
  
  Parameters
  ----------
  penalty : {'l1', 'l2', 'elasticnet', 'none'}, default='l2'
      Used to specify the norm used in the penalization. The 'newton-cg',
      'sag' and 'lbfgs' solvers support only l2 penalties. 'elasticnet' is
      only supported by the 'saga' solver. If 'none' (not supported by the
      liblinear solver), no regularization is applied.
  
      .. versionadded:: 0.19
         l1 penalty with SAGA solver (allowing 'multinomial' + L1)
  
  C : float, default=1.0
      Inverse of regularization strength; must be a positive float.
      Like in support vector machines, smaller values specify stronger
      regularization.
  
  fit_intercept : bool, default=True
      Specifies if a constant (a.k.a. bias or intercept) should be
      added to the decision function.
  
  random_state : int, RandomState instance, default=None
      Used when ``solver`` == 'sag', 'saga' or 'liblinear' to shuffle the
      data. See :term:`Glossary <random_state>` for details.
  
  solver : SGD (stochastic gradient descent)
  
  max_iter : int, default=100
      Maximum number of iterations taken for the solvers to converge.
  
  multi_class : {'auto', 'ovr', 'multinomial'}, default='auto'
      If the option chosen is 'ovr', then a binary problem is fit for each
      label. For 'multinomial' the loss minimised is the multinomial loss fit
      across the entire probability distribution, *even when the data is
      binary*. 'multinomial' is unavailable when solver='liblinear'.
      'auto' selects 'ovr' if the data is binary, or if solver='liblinear',
      and otherwise selects 'multinomial'.
  
      .. versionadded:: 0.18
         Stochastic Average Gradient descent solver for 'multinomial' case.
      .. versionchanged:: 0.22
          Default changed from 'ovr' to 'auto' in 0.22.
  
  verbose : int, default=0
      For the liblinear and lbfgs solvers set verbose to any positive
      number for verbosity.
  
  Attributes
  ----------
  
  coef_ : ndarray of shape (1, n_features) or (n_classes, n_features)
      Coefficient of the features in the decision function.
  
      `coef_` is of shape (1, n_features) when the given problem is binary.
      In particular, when `multi_class='multinomial'`, `coef_` corresponds
      to outcome 1 (True) and `-coef_` corresponds to outcome 0 (False).
  
  intercept_ : ndarray of shape (1,) or (n_classes,)
      Intercept (a.k.a. bias) added to the decision function.
  
      If `fit_intercept` is set to False, the intercept is set to zero.
      `intercept_` is of shape (1,) when the given problem is binary.
      In particular, when `multi_class='multinomial'`, `intercept_`
      corresponds to outcome 1 (True) and `-intercept_` corresponds to
      outcome 0 (False).
  
  See Also
  --------
  SGDClassifier : Incrementally trained logistic regression (when given
      the parameter ``loss="log"``).
  LogisticRegressionCV : Logistic regression with built-in cross validation.
  
  Examples
  --------
  >>> from sklearn.datasets import load_iris
  >>> from sklearn.linear_model import LogisticRegression
  >>> X, y = load_iris(return_X_y=True)
  >>> clf = LogisticRegression(random_state=0).fit(X, y)
  >>> clf.predict(X[:2, :])
  array([0, 0])
class_docstr_tok: ["Logistic","Regression","(","aka","logit",",","MaxEnt",")","classifier",".","In","the","multiclass","case",",","the","training","algorithm","uses","the","one-vs-rest","(","OvR",")","scheme","if","the","'multi_class","'","option","is","set","to","'ovr","'",",","and","uses","the","cross-entropy","loss","if","the","'multi_class","'","option","is","set","to","'multinomial","'",".","(","Currently","the","'multinomial","'","option","is","supported","only","by","the","'lbfgs","'",",","'sag","'",",","'saga","'","and","'newton-cg","'","solvers",".",")","This","class","implements","regularized","logistic","regression","using","the","'liblinear","'","library",",","'newton-cg","'",",","'sag","'",",","'saga","'","and","'lbfgs","'","solvers",".","*","*","Note","that","regularization","is","applied","by","default","*","*",".","It","can","handle","both","dense","and","sparse","input",".","Use","C-ordered","arrays","or","CSR","matrices","containing","64-bit","floats","for","optimal","performance",";","any","other","input","format","will","be","converted","(","and","copied",")",".","The","'newton-cg","'",",","'sag","'",",","and","'lbfgs","'","solvers","support","only","L2","regularization","with","primal","formulation",",","or","no","regularization",".","The","'liblinear","'","solver","supports","both","L1","and","L2","regularization",",","with","a","dual","formulation","only","for","the","L2","penalty",".","The","Elastic-Net","regularization","is","only","supported","by","the","'saga","'","solver",".","Read","more","in","the",":","ref",":","`","User","Guide","<","logistic_regression",">","`",".","Parameters","--","--","--","--","--","penalty",":","{","'l1","'",",","'l2","'",",","'elasticnet","'",",","'none","'","}",",","default='l2'","Used","to","specify","the","norm","used","in","the","penalization",".","The","'newton-cg","'",",","'sag","'","and","'lbfgs","'","solvers","support","only","l2","penalties",".","'elasticnet","'","is","only","supported","by","the","'saga","'","solver",".","If","'none","'","(","not","supported","by","the","liblinear","solver",")",",","no","regularization","is","applied",".","..","versionadded",":",":","0.19","l1","penalty","with","SAGA","solver","(","allowing","'multinomial","'","+","L1",")","C",":","float",",","default=1.0","Inverse","of","regularization","strength",";","must","be","a","positive","float",".","Like","in","support","vector","machines",",","smaller","values","specify","stronger","regularization",".","fit_intercept",":","bool",",","default=True","Specifies","if","a","constant","(","a.k.a",".","bias","or","intercept",")","should","be","added","to","the","decision","function",".","random_state",":","int",",","RandomState","instance",",","default=None","Used","when","``","solver","``","==","'sag","'",",","'saga","'","or","'liblinear","'","to","shuffle","the","data",".","See",":","term",":","`","Glossary","<","random_state",">","`","for","details",".","solver",":","SGD","(","stochastic","gradient","descent",")","max_iter",":","int",",","default=100","Maximum","number","of","iterations","taken","for","the","solvers","to","converge",".","multi_class",":","{","'auto","'",",","'ovr","'",",","'multinomial","'","}",",","default='auto'","If","the","option","chosen","is","'ovr","'",",","then","a","binary","problem","is","fit","for","each","label",".","For","'multinomial","'","the","loss","minimised","is","the","multinomial","loss","fit","across","the","entire","probability","distribution",",","*","even","when","the","data","is","binary","*",".","'multinomial","'","is","unavailable","when","solver='liblinear","'",".","'auto","'","selects","'ovr","'","if","the","data","is","binary",",","or","if","solver='liblinear","'",",","and","otherwise","selects","'multinomial","'",".","..","versionadded",":",":","0.18","Stochastic","Average","Gradient","descent","solver","for","'multinomial","'","case",".","..","versionchanged",":",":","0.22","Default","changed","from","'ovr","'","to","'auto","'","in","0.22.","verbose",":","int",",","default=0","For","the","liblinear","and","lbfgs","solvers","set","verbose","to","any","positive","number","for","verbosity",".","Attributes","--","--","--","--","--","coef_",":","ndarray","of","shape","(","1",",","n_features",")","or","(","n_classes",",","n_features",")","Coefficient","of","the","features","in","the","decision","function",".","`","coef_","`","is","of","shape","(","1",",","n_features",")","when","the","given","problem","is","binary",".","In","particular",",","when","`","multi_class='multinomial","'","`",",","`","coef_","`","corresponds","to","outcome","1","(","True",")","and","`","-coef_","`","corresponds","to","outcome","0","(","False",")",".","intercept_",":","ndarray","of","shape","(","1",",",")","or","(","n_classes",",",")","Intercept","(","a.k.a",".","bias",")","added","to","the","decision","function",".","If","`","fit_intercept","`","is","set","to","False",",","the","intercept","is","set","to","zero",".","`","intercept_","`","is","of","shape","(","1",",",")","when","the","given","problem","is","binary",".","In","particular",",","when","`","multi_class='multinomial","'","`",",","`","intercept_","`","corresponds","to","outcome","1","(","True",")","and","`","-intercept_","`","corresponds","to","outcome","0","(","False",")",".","See","Also","--","--","--","--","SGDClassifier",":","Incrementally","trained","logistic","regression","(","when","given","the","parameter","``","loss=","''","log","''","``",")",".","LogisticRegressionCV",":","Logistic","regression","with","built-in","cross","validation",".","Examples","--","--","--","--",">",">",">","from","sklearn.datasets","import","load_iris",">",">",">","from","sklearn.linear_model","import","LogisticRegression",">",">",">","X",",","y","=","load_iris","(","return_X_y=True",")",">",">",">","clf","=","LogisticRegression","(","random_state=0",")",".fit","(","X",",","y",")",">",">",">","clf.predict","(","X","[",":2",",",":","]",")","array","(","[","0",",","0","]",")"]
docstr: Probability estimates.
  
  The returned estimates for all classes are ordered by the
  label of classes.
  
  For a multi_class problem, if multi_class is set to be "multinomial"
  the softmax function is used to find the predicted probability of
  each class.
  Else use a one-vs-rest approach, i.e calculate the probability
  of each class assuming it to be positive using the logistic function.
  and normalize these values across all the classes.
  
  Parameters
  ----------
  X : array-like of shape (n_samples, n_features)
      Vector to be scored, where `n_samples` is the number of samples and
      `n_features` is the number of features.
  
  Returns
  -------
  T : array-like of shape (n_samples, n_classes)
      Returns the probability of the sample for each class in the model,
      where classes are ordered as they are in ``self.classes_``.
docstr_tok: ["Probability","estimates",".","The","returned","estimates","for","all","classes","are","ordered","by","the","label","of","classes",".","For","a","multi_class","problem",",","if","multi_class","is","set","to","be","``","multinomial","''","the","softmax","function","is","used","to","find","the","predicted","probability","of","each","class",".","Else","use","a","one-vs-rest","approach",",","i.e","calculate","the","probability","of","each","class","assuming","it","to","be","positive","using","the","logistic","function",".","and","normalize","these","values","across","all","the","classes",".","Parameters","--","--","--","--","--","X",":","array-like","of","shape","(","n_samples",",","n_features",")","Vector","to","be","scored",",","where","`","n_samples","`","is","the","number","of","samples","and","`","n_features","`","is","the","number","of","features",".","Returns","--","--","--","-","T",":","array-like","of","shape","(","n_samples",",","n_classes",")","Returns","the","probability","of","the","sample","for","each","class","in","the","model",",","where","classes","are","ordered","as","they","are","in","``","self.classes_","``","."]
code: def predict_proba(self, X):
      """
      Probability estimates.
  
      The returned estimates for all classes are ordered by the
      label of classes.
  
      For a multi_class problem, if multi_class is set to be "multinomial"
      the softmax function is used to find the predicted probability of
      each class.
      Else use a one-vs-rest approach, i.e calculate the probability
      of each class assuming it to be positive using the logistic function.
      and normalize these values across all the classes.
  
      Parameters
      ----------
      X : array-like of shape (n_samples, n_features)
          Vector to be scored, where `n_samples` is the number of samples and
          `n_features` is the number of features.
  
      Returns
      -------
      T : array-like of shape (n_samples, n_classes)
          Returns the probability of the sample for each class in the model,
          where classes are ordered as they are in ``self.classes_``.
      """
      check_is_fitted(self)
      decision = self.decision_function(X)
  
      return softmax(decision, copy=False).execute()
  
file_path: mars/mars/learn/glm/_logistic.py
imports: import numbers
  from sklearn.utils.validation import _deprecate_positional_args
  from ...None import tensor
  from ..linear_model._base import LinearClassifierMixin
  from ..base import BaseEstimator
  from ..utils.validation import check_is_fitted
  from ..utils.multiclass import check_classification_targets
  from ..utils.extmath import softmax
  from ._optimizers import gradient_descent
label_desc: Use image node_id 3 for calling the LogisticRegression obj's underlying member method code with example usage: obj.predict_proba(X) and returns: softmax