class_docstr: Blockwise training and ensemble voting classifier.
  
  This classifier trains on blocks / partitions of Dask Arrays or DataFrames.
  A cloned version of `estimator` will be fit *independently* on each block
  or partition of the Dask collection. This is useful when the sub estimator
  only works on small in-memory data structures like a NumPy array or pandas
  DataFrame.
  
  Prediction is done by the *ensemble* of learned models.
  
  .. warning::
  
     Ensure that your data are sufficiently shuffled prior to training!
     If the values of the various blocks / partitions of your dataset are not
     distributed similarly, the classifier will give poor results.
  
  Parameters
  ----------
  estimator : Estimator
  voting : str, {'hard', 'soft'} (default='hard')
      If 'hard', uses predicted class labels for majority rule voting.
      Else if 'soft', predicts the class label based on the argmax of
      the sums of the predicted probabilities, which is recommended for
      an ensemble of well-calibrated classifiers.
  classes : list-like, optional
      The set of classes that `y` can take. This can also be provided as
      a fit param if the underlying estimator requires `classes` at fit time.
  
  Attributes
  ----------
  estimators_ : list of classifiers
      The collection of fitted sub-estimators that are `estimator` fitted
      on each partition / block of the inputs.
  
  classes_ : array-like, shape (n_predictions,)
      The class labels.
  
  Examples
  --------
  >>> import dask_ml.datasets
  >>> import dask_ml.ensemble
  >>> import sklearn.linear_model
  >>> X, y = dask_ml.datasets.make_classification(n_samples=100_000,
  >>> ...                                         chunks=10_000)
  >>> subestimator = sklearn.linear_model.RidgeClassifier(random_state=0)
  >>> clf = dask_ml.ensemble.BlockwiseVotingClassifier(
  >>> ...     subestimator,
  >>> ...     classes=[0, 1]
  >>> ... )
  >>> clf.fit(X, y)
class_docstr_tok: ["Blockwise","training","and","ensemble","voting","classifier",".","This","classifier","trains","on","blocks","\/","partitions","of","Dask","Arrays","or","DataFrames",".","A","cloned","version","of","`","estimator","`","will","be","fit","*","independently","*","on","each","block","or","partition","of","the","Dask","collection",".","This","is","useful","when","the","sub","estimator","only","works","on","small","in-memory","data","structures","like","a","NumPy","array","or","pandas","DataFrame",".","Prediction","is","done","by","the","*","ensemble","*","of","learned","models",".","..","warning",":",":","Ensure","that","your","data","are","sufficiently","shuffled","prior","to","training","!","If","the","values","of","the","various","blocks","\/","partitions","of","your","dataset","are","not","distributed","similarly",",","the","classifier","will","give","poor","results",".","Parameters","--","--","--","--","--","estimator",":","Estimator","voting",":","str",",","{","'hard","'",",","'soft","'","}","(","default='hard","'",")","If","'hard","'",",","uses","predicted","class","labels","for","majority","rule","voting",".","Else","if","'soft","'",",","predicts","the","class","label","based","on","the","argmax","of","the","sums","of","the","predicted","probabilities",",","which","is","recommended","for","an","ensemble","of","well-calibrated","classifiers",".","classes",":","list-like",",","optional","The","set","of","classes","that","`","y","`","can","take",".","This","can","also","be","provided","as","a","fit","param","if","the","underlying","estimator","requires","`","classes","`","at","fit","time",".","Attributes","--","--","--","--","--","estimators_",":","list","of","classifiers","The","collection","of","fitted","sub-estimators","that","are","`","estimator","`","fitted","on","each","partition","\/","block","of","the","inputs",".","classes_",":","array-like",",","shape","(","n_predictions",",",")","The","class","labels",".","Examples","--","--","--","--",">",">",">","import","dask_ml.datasets",">",">",">","import","dask_ml.ensemble",">",">",">","import","sklearn.linear_model",">",">",">","X",",","y","=","dask_ml.datasets.make_classification","(","n_samples=100_000",",",">",">",">","...","chunks=10_000",")",">",">",">","subestimator","=","sklearn.linear_model.RidgeClassifier","(","random_state=0",")",">",">",">","clf","=","dask_ml.ensemble.BlockwiseVotingClassifier","(",">",">",">","...","subestimator",",",">",">",">","...","classes=","[","0",",","1","]",">",">",">","...",")",">",">",">","clf.fit","(","X",",","y",")"]
code: def _collect_probas(self, X):
      if isinstance(X, da.Array):
          chunks = (
              len(self.estimators_),
              X.chunks[0],
              len(self.classes_),
          )
          meta = np.array([], dtype="float64")
          # (n_estimators, len(X), n_classes)
          combined = X.map_blocks(
              _predict_proba_stack,
              estimators=self.estimators_,
              chunks=chunks,
              meta=meta,
          )
      elif isinstance(X, dd._Frame):
          # TODO: replace with a _predict_proba_stack version.
          # This current raises; dask.dataframe doesn't like map_partitions that
          # return new axes.
          # meta = np.empty((len(self.estimators_), 0, len(self.classes_)),
          #                 dtype="float64")
          # combined = X.map_partitions(_predict_proba_stack, meta=meta,
          #                             estimators=self.estimators_)
          # combined._chunks = ((len(self.estimators_),),
          #                     (np.nan,) * X.npartitions,
          #                     (len(X.columns),))
          meta = np.empty((0, len(self.classes_)), dtype="float64")
          probas = [
              X.map_partitions(
                  _predict_proba, meta=meta, estimator=estimator
              )
              for estimator in self.estimators_
          ]
          # TODO(https://github.com/dask/dask/issues/6177): replace with da.stack
          chunks = probas[0]._chunks
          for proba in probas:
              proba._chunks = ((1,) * len(chunks[0]), chunks[1])
  
          combined = da.stack(probas)
          combined._chunks = ((1,) * len(self.estimators_),) + chunks
      else:
          # ndarray, etc.
          combined = np.stack(
              [
                  estimator.predict_proba(X)
                  for estimator in self.estimators_
              ]
          )
  
      return combined
  
imports: import dask
  import dask.array
  import dask.dataframe
  import numpy
  import sklearn.base
  from sklearn.utils.validation import check_is_fitted
  from ..base import ClassifierMixin, RegressorMixin
  from ..utils import check_array
label_desc: Use image node_id 6 for calling the BlockwiseVotingClassifier obj's underlying member method code with example usage: obj._collect_probas(X) and returns: combined