42-AI/bootcamp_machine-learning

CORRECTION ML01 EX02 Error in basic tests

antoinedauchy opened this issue · 2 comments

  • Day: ML01
  • Exercise: EX02

The correction asks us to return a result close to [[4.03112103], [0.76446193]].
But in reality, a good program (good = that fit with the subject examples) return [[1.01682288] [0.80945473]] in this case.

Correction:
Capture d’écran 2022-03-18 à 22 17 41

With the specified learning rate, indeed you are right.
The example was obtained with alpha=5e-4.

The issue has been duplicated and fixed in the corresponding repository containing the evaluation sheets.

In reality with:

x = np.array(range(1,101)).reshape(-1,1)
y = 0.75*x + 5
theta = np.array([[1.],[1.]])
fit_(x, y, theta, 1e-5, 20000)

We get:

[[1.18949688], [0.80687732]]

You may need to check your formula of the gradient ?