docstr: ...Test that class encoding is well done for LogReg
          
docstr_tok: ["...","Test","that","class","encoding","is","well","done","for","LogReg"]
code: def test_labels_encoding(self):
      """...Test that class encoding is well done for LogReg"""
      learner = LogisticRegression(max_iter=1)
  
      np.random.seed(38027)
      n_features = 3
      n_samples = 5
      X = np.random.rand(n_samples, n_features)
  
      encoded_y = np.array([1.0, -1.0, 1.0, -1.0, -1.0])
      learner.fit(X, encoded_y)
      np.testing.assert_array_equal(learner.classes, [-1.0, 1.0])
      np.testing.assert_array_equal(
          learner._encode_labels_vector(encoded_y), encoded_y
      )
  
      zero_one_y = np.array([1.0, 0.0, 1.0, 0.0, 0.0])
      learner.fit(X, zero_one_y)
      np.testing.assert_array_equal(learner.classes, [0.0, 1.0])
      np.testing.assert_array_equal(
          learner._encode_labels_vector(zero_one_y), encoded_y
      )
  
      text_y = np.array(["cat", "dog", "cat", "dog", "dog"])
      learner.fit(X, text_y)
      np.testing.assert_array_equal(
          set(learner.classes), {"cat", "dog"}
      )
      encoded_text_y = learner._encode_labels_vector(text_y)
      np.testing.assert_array_equal(
          encoded_text_y,
          encoded_y
          * np.sign(encoded_text_y[0])
          * np.sign(encoded_y[0]),
      )
  
imports: import itertools
  import unittest
  import numpy
  from sklearn.metrics import roc_auc_score
  from tick.base.inference import InferenceTest
  from tick.linear_model import SimuLogReg, LogisticRegression
  from tick.simulation import weights_sparse_gauss
  from tick.preprocessing.features_binarizer import FeaturesBinarizer
  from tick.prox import ProxZero, ProxL1, ProxL2Sq, ProxElasticNet, ProxTV, ProxBinarsity
label_desc: Use image node_id 15 for calling the Test obj's underlying member method code with example usage: obj.test_labels_encoding() without return types