• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

yzhao062 / pyod / 25717592359 / 8
94%
master: 94%

Build:
Build:
LAST BUILD BRANCH: fix/update-to-pythresh-v1
DEFAULT BRANCH: master
Ran 12 May 2026 06:59AM UTC
Files 184
Run time 5s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

12 May 2026 06:29AM UTC coverage: 92.938% (+0.03%) from 92.908%
25717592359.8

push

github

web-flow
fix(lunar): stop sharing scaler state across instances (closes #502) (#674)

`LUNAR.__init__` had `scaler=MinMaxScaler()` as a default argument,
which Python evaluates once at module import time. Two `LUNAR()`
instances therefore shared the same scaler object; the second `.fit`
re-fit it under a different feature dimensionality and silently
invalidated the first instance's `predict` (issue #502 reproducer
crashes with a shape error on the third `predict` call).

The fix:
- Default `scaler` to `None` and store the constructor arg verbatim
  on `self.scaler` (sklearn.base.clone requires that __init__ does not
  mutate its inputs — verified by the existing `test_model_clone`).
- Resolve a per-fit scaler in a new `_resolve_scaler` helper called
  from `fit`. The fitted scaler lives on `self.scaler_` (sklearn
  fitted-attribute convention); a fresh `MinMaxScaler()` is created
  when `scaler is None`, scaling is disabled when `scaler is False`,
  and any other instance is deep-copied so two LUNAR instances
  configured with the same scaler object cannot trample each other.
- Update `decision_function` and the train-time score path to read
  `self.scaler_` instead of `self.scaler`.

Two regression tests (`TestLUNARScalerIsolation`) reproduce the
original failure mode on master and pass on this branch.

AI disclosure: drafted with assistance from Claude (Anthropic).

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>

17741 of 19089 relevant lines covered (92.94%)

0.93 hits per line

Source Files on job 25717592359.8
  • Tree
  • List 184
  • Changed 8
  • Source Changed 0
  • Coverage Changed 8
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 25717592359
  • 7b0b7b51 on github
  • Prev Job for on development (#25715013724.1)
  • Next Job for on development (#25756069694.6)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc