Helper function to add a bias column to the input array X


  Parameters:

    X (numpy.ndarray): The input data matrix. This must be a numpy.ndarray
      with 2 dimension wheres every row corresponds to one example of the data
      set, every column, one different feature.


  Returns:

    numpy.ndarray: The same input matrix X with an added (prefix) column of
      ones.

def add_bias(X):
  """Helper function to add a bias column to the input array X


  Parameters:

    X (numpy.ndarray): The input data matrix. This must be a numpy.ndarray
      with 2 dimension wheres every row corresponds to one example of the data
      set, every column, one different feature.


  Returns:

    numpy.ndarray: The same input matrix X with an added (prefix) column of
      ones.

  """

  return numpy.hstack((numpy.ones((len(X),1), dtype=X.dtype), X))