def compute_stoch_gradient(y, tx, w):
    """
    Compute a stochastic gradient from just few examples n and their corresponding y_n labels.
    inputs: 
    	y = labels
    	tx = feature matrix
        w: weight
    
    output:
    	gradient : Gradient for loss function of Mean Squared Error evaluated in w
    """
    N = len(y)
    e = y - tx.dot(w)
    gradient = -tx.T.dot(e) / N
    return gradient