Skip to content

ML00 ex01 (correction): Wrong examples #233

Open
@mli42

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

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