code: def test_not_fitted_raises(self, net_cls, module_cls, data, method):
      from skorch.exceptions import NotInitializedError
  
      net = net_cls(module_cls)
      X = data[0]
      with pytest.raises(NotInitializedError) as exc:
          # we call `list` because `forward_iter` is lazy
          list(getattr(net, method)(X))
  
      msg = (
          "This NeuralNetBinaryClassifier instance is not initialized "
          "yet. Call 'initialize' or 'fit' with appropriate arguments "
          "before using this method."
      )
      assert exc.value.args[0] == msg
  
imports: from unittest.mock import Mock
  import numpy
  import pytest
  import torch
  from scipy.special import expit
  from sklearn.base import clone
  from torch import nn
  from skorch.tests.conftest import INFERENCE_METHODS
label_desc: Use image node_id 8 for calling the TestNeuralNetBinaryClassifier obj's underlying member method code with example usage: obj.test_not_fitted_raises(net_cls, module_cls, data, method) without return types