def generateGridData(x, y, return_ticks=False):
 x = np.arange(x[0], x[1], x[2])
 y = np.arange(y[0], y[1], y[2])
 (X, Y) = np.meshgrid(x, y)
 shape = X.shape
 ds = ClassificationDataSet(2, 1)
 ds.setField('input', np.concatenate((X.reshape(X.size, 1), Y.reshape(X.size, 1)), 1))
 ds.setField('target', np.zeros([X.size, 1]))
 ds._convertToOneOfMany()
 if return_ticks:
  return (ds, x, y)
 else:
  return (ds, X, Y)

def generateGridData ( x , y , return_ticks = False ) : x = np . arange ( x [ 0 ] , x [ 1 ] , x [ 2 ] ) y = np . arange ( y [ 0 ] , y [ 1 ] , y [ 2 ] ) ( X , Y ) = np . meshgrid ( x , y ) shape = X . shape ds = ClassificationDataSet ( 2 , 1 ) ds . setField ( 'input' , np . concatenate ( ( X . reshape ( X . size , 1 ) , Y . reshape ( X . size , 1 ) ) , 1 ) ) ds . setField ( 'target' , np . zeros ( [ X . size , 1 ] ) ) ds . _convertToOneOfMany ( ) if return_ticks : return ( ds , x , y ) else : return ( ds , X , Y )
generates a dataset containing a regular grid of points .