def test_iforest():
 X_train = np.array([[0, 1], [1, 2]])
 X_test = np.array([[2, 1], [1, 1]])
 grid = ParameterGrid({'n_estimators': [3], 'max_samples': [0.5, 1.0, 3], 'bootstrap': [True, False]})
 with ignore_warnings():
  for params in grid:
   IsolationForest(random_state=rng, **params).fit(X_train).predict(X_test)

def test_iforest ( ) : X_train = np . array ( [ [ 0 , 1 ] , [ 1 , 2 ] ] ) X_test = np . array ( [ [ 2 , 1 ] , [ 1 , 1 ] ] ) grid = ParameterGrid ( { 'n_estimators' : [ 3 ] , 'max_samples' : [ 0.5 , 1.0 , 3 ] , 'bootstrap' : [ True , False ] } ) with ignore_warnings ( ) : for params in grid : IsolationForest ( random_state = rng , ** params ) . fit ( X_train ) . predict ( X_test )
check isolation forest for various parameter settings .