code: def test_logistic_classification_learner():
      df_train_binary = pd.DataFrame(
          {
              "id": ["id1", "id2", "id3", "id4"],
              "x1": [10.0, 13.0, 10.0, 13.0],
              "x2": [0, 1, 1, 0],
              "w": [2, 1, 2, 0.5],
              "y": [0, 1, 0, 1],
          }
      )
  
      df_test_binary = pd.DataFrame(
          {
              "id": ["id4", "id4", "id5", "id6"],
              "x1": [12.0, 1000.0, -4.0, 0.0],
              "x2": [1, 1, 0, 1],
              "w": [1, 2, 0, 0.5],
              "y": [1, 0, 0, 1],
          }
      )
  
      df_train_multinomial = pd.DataFrame(
          {
              "id": ["id1", "id2", "id3", "id4", "id4", "id6"],
              "x1": [10.0, 13.0, 10.0, 13.0, 20, 13],
              "x2": [0, 1, 1, 0, 1, 1],
              "w": [2, 1, 2, 0.5, 0.5, 3],
              "y": [0, 1, 2, 0, 1, 2],
          }
      )
  
      df_test_multinomial = pd.DataFrame(
          {
              "id": ["id4", "id4", "id5", "id6", "id6", "id7"],
              "x1": [12.0, 1000.0, -4.0, 0.0, 0.0, 1],
              "x2": [1, 1, 0, 1, 1, 0],
              "w": [1, 2, 0, 0.5, 0.1, 2],
              "y": [2, 0, 1, 1, 0, 2],
          }
      )
  
      # test binomial case
      learner_binary = logistic_classification_learner(
          features=["x1", "x2"], target="y", params={"max_iter": 2000}
      )
  
      predict_fn, pred_train, log = learner_binary(df_train_binary)
  
      pred_test = predict_fn(df_test_binary)
  
      expected_col_train = df_train_binary.columns.tolist() + [
          "prediction"
      ]
      expected_col_test = df_test_binary.columns.tolist() + [
          "prediction"
      ]
  
      assert Counter(expected_col_train) == Counter(
          pred_train.columns.tolist()
      )
      assert Counter(expected_col_test) == Counter(
          pred_test.columns.tolist()
      )
      assert pred_test.prediction.max() < 1
      assert pred_test.prediction.min() > 0
      assert (pred_test.columns == pred_train.columns).all()
  
      # test multinomial case
      learner_multinomial = logistic_classification_learner(
          features=["x1", "x2"],
          target="y",
          params={
              "multi_class": "multinomial",
              "solver": "sag",
              "max_iter": 2000,
          },
          weight_column="w",
      )
  
      predict_fn, pred_train, log = learner_multinomial(
          df_train_multinomial
      )
  
      pred_test = predict_fn(df_test_multinomial)
  
      expected_col_train = df_train_binary.columns.tolist() + [
          "prediction_0",
          "prediction_1",
          "prediction_2",
          "prediction",
      ]
      expected_col_test = df_test_binary.columns.tolist() + [
          "prediction_0",
          "prediction_1",
          "prediction_2",
          "prediction",
      ]
  
      assert Counter(expected_col_train) == Counter(
          pred_train.columns.tolist()
      )
      assert Counter(expected_col_test) == Counter(
          pred_test.columns.tolist()
      )
      assert (pred_test.columns == pred_train.columns).all()
  
file_path: fklearn/tests/training/test_classification.py
imports: from collections import Counter
  import numpy
  import pandas
  from fklearn.training.classification import logistic_classification_learner, xgb_classification_learner, nlp_logistic_classification_learner, lgbm_classification_learner, catboost_classification_learner
  from unittest.mock import MagicMock, patch, Mock
label_desc: Use image node_id 1 for calling a global function with example usage: test_logistic_classification_learner() without return types