As part of my ML uni course I am learning linear regression. Strangely, I came across the following problem and I am not sure how to go about it.
given are two vectors x and y :
x = np.linspace(x_min, x_max,50)
y = np.random.randint(-5/2,5/2, size=50)
y = y + 3 + 2*x 
I need to fill in the code in these two methods:
def linear_hypothesis(theta_0, theta_1):
    ''' Combines given arguments in a linear equation and returns it as a function
    Args:
        theta_0: first coefficient
        theta_1: second coefficient
    Returns:
        lambda that models a linear function based on theta_0, theta_1 and x
    ''' 
def mse_cost_function(x, y):
    ''' Implements MSE cost function as a function J(theta_0, theta_1) on given tranings data 
    Args:
        x: vector of x values 
        y: vector of ground truth values y 
    Returns:
        lambda J(theta_0, theta_1) that models the cost function
    '''
The above functions should then be called through the following code:
j = mse_cost_function(x, y)
print(j(2.1, 2.9))
And this is what confuses me. I am not sure which the return type of each function should and I dont understand what this line j(2.1, 2.9) is supposed to be doing since j is the return value of this method. could someone enlighten me? Thanks for any help !
 
    