Helper function that generates a single 1D numpy.ndarray with labels which
  are good targets for stock logistic regression.


  Parameters:

    X (numpy.ndarray): The input data matrix. This must be a numpy.ndarray
      with 3 dimensions or an iterable containing 2 numpy.ndarrays with 2
      dimensions each. Each correspond to the data for one of the two classes,
      every row corresponds to one example of the data set, every column, one
      different feature.


  Returns:

    numpy.ndarray: With a single dimension, containing suitable labels for all
      rows and for all classes defined in X (depth).

def make_labels(X):
  """Helper function that generates a single 1D numpy.ndarray with labels which
  are good targets for stock logistic regression.


  Parameters:

    X (numpy.ndarray): The input data matrix. This must be a numpy.ndarray
      with 3 dimensions or an iterable containing 2 numpy.ndarrays with 2
      dimensions each. Each correspond to the data for one of the two classes,
      every row corresponds to one example of the data set, every column, one
      different feature.


  Returns:

    numpy.ndarray: With a single dimension, containing suitable labels for all
      rows and for all classes defined in X (depth).

  """

  return numpy.hstack([k*numpy.ones(len(X[k]), dtype=int) for k in range(len(X))])