code: def test_handle_errors(self):
      with self.assertRaises(ValueError):
          # size of target data not the same as
          # size of input data.
          pnnet = algorithms.PNN(std=0.1, verbose=False)
          pnnet.train(np.array([[0], [0]]), np.array([0]))
  
      with self.assertRaises(ValueError):
          # 2-D target vector (must be 1-D)
          pnnet = algorithms.PNN(std=0.1, verbose=False)
          pnnet.train(np.array([[0]]), np.array([[0, 0]]))
  
      with self.assertRaises(ValueError):
          # invalid feature size for prediction data
          pnnet = algorithms.PNN(std=0.1, verbose=False)
          pnnet.train(np.array([[0], [0]]), np.array([0]))
          pnnet.predict(np.array([[0]]))
  
      msg = "hasn't been trained"
      with self.assertRaisesRegexp(NotTrained, msg):
          # predict without training
          pnnet = algorithms.PNN(std=0.1, verbose=False)
          pnnet.predict(np.array([[0]]))
  
      with self.assertRaises(ValueError):
          # different number of features for
          # train and test data
          grnet = algorithms.PNN(std=0.1, verbose=False)
          grnet.train(np.array([[0]]), np.array([0]))
          grnet.predict(np.array([[0, 0]]))
  
file_path: neupy/tests/algorithms/rbfn/test_pnn.py
imports: from __future__ import division
  import numpy
  from sklearn import datasets
  from sklearn import metrics
  from sklearn.model_selection import StratifiedKFold, train_test_split
  from neupy import algorithms
  from neupy.exceptions import NotTrained
  from base import BaseTestCase
label_desc: Use image node_id 1 for calling the PNNTestCase obj's underlying member method code with example usage: obj.test_handle_errors() without return types