class_docstr: Monte Carlo Sampling Classifier Chains.
  
  Probabilistic Classifier Chains using Monte Carlo sampling, as
  described in [^1].
  
  m samples are taken from the posterior distribution. Therefore we
  need a probabilistic interpretation of the output, and thus, this is a
  particular variety of ProbabilisticClassifierChain.
  
  Parameters
  ----------
  model
  m
      Number of samples to take from the posterior distribution.
  seed
      Random number generator seed for reproducibility.
  
  Examples
  --------
  >>> from river import feature_selection
  >>> from river import linear_model
  >>> from river import metrics
  >>> from river import multioutput
  >>> from river import preprocessing
  >>> from river.datasets import synth
  
  >>> dataset = synth.Logical(seed=42, n_tiles=100)
  
  >>> model = multioutput.MonteCarloClassifierChain(
  ...     model=linear_model.LogisticRegression(),
  ...     m=10,
  ...     seed=42
  ... )
  
  >>> metric = metrics.multioutput.MicroAverage(metrics.Jaccard())
  
  >>> for x, y in dataset:
  ...    y_pred = model.predict_one(x)
  ...    y_pred = {k: y_pred.get(k, 0) for k in y}
  ...    metric.update(y, y_pred)
  ...    model.learn_one(x, y)
  
  >>> metric
  MicroAverage(Jaccard): 51.79%
  
  References
  ----------
  [^1]: Read, J., Martino, L., & Luengo, D. (2014). Efficient monte carlo
        methods for multi-dimensional learning with classifier chains.
        Pattern Recognition, 47(3), 1535-1546.
code: def predict_one(self, x, **kwargs):
      y_pred = {}
  
      if not isinstance(self.order, list):
          return y_pred
  
      y_pred = ClassifierChain.predict_one(self, x, **kwargs)
      max_payoff = self._payoff(x=x, y=y_pred)
      # for M times
      for m in range(self.m):
          y_, p_ = self._sample(
              x
          )  # N.B. in fact, the calculation p_ is done again in P.
          payoff = self._payoff(x=x, y=y_)
          # if it performs well, keep it, and record the max
          if payoff > max_payoff:
              y_pred = copy.copy(y_)
              max_payoff = payoff
      return y_pred
  
imports: from __future__ import annotations
  import collections
  import copy
  import functools
  import random
  from river import base, linear_model
  from river.utils.math import minkowski_distance, prod
label_desc: Use image node_id 3 for calling the MonteCarloClassifierChain obj's underlying member method code with example usage: obj.predict_one(x) and returns: y_pred, y_pred