Grader output is incorrectly flagging the error for my find_closest_centroids() implementation. All my unit tests work for the same pass fine . I also implemented the second exercise in the assignment and am able to execute and get the final result of the assignment. I made 3 submissions early morning today thinking it was a glitch. All three failed. I then chatted with the online agent who suggested to clear cookies/cache. I did that and submitted a 4th time and i still get the same error during submission. See error below. It does not make sense. The error says return type should be class bool which is incorrect.
Code Cell UNQ_C1: Unexpected error (TypeError(“find_closest_centroids() got an unexpected keyword argument ‘centroids’”)) occurred during function check. We expected function find_closest_centroids to return type <class ‘bool’>. Please check that this function is defined properly.
Update: Chatted with Human agent today .I resubmitted the assignment using Safari based on agents recommendation. I was using Chrome for previous submissions. Sent screenshots of above error and also screenshot of the all unit tests for this passing. The agent reviewed the screen shots and recommended to get the help of moderators Here is the final response from the human agent - “Thank you for patiently waiting. In this case, I would highly suggest that you wait for a reply to your post in the Community so that the course staff and moderators can assist you accordingly.”
Coursera’s help center staff do not answer questions about the course materials.
All they can do is suggest you clear your cache and cookies and try a different browser - because their only responsibility is whether the course web pages load correctly.
Asking Coursera any technical questions is a waste of time.
def find_closest_centroids(X, c):
“”"
Computes the centroid memberships for every example
Args:
X (ndarray): (m, n) Input values
centroids (ndarray): (K, n) centroids
Returns:
idx (array_like): (m,) closest centroids
"""
# Set k (number of centroids)
k = c.shape[0]
# You need to return the following variables correctly
idx = np.zeros(X.shape[0], dtype=int)
### START CODE HERE ###
{moderator edit: code removed}
### END CODE HERE ###
return idx
You have modified part of the assignment, by changing the parameter names.
I recommend you not do this. Only modify the part of the template that says “START CODE HERE”.