code: def test_from_summaries_inertia(X, y):
      d = [Exponential([2.1, 0.3, 0.1]), Exponential([1.5, 3.1, 2.2])]
      model = BayesClassifier(d, priors=[0.2, 0.8], inertia=0.3)
      model.summarize(X, y)
      model.from_summaries()
  
      assert_array_almost_equal(model._w_sum, [0.0, 0.0])
      assert_array_almost_equal(model.priors, [0.441818, 0.558182])
      assert_array_almost_equal(
          model._log_priors, numpy.log([0.441818, 0.558182])
      )
  
      d = [Exponential([2.1, 0.3, 0.1]), Exponential([1.5, 3.1, 2.2])]
      model = BayesClassifier(d, priors=[0.2, 0.8], inertia=1.0)
      model.summarize(X, y)
      model.from_summaries()
  
      assert_array_almost_equal(model._w_sum, [0.0, 0.0])
      assert_array_almost_equal(model.priors, [0.2, 0.8])
      assert_array_almost_equal(
          model._log_priors, numpy.log([0.2, 0.8])
      )
  
      s1, s2 = [2.1, 0.3, 0.1], [1.5, 3.1, 2.2]
      d = [Exponential(s1, inertia=1.0), Exponential(s2, inertia=1.0)]
      model = BayesClassifier(d, priors=[0.2, 0.8])
      model.summarize(X, y)
      model.from_summaries()
  
      assert_array_almost_equal(model.distributions[0].scales, s1)
      assert_array_almost_equal(model.distributions[1].scales, s2)
  
      assert_array_almost_equal(model._w_sum, [0.0, 0.0])
      assert_array_almost_equal(model.priors, [0.545455, 0.454545])
      assert_array_almost_equal(
          model._log_priors, numpy.log([0.545455, 0.454545])
      )
  
      d = [Exponential(s1, inertia=1.0), Exponential(s2)]
      model = BayesClassifier(d, priors=[0.2, 0.8], inertia=1.0)
      model.summarize(X, y)
      model.from_summaries()
  
      assert_array_almost_equal(model.distributions[0].scales, s1)
      assert_array_almost_equal(
          model.distributions[1].scales, [1.2, 1.4, 0.6]
      )
  
      assert_array_almost_equal(model._w_sum, [0.0, 0.0])
      assert_array_almost_equal(model.priors, [0.2, 0.8])
      assert_array_almost_equal(
          model._log_priors, numpy.log([0.2, 0.8])
      )
  
imports: import os
  import numpy
  import torch
  import pytest
  from pomegranate.bayes_classifier import BayesClassifier
  from pomegranate.distributions import Exponential
  from .distributions._utils import _test_initialization_raises_one_parameter
  from .distributions._utils import _test_initialization
  from .distributions._utils import _test_predictions
  from .distributions._utils import _test_efd_from_summaries
  from .distributions._utils import _test_raises
  from nose.tools import assert_raises
  from numpy.testing import assert_array_almost_equal
label_desc: Use image node_id 29 for calling a global function with example usage: test_from_summaries_inertia(X, y) without return types