INNE skips `BaseDetector.__init__`, so an out-of-range `contamination` is accepted silently
Author: owgreen-devCreated Sep 18, 2026Updated Sep 18, 2026
INNE.__init__ (pyod/models/inne.py:84-90) assigns self.contamination = contamination directly and never calls super().__init__, so the range check in BaseDetector.__init__ (base.py:62-66) is bypassed.
Evidence (v3.6.6):
>>> KNN(contamination=0.9)
ValueError: contamination must be in (0, 0.5], got: 0.900000
>>> INNE(contamination=0.9)
INNE(contamination=0.9, ...) # acceptedEvery other tabular detector rejects this at construction. INNE(contamination=0.9).fit(X) then labels 90% of the training set as outliers.
Proposed fix: super().__init__(contamination=contamination) and drop the direct assignment. One line plus a test. Happy to PR.
Found with a script that checks every detector for the sklearn parameter contract (get_params/clone/refit); drafted with Claude Code assistance and verified by hand.
Source: yzhao062/pyod