code: def test_iforest_error():
      """Test that it gives proper exception on deficient input."""
      iris = load_iris()
      X = iris.data
  
      # Test max_samples
      with pytest.raises(ValueError):
          IsolationForest(max_samples=-1).fit(X)
      with pytest.raises(ValueError):
          IsolationForest(max_samples=0.0).fit(X)
      with pytest.raises(ValueError):
          IsolationForest(max_samples=2.0).fit(X)
  
      with pytest.raises(ValueError):
          IsolationForest(max_samples="foobar").fit(X)
      with pytest.raises(ValueError):
          IsolationForest(max_samples=1.5).fit(X)
  
      # test X_test n_features match X_train one:
      with pytest.raises(ValueError):
          IsolationForest().fit(X).predict(X[:, 1:])
  
file_path: mars/mars/learn/ensemble/tests/test_iforest.py
imports: import numpy
  import pytest
  from sklearn.datasets import load_iris
  from ....None import tensor
  from .._iforest import IsolationForest
label_desc: Use image node_id 3 for calling a global function with example usage: test_iforest_error() without return types