code: def test_fit_NA_encoder():
      """Test fit method of NA_encoder class."""
      df = pd.read_csv("data_for_tests/train.csv")
  
      encoder = NA_encoder(numerical_strategy="wrong_strategy")
      with pytest.raises(ValueError):
          encoder.fit(df, df["Survived"])
      encoder.set_params(numerical_strategy="mean")
      encoder.fit(df, df["Survived"])
      assert encoder._NA_encoder__fitOK
      encoder.set_params(numerical_strategy="median")
      encoder.fit(df, df["Survived"])
      assert encoder._NA_encoder__fitOK
      encoder.set_params(numerical_strategy="most_frequent")
      encoder.fit(df, df["Survived"])
      assert encoder._NA_encoder__fitOK
      encoder.set_params(numerical_strategy=3.0)
      encoder.fit(df, df["Survived"])
      assert encoder._NA_encoder__fitOK
  
      encoder = NA_encoder(categorical_strategy=2)
      with pytest.raises(ValueError):
          encoder.fit(df, df["Survived"])
      encoder.set_params(categorical_strategy="<NULL>")
      encoder.fit(df, df["Survived"])
      assert encoder._NA_encoder__fitOK
      encoder.set_params(categorical_strategy="most_frequent")
      encoder.fit(df, df["Survived"])
  
file_path: MLBox/tests/test_na_encoder.py
imports: import pytest
  import pandas
  from mlbox.encoding.na_encoder import NA_encoder
label_desc: Use image node_id 4 for calling a global function with example usage: test_fit_NA_encoder() without return types