-
-
Notifications
You must be signed in to change notification settings - Fork 550
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
If a model normalizes data during fitting, it should also normalize data passed to the predict methods later in the same way. As a logical consequence, CoxPH now stores the original data instead of the normalized version as well as the normalization variables. I also added some checks to make sure that incoming dataframes have the same input columns present as the fitting data. In case the incoming data is an ndarray, the order is assumed to be correct (as before). The following examples now work, where they before would crash or simply return the wrong result: # fulldata has columns x1, x2, t, e cf.predict(fulldata) # shuffleddata has columns x2, t, x1, e, y1, y2, y3 cf.predict(shuffleddata) # Xrev has columns x2, x1 cf.predict(Xrev) Signed-off-by: Jonas Kalderstam <jonas@kalderstam.se>
- Loading branch information
1 parent
a9b807d
commit 19fb043
Showing
3 changed files
with
95 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nice catch!