code: def test_fit_encoder():
      """Test method fit of Categorical_encoder class."""
      df = pd.read_csv("data_for_tests/train.csv")
      encoder = Categorical_encoder(strategy="wrong_strategy")
      with pytest.raises(ValueError):
          encoder.fit(df, df["Survived"])
      encoder.set_params(strategy="label_encoding")
      encoder.fit(df, df["Survived"])
      assert encoder._Categorical_encoder__fitOK
      encoder.set_params(strategy="dummification")
      encoder.fit(df, df["Survived"])
      assert encoder._Categorical_encoder__fitOK
      encoder.set_params(strategy="random_projection")
      encoder.fit(df, df["Survived"])
      assert encoder._Categorical_encoder__fitOK
      encoder.set_params(strategy="entity_embedding")
      encoder.fit(df, df["Survived"])
      assert encoder._Categorical_encoder__fitOK
  
file_path: MLBox/tests/test_categorical_encoder.py
imports: import pytest
  import pandas
  from mlbox.encoding.categorical_encoder import Categorical_encoder
label_desc: Use image node_id 4 for calling a global function with example usage: test_fit_encoder() without return types