Skip to content

ML00 ex01 (correction): Wrong examples #233

Open

Description

@mli42
  • 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

Activity

  1. mli42 commented on Aug 17, 2022

    @mli42
    Author

    Ping @madvid

  2. linked a pull request that will close this issue233 ml00 ex01 correction wrong examples #234on Aug 21, 2022
  3. madvid commented on Aug 21, 2022

    @madvid
    Collaborator

    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

  4. madvid commented on Aug 21, 2022

    @madvid
    Collaborator

    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

  5. mli42 commented on Aug 21, 2022

    @mli42
    Author

    Super ! Merci bcp @madvid 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions