code: def test_posterior_computation(
      mocker, classes, prior, cfm, first_class_posterior
  ):
      def mock_confusion_matrix(y, y_pred):
          return np.array(cfm)
  
      mocker.patch(
          "sklego.meta.subjective_classifier.confusion_matrix",
          side_effect=mock_confusion_matrix,
      )
      mock_estimator = mocker.Mock(RandomForestClassifier())
      mock_estimator.classes_ = np.array(classes)
      subjective_model = SubjectiveClassifier(
          mock_estimator, dict(zip(classes, prior))
      )
      subjective_model.fit(
          np.zeros((10, 10)), np.array([classes[0]] * 10)
      )
      assert (
          pytest.approx(subjective_model.posterior_matrix_[0, 0], 0.001)
          == first_class_posterior
      )
      assert np.isclose(
          subjective_model.posterior_matrix_.sum(axis=0), 1
      ).all()
  
file_path: scikit-lego/tests/test_meta/test_subjective_classifier.py
imports: import numpy
  import pytest
  from sklearn.cluster import DBSCAN
  from sklearn.ensemble import RandomForestClassifier
  from sklearn.linear_model import LogisticRegression, Ridge
  from sklego.common import flatten
  from sklego.meta import SubjectiveClassifier
  from tests.conftest import classifier_checks, general_checks, select_tests
label_desc: Use image node_id 2 for calling a global function with example usage: test_posterior_computation(mocker, classes, prior, cfm, first_class_posterior) and returns: np