code: def test_patsy_matrices(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("A ~ B + C")
      self.assertIsInstance(result, pdml.ModelFrame)
      self.assertEqual(result.shape, (3, 4))
      tm.assert_index_equal(result.index, pd.Index(["a", "b", "c"]))
      tm.assert_index_equal(
          result.columns, pd.Index(["A", "Intercept", "B", "C"])
      )
      expected = pd.DataFrame(
          {
              "A": [1, 2, 3],
              "Intercept": [1, 1, 1],
              "B": [4, 5, 6],
              "C": [7, 8, 9],
          },
          index=["a", "b", "c"],
          columns=["A", "Intercept", "B", "C"],
          dtype=float,
      )
      tm.assert_frame_equal(result, expected)
      expected = pd.Series(
          [1, 2, 3], index=["a", "b", "c"], name="A", dtype=float
      )
      tm.assert_series_equal(result.target, expected)
      self.assertEqual(result.target.name, "A")
      self.assertEqual(result.target_name, "A")
  
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 1 for calling the TestModelFrame obj's underlying member method code with example usage: obj.test_patsy_matrices() without return types