I am asked to plot the log-likelihood for a logistic regression model as a function of theta1 and theta2 to assess if its a convex function (the model only has two parameters and thetas are the weights of each parameter). My understanding is that I need a cartesian graph with each axis denoting the values of the thetas. The negative log-likelihood is given as (in code):
sigma = sigmoid(np.dot(x, weight))
loss = -1/size * np.sum(y * np.log(sigma)) + (1 - y) * np.log(1-sigma)
How can I plot this function as a function of theta1 and theta2 in Python?