REPOSITORY CODING · HARD
Treat values at the Hampel threshold as inliers, including zero deviation with zero MAD, and classify the anchor by its absolute deviation
Treat values at the Hampel threshold as inliers, including zero deviation with zero MAD, and classify the anchor by its absolute deviation. Trace the native model, algorithm services, repository snapshot and HTTP preview. Repair the incident while preserving the other contracts. All explicit fixtures and mandatory regression groups are available with bash test/run.sh.
robust-statisticsWeighted Hampel monitoring laboratory
Work through a real codebase.
Choose an environment, investigate the existing implementation and use the tests to check your change. Sign in to open a workspace; execution and Ono usage follow your plan’s allowances.
Task requirements and environments
PySpark · 85 minute session
- Trailing windows include both time endpoints and every observation tied at the anchor time, separately for each group.
- Use the lower weighted median: the smallest value whose cumulative weight reaches at least half the total.
- Compute median absolute deviations from the weighted median, never signed deviations.
- Treat values at the Hampel threshold as inliers, including zero deviation with zero MAD, and classify the anchor by its absolute deviation.
- Report the weighted mean of inliers and include observations at the inclusive horizon. Empty or future-only inputs produce no points.
- At most forty integer-valued samples, integer times through 1000 and weights one through five. Threshold equals factor times 1.4826 times MAD; comparisons use exact scaled integers. Ratios and bounds round to six decimals. Spark performs window joins, cumulative weighted rankings and grouped reductions.