code: def test_bias_transform():
      algo = Bias()
      ratings = ml_test.ratings
  
      normed = algo.fit_transform(ratings)
  
      assert all(normed["user"] == ratings["user"])
      assert all(normed["item"] == ratings["item"])
      denorm = algo.inverse_transform(normed)
      assert denorm["rating"].values == approx(
          ratings["rating"], 1.0e-6
      )
  
      n2 = ratings.join(algo.item_offsets_, on="item")
      n2 = n2.join(algo.user_offsets_, on="user")
      nr = n2.rating - algo.mean_ - n2.i_off - n2.u_off
      assert normed["rating"].values == approx(nr.values)
  
imports: from lenskit.algorithms.bias import Bias
  from lenskit import util
  import logging
  import pickle
  import binpickle
  import pandas
  import numpy
  from pytest import approx, raises, mark
  from lenskit.util.test import ml_test
label_desc: Use image node_id 15 for calling a global function with example usage: test_bias_transform() without return types