code: def fit_proba(
      clf,
      X,
      y_proba,
      expand_factor=10,
      sample_weight=None,
      shuffle=True,
      random_state=None,
      **fit_params,
  ):
      """
      Fit classifier ``clf`` to return probabilities close to ``y_proba``.
  
      scikit-learn can't optimize cross-entropy directly if target
      probability values are not indicator vectors. As a workaround this function
      expands the dataset according to target probabilities.
      Use expand_factor=None to turn it off
      (e.g. if probability scores are 0/1 in a first place).
      """
      X, y, sample_weight = expanded_X_y_sample_weights(
          X,
          y_proba,
          expand_factor=expand_factor,
          sample_weight=sample_weight,
          shuffle=shuffle,
          random_state=random_state,
      )
      fit_params = with_sample_weight(clf, sample_weight, fit_params)
      clf.fit(X, y, **fit_params)
      return clf
  
imports: from __future__ import absolute_import
  from typing import List, Any
  import numpy
  from scipy.stats import entropy
  from sklearn.pipeline import Pipeline
  from sklearn.utils import check_random_state, issparse
  from sklearn.utils.metaestimators import if_delegate_has_method
  from sklearn.utils import shuffle
  from eli5.utils import vstack
  from eli5.sklearn.utils import sklearn_version
label_desc: Use image node_id 1 for calling a global function with example usage: fit_proba(clf, X, y_proba, expand_factor, sample_weight, shuffle, random_state) and returns: clf