code: def test_patsy_matrix(self):
      df = pd.DataFrame(
          {"A": [1, 2, 3], "B": [4, 5, 6], "C": [7, 8, 9]},
          index=["a", "b", "c"],
          columns=["A", "B", "C"],
      )
      s = pd.Series([10, 11, 12], index=["a", "b", "c"])
      mdf = pdml.ModelFrame(df, target=s)
  
      result = mdf.transform("B + C")
      self.assertIsInstance(result, pdml.ModelFrame)
      self.assertEqual(result.shape, (3, 3))
      tm.assert_index_equal(result.index, pd.Index(["a", "b", "c"]))
      tm.assert_index_equal(
          result.columns, pd.Index(["Intercept", "B", "C"])
      )
      expected = pd.DataFrame(
          {"Intercept": [1, 1, 1], "B": [4, 5, 6], "C": [7, 8, 9]},
          index=["a", "b", "c"],
          columns=["Intercept", "B", "C"],
          dtype=float,
      )
      tm.assert_frame_equal(result, expected)
      self.assertFalse(result.has_target())
      self.assertEqual(result.target_name, ".target")
  
file_path: pandas-ml/pandas_ml/misc/test/test_patsy.py
imports: import pandas
  import pandas_ml
  import pandas_ml.util.testing
label_desc: Use image node_id 2 for calling the TestModelFrame obj's underlying member method code with example usage: obj.test_patsy_matrix() without return types