code: def _test_linear(self, classes, model_class):
      n_features = 10
      n_total = 100
      np.random.seed(0)
      warnings.filterwarnings("ignore")
      X = np.random.rand(n_total, n_features)
      X = np.array(X, dtype=np.float32)
      y = np.random.randint(classes, size=(n_total, 1))
  
      arr = np.concatenate([y, X], axis=1).reshape(n_total, -1)
      df = map(lambda x: (int(x[0]), Vectors.dense(x[1:])), arr)
      df = sql.createDataFrame(df, schema=["label", "features"])
  
      model = model_class()
      model = model.fit(df)
  
      test_df = df.select("features").limit(10)
      torch_model = convert(model, "torch", test_df)
      self.assertTrue(torch_model is not None)
      np.testing.assert_allclose(
          np.array(
              model.transform(df).select("probability").collect()
          ).reshape(-1, classes),
          torch_model.predict_proba(X),
          rtol=1e-06,
          atol=1e-06,
      )
  
file_path: hummingbird/tests/test_sparkml_linear_converter.py
imports: import unittest
  import warnings
  import numpy
  import torch
  from hummingbird.ml._utils import sparkml_installed, pandas_installed
  from hummingbird.ml import convert
  from packaging.version import Version, parse
label_desc: Use image node_id 1 for calling the TestSparkMLLinear obj's underlying member method code with example usage: obj._test_linear(classes, model_class) without return types