in gradient_descent(X, y, w_in, b_in, cost_function, gradient_function, alpha, num_iters, lambda_)
46 if i% math.ceil(num_iters/10) == 0 or i == (num_iters-1):
47 w_history.append(w_in)
—> 48 print(f"Iteration {i:4}: Cost {float(J_history[-1]):8.2f} ")
49
50 return w_in, b_in, J_history, w_history #return w and J,w history for graphing
TypeError: only size-1 arrays can be converted to Python scalars
this code cell is already filled and is uneditable. Please help.
Also, posting a link to your notebook is 1) not useful, because we cannot log into your account, so the file is not available, and 2) sharing your code would violate the Code of Conduct.
I have been stuck for three days now on 2.6 in Week three. I keep get the error in Graded Function Compute cost:
File “”, line 8
Args:
^
SyntaxError: invalid character in identifier
I have tried deleting white spaces, re-writing lines from the beginning, etc. Am I’m using the wrong browser? Wrong settings in my Jupyter notebook?
The notebook had several issues such as modifications outside of the marked areas, some functions had been duplicated, cells were added that modified the provided data set, and some errors in the code caused incorrect calculations.
Hello,
I’m having a problem: every time I try to submit the logistic regression lab week three, I keep getting 0% and an error. This is the error message I receive:
Cell #3. Can’t compile the student’s code. Error: OSError(‘data/ex2data1.txt not found.’)
I’ve been trying for a long time but it’s not working. I’ve completed the whole course — this is the last task, but I can’t submit it.
@Lojana
The most likely cause for this issue is that something in your notebook has been modified (i.e. a cell was edited, added, moved, or deleted), such that the grader is looking for a file that it cannot find.
This type of issue can be very difficult to repair.
I recommend you get a new copy of the notebook and start over.
Use the File menu and rename your notebook.
Use the Lab Help tool and then “Get latest version”.
Use the File → Open menu, and open the new copy of the notebook.
Use “Kernel → Restart & clear all output”, so that you have an empty workspace.
The “Lab Help” tool is the question-mark inside a circle, in the upper right corner of your browser.
Be very careful to only modify the notebook in the areas marked “START CODE HERE”.