bootcamp_machine-learning icon indicating copy to clipboard operation
bootcamp_machine-learning copied to clipboard

ML00 ex01 (correction): Wrong examples

Open mli42 opened this issue 2 years ago • 4 comments

  • Day: 05
  • Exercise: 01 (TinyStatistician)

The correction page gives this test:

import TinyStatistician as ts
data = [42, 7, 69, 18, 352, 3, 650, 754, 438, 2659]
epsilon = 1e-5
err = "Error, grade 0 :("
tstat = ts.TinyStatistician()
assert abs(tstat.mean(data) - 499.2) < epsilon, err
assert abs(tstat.median(data) - 210.5) < epsilon, err
quartile = tstat.quartile(data)
assert abs(quartile[0] - 18) < epsilon, err
assert abs(quartile[1] - 650) < epsilon, err
assert abs(tstat.percentile(data, 10) - 3) < epsilon, err
assert abs(tstat.percentile(data, 28) - 18) < epsilon, err
assert abs(tstat.percentile(data, 83) - 754) < epsilon, err
assert abs(tstat.var(data) - 654661) < epsilon, err
assert abs(tstat.std(data) - 809.11) < epsilon, err

But my code (which is right with the subject's examples) has different result for quartile/percentile/var/std.
(Apparently an issue for var and std already exist)

Definition of done

  • [ ] correction of the formula of sample variance and standard deviation.
  • [ ] fix of the examples according to update of the formula in the subject and scale
  • [ ] investigate issue with quartile and percentile methods
  • [ ] fix examples in the subject and in the scale

Fixed on:

  • [ ] Github
  • [ ] Gitlab

mli42 avatar Aug 17 '22 19:08 mli42

Ping @madvid

mli42 avatar Aug 17 '22 19:08 mli42

fix en cours (PR sont open), les valeurs sont corrigés sur la scale de correction et les formules de la variance et de la deviation standard dans le cadre d'un échantillon sont corrigées aussi.

Je me mets sur le pb de quartile et percentile

madvid avatar Aug 21 '22 15:08 madvid

Du coup @mli42, j'ai update la partie sur les percentiles (sujet + exemples et correction). Pour plus qu'il y ait de débat, on demande comme le comportement par défaut numpy (interpolation entre les 2 quantiles les plus proches, les valeurs au sein de la liste). Parce qu'il y a plusieurs définition et que l'erreur venait justement de définitions différentes

madvid avatar Aug 21 '22 17:08 madvid

Super ! Merci bcp @madvid 👌

mli42 avatar Aug 21 '22 18:08 mli42