parameters: (input)
return_statement: return list(map(lambda x: int(x), pr))
docstring: Reshape numpy array and predict new data.
docstring_summary: Reshape numpy array and predict new data.
docstring_tokens: Reshape numpy array and predict new data .
function: def predict(input):
      """Reshape numpy array and predict new data."""
      pf = process_input(input)
      # Reshape data to be [samples][pixels][width][height]
      pf = pf.reshape(pf.shape[0], 1, 28, 28).astype('float32')
      # Normalize inputs from 0-255 to 0-1
      pf = pf / 255
      pr = classifier.predict_classes(pf)
      # Cast the numpy array predicted values as a list.
      return list(map(lambda x: int(x), pr))
function_tokens: def predict ( input ) : pf = process_input ( input ) # Reshape data to be [samples][pixels][width][height] pf = pf . reshape ( pf . shape [ 0 ] , 1 , 28 , 28 ) . astype ( 'float32' ) # Normalize inputs from 0-255 to 0-1 pf = pf / 255 pr = classifier . predict_classes ( pf ) # Cast the numpy array predicted values as a list. return list ( map ( lambda x : int ( x ) , pr ) )