LSCP.fit writes back onto two constructor arguments: self.random_state = check_random_state(self.random_state) (pyod/models/lscp.py:157) and, when n_bins > n_clf, self.n_bins = self.n_clf (lscp.py:379-383).
>>> clf = LSCP(detector_list=[LOF(), KNN()], n_bins=10, random_state=0)
>>> clf.fit(X)
>>> {k: clf.get_params(deep=False)[k] for k in ("n_bins", "random_state")}
{'n_bins': 2, 'random_state': RandomState(MT19937) at 0x...}
After one fit, get_params() no longer describes the estimator the user built, so clone() yields a different configuration. Same defect #737 fixed in Sampling.
Fix: resolve both into locals or n_bins_ / random_state_; leave the constructor arguments untouched. Happy to open the PR.
Verified on v3.6.6; drafted with Claude Code assistance and checked by hand.
LSCP.fitwrites back onto two constructor arguments:self.random_state = check_random_state(self.random_state)(pyod/models/lscp.py:157) and, whenn_bins > n_clf,self.n_bins = self.n_clf(lscp.py:379-383).After one
fit,get_params()no longer describes the estimator the user built, soclone()yields a different configuration. Same defect #737 fixed inSampling.Fix: resolve both into locals or
n_bins_/random_state_; leave the constructor arguments untouched. Happy to open the PR.Verified on v3.6.6; drafted with Claude Code assistance and checked by hand.