class_docstr: DummyClassifier is a classifier that makes predictions using simple rules.
  
  This classifier is useful as a simple baseline to compare with other
  (real) classifiers. Do not use it for real problems.
  
  Read more in the :ref:`User Guide <dummy_estimators>`.
  
  Parameters
  ----------
  strategy : str, default="stratified"
      Strategy to use to generate predictions.
  
      * "stratified": generates predictions by respecting the training
        set's class distribution.
      * "most_frequent": always predicts the most frequent label in the
        training set.
      * "prior": always predicts the class that maximizes the class prior
        (like "most_frequent") and ``predict_proba`` returns the class prior.
      * "uniform": generates predictions uniformly at random.
      * "constant": always predicts a constant label that is provided by
        the user. This is useful for metrics that evaluate a non-majority
        class
  
        .. versionadded:: 0.17
           Dummy Classifier now supports prior fitting strategy using
           parameter *prior*.
  
  random_state : int seed, RandomState instance, or None (default)
      The seed of the pseudo random number generator to use.
  
  constant : int or str or array of shape = [n_outputs]
      The explicit constant as predicted by the "constant" strategy. This
      parameter is useful only for the "constant" strategy.
  
  Attributes
  ----------
  classes_ : array or list of array of shape = [n_classes]
      Class labels for each output.
  
  n_classes_ : array or list of array of shape = [n_classes]
      Number of label for each output.
  
  class_prior_ : array or list of array of shape = [n_classes]
      Probability of each class for each output.
  
  n_outputs_ : int,
      Number of outputs.
  
  outputs_2d_ : bool,
      True if the output at fit is 2d, else false.
  
  sparse_output_ : bool,
      True if the array returned from predict is to be in sparse CSC format.
      Is automatically set to True if the input y is passed in sparse format.
class_docstr_tok: ["DummyClassifier","is","a","classifier","that","makes","predictions","using","simple","rules",".","This","classifier","is","useful","as","a","simple","baseline","to","compare","with","other","(","real",")","classifiers",".","Do","not","use","it","for","real","problems",".","Read","more","in","the",":","ref",":","`","User","Guide","<","dummy_estimators",">","`",".","Parameters","--","--","--","--","--","strategy",":","str",",","default=","''","stratified","''","Strategy","to","use","to","generate","predictions",".","*","``","stratified","''",":","generates","predictions","by","respecting","the","training","set","'s","class","distribution",".","*","``","most_frequent","''",":","always","predicts","the","most","frequent","label","in","the","training","set",".","*","``","prior","''",":","always","predicts","the","class","that","maximizes","the","class","prior","(","like","``","most_frequent","''",")","and","``","predict_proba","``","returns","the","class","prior",".","*","``","uniform","''",":","generates","predictions","uniformly","at","random",".","*","``","constant","''",":","always","predicts","a","constant","label","that","is","provided","by","the","user",".","This","is","useful","for","metrics","that","evaluate","a","non-majority","class","..","versionadded",":",":","0.17","Dummy","Classifier","now","supports","prior","fitting","strategy","using","parameter","*","prior","*",".","random_state",":","int","seed",",","RandomState","instance",",","or","None","(","default",")","The","seed","of","the","pseudo","random","number","generator","to","use",".","constant",":","int","or","str","or","array","of","shape","=","[","n_outputs","]","The","explicit","constant","as","predicted","by","the","``","constant","''","strategy",".","This","parameter","is","useful","only","for","the","``","constant","''","strategy",".","Attributes","--","--","--","--","--","classes_",":","array","or","list","of","array","of","shape","=","[","n_classes","]","Class","labels","for","each","output",".","n_classes_",":","array","or","list","of","array","of","shape","=","[","n_classes","]","Number","of","label","for","each","output",".","class_prior_",":","array","or","list","of","array","of","shape","=","[","n_classes","]","Probability","of","each","class","for","each","output",".","n_outputs_",":","int",",","Number","of","outputs",".","outputs_2d_",":","bool",",","True","if","the","output","at","fit","is","2d",",","else","false",".","sparse_output_",":","bool",",","True","if","the","array","returned","from","predict","is","to","be","in","sparse","CSC","format",".","Is","automatically","set","to","True","if","the","input","y","is","passed","in","sparse","format","."]
docstr: Return probability estimates for the test vectors X.
  
  Parameters
  ----------
  X : {array-like, sparse matrix}, shape = [n_samples, n_features]
      Input vectors, where n_samples is the number of samples
      and n_features is the number of features.
  
  Returns
  -------
  P : array-like or list of array-lke of shape = [n_samples, n_classes]
      Returns the probability of the sample for each class in
      the model, where classes are ordered arithmetically, for each
      output.
docstr_tok: ["Return","probability","estimates","for","the","test","vectors","X.","Parameters","--","--","--","--","--","X",":","{","array-like",",","sparse","matrix","}",",","shape","=","[","n_samples",",","n_features","]","Input","vectors",",","where","n_samples","is","the","number","of","samples","and","n_features","is","the","number","of","features",".","Returns","--","--","--","-","P",":","array-like","or","list","of","array-lke","of","shape","=","[","n_samples",",","n_classes","]","Returns","the","probability","of","the","sample","for","each","class","in","the","model",",","where","classes","are","ordered","arithmetically",",","for","each","output","."]
code: def predict_proba(self, X):
      """
      Return probability estimates for the test vectors X.
  
      Parameters
      ----------
      X : {array-like, sparse matrix}, shape = [n_samples, n_features]
          Input vectors, where n_samples is the number of samples
          and n_features is the number of features.
  
      Returns
      -------
      P : array-like or list of array-lke of shape = [n_samples, n_classes]
          Returns the probability of the sample for each class in
          the model, where classes are ordered arithmetically, for each
          output.
      """
      check_is_fitted(self, "classes_")
  
      X = check_array(X, accept_sparse=["csr", "csc", "coo"])
      # numpy random_state expects Python int and not long as size argument
      # under Windows
      n_samples = int(X.shape[0])
      rs = check_random_state(self.random_state)
  
      n_classes_ = self.n_classes_
      classes_ = self.classes_
      class_prior_ = self.class_prior_
      constant = self.constant
      if self.n_outputs_ == 1 and not self.output_2d_:
          # Get same type even for self.n_outputs_ == 1
          n_classes_ = [n_classes_]
          classes_ = [classes_]
          class_prior_ = [class_prior_]
          constant = [constant]
  
      P = []
      for k in range(self.n_outputs_):
          if self.strategy == "most_frequent":
              ind = class_prior_[k].argmax()
              out = np.zeros(
                  (n_samples, n_classes_[k]), dtype=np.float64
              )
              out[:, ind] = 1.0
          elif self.strategy == "prior":
              out = np.ones((n_samples, 1)) * class_prior_[k]
  
          elif self.strategy == "stratified":
              out = rs.multinomial(1, class_prior_[k], size=n_samples)
  
          elif self.strategy == "uniform":
              out = np.ones(
                  (n_samples, n_classes_[k]), dtype=np.float64
              )
              out /= n_classes_[k]
  
          elif self.strategy == "constant":
              ind = np.where(classes_[k] == constant[k])
              out = np.zeros(
                  (n_samples, n_classes_[k]), dtype=np.float64
              )
              out[:, ind] = 1.0
  
          P.append(out)
  
      if self.n_outputs_ == 1 and not self.output_2d_:
          P = P[0]
  
      return P
  
imports: from __future__ import division
  import warnings
  import numpy
  import scipy.sparse
  from .base import BaseEstimator, ClassifierMixin, RegressorMixin
  from .utils import check_random_state
  from .utils.validation import check_array
  from .utils.validation import check_consistent_length
  from .utils.validation import check_is_fitted
  from .utils.random import random_choice_csc
  from .utils.stats import _weighted_percentile
  from .utils.multiclass import class_distribution
label_desc: Use image node_id 4 for calling the DummyClassifier obj's underlying member method code with example usage: obj.predict_proba(X) and returns: P