code: def test_baseline_continuous(
      art_warning, get_iris_dataset, model_type
  ):
      try:
          attack_feature = 2  # petal length
  
          (x_train_iris, y_train_iris), (
              x_test_iris,
              y_test_iris,
          ) = get_iris_dataset
  
          # training data without attacked feature
          x_train_for_attack = np.delete(
              x_train_iris, attack_feature, 1
          )
          # only attacked feature
          x_train_feature = (
              x_train_iris[:, attack_feature].copy().reshape(-1, 1)
          )
  
          # test data without attacked feature
          x_test_for_attack = np.delete(x_test_iris, attack_feature, 1)
          # only attacked feature
          x_test_feature = (
              x_test_iris[:, attack_feature].copy().reshape(-1, 1)
          )
  
          baseline_attack = AttributeInferenceBaseline(
              attack_feature=attack_feature,
              attack_model_type=model_type,
              is_continuous=True,
          )
          # train attack model
          baseline_attack.fit(x_train_iris)
          # infer attacked feature
          baseline_inferred_train = baseline_attack.infer(
              x_train_for_attack
          )
          baseline_inferred_test = baseline_attack.infer(
              x_test_for_attack
          )
          # check accuracy
          assert (
              np.count_nonzero(
                  np.isclose(
                      baseline_inferred_train,
                      x_train_feature.reshape(1, -1),
                      atol=0.4,
                  )
              )
              > baseline_inferred_train.shape[0] * 0.75
          )
          assert (
              np.count_nonzero(
                  np.isclose(
                      baseline_inferred_test,
                      x_test_feature.reshape(1, -1),
                      atol=0.4,
                  )
              )
              > baseline_inferred_test.shape[0] * 0.75
          )
  
      except ARTTestException as e:
          art_warning(e)
  
file_path: adversarial-robustness-toolbox/tests/attacks/inference/attribute_inference/test_baseline.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  import pytest
  import numpy
  from sklearn.compose import ColumnTransformer
  from sklearn.preprocessing import OrdinalEncoder
  from art.attacks.inference.attribute_inference.baseline import AttributeInferenceBaseline
  from art.utils import check_and_transform_label_format
  from tests.utils import ARTTestException
label_desc: Use image node_id 2 for calling a global function with example usage: test_baseline_continuous(art_warning, get_iris_dataset, model_type) without return types