For the NonLinearCoxPHModel class, when self.auto_scaler is set to False, the code raises an UnboundLocalError exception like the following:
File ".../pysurvival/models/semi_parametric.py", line 610, in fit
X_original = X_original[order, :]
UnboundLocalError: local variable 'X_original' referenced before assignment
This pull request is a simple fix that avoids the exception with an else block, assigning X_original to the non-transformed input X.
Without this bug fix, self.auto_scaler must always be True, which forces the user into applying a the default sklearn StandardScaler to the input. But this may not always be a desirable transformation, for example, with binary or categorical/ordinal features.
For the
NonLinearCoxPHModel
class, whenself.auto_scaler
is set toFalse
, the code raises anUnboundLocalError
exception like the following:This pull request is a simple fix that avoids the exception with an else block, assigning
X_original
to the non-transformed inputX
.Without this bug fix,
self.auto_scaler
must always beTrue
, which forces the user into applying a the default sklearnStandardScaler
to the input. But this may not always be a desirable transformation, for example, with binary or categorical/ordinal features.Hope this is a welcome bug fix! Thanks.