def get_data_stats(X_data, y_data, dimensions=None):
    """Get the min and max value of X_data matrix and of y_data vector."""
    dimensions = dimensions if dimensions is not None else range(len(y_data))
    x_max = max([max([x_row[d] for d in dimensions]) for x_row in X_data])
    x_min = min([min([x_row[d] for d in dimensions]) for x_row in X_data])
    return x_max, x_min, max(y_data), min(y_data)