Skip to content

Commit 370e431

Browse files
committed
rename package -> 'survinng'
1 parent 42ee853 commit 370e431

File tree

12 files changed

+66
-66
lines changed

12 files changed

+66
-66
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Package: Survinng
1+
Package: survinng
22
Title: Gradient-Based Feature Attribution for Survival Neural Networks
33
Version: 0.1.0
44
Authors@R: c(
@@ -42,5 +42,5 @@ Encoding: UTF-8
4242
Roxygen: list(markdown = TRUE)
4343
RoxygenNote: 7.2.3
4444
Config/Needs/website: rmarkdown
45-
URL: https://bips-hb.github.io/Survinng/
45+
URL: https://bips-hb.github.io/survinng/
4646
VignetteBuilder: knitr

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Survinng 0.1.0
1+
# survinng 0.1.0
22

33
* Initial release as part of the ICML'25 paper *Gradient-based
44
Explanations for Deep Learning Survival Models*

R/BatchLoader.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Surv_BatchLoader <- function(inputs, inputs_ref, method_pre_fun, model_pre_fun,
1818
scale_fun, batch_size, n_timepoints, n) {
1919
batch_size <- min(batch_size, dim(inputs[[1]])[1] * n_timepoints)
2020
if (batch_size < n_timepoints) {
21-
message("[Survinng] Batch size is smaller than the number of timepoints. Setting ",
21+
message("[survinng] Batch size is smaller than the number of timepoints. Setting ",
2222
"batch size (", batch_size, ") to the number of timepoints (",
2323
n_timepoints, ").")
2424
batch_size <- n_timepoints
@@ -51,7 +51,7 @@ setMethod("update", "Surv_BatchLoader", function(object) {
5151

5252
# Update the current index
5353
if (object@current_index + length(idx) > object@max_index) {
54-
warning("[Survinng] You'are trying to get more batches than available. ",
54+
warning("[survinng] You'are trying to get more batches than available. ",
5555
"Resetting the current index to 0.")
5656
object@current_index <- 0
5757
} else {

R/base_method.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ base_method <- function(exp, instance, n = 1, model_class, inputs_ref = NULL,
2828
final_batch_size <- n_timepoints * (final_batch_size %/% n_timepoints)
2929
}
3030
num_dims <- sum(sapply(inputs, function(x) final_batch_size * prod(dim(x)[-1])))
31-
if (num_dims > 20000) {
31+
if (num_dims > 2e6) {
3232
warning("The resulting tensor has ", num_dims, " entries in total per batch. ",
3333
"This may lead to runtime or memory issues. Consider using a ",
3434
"smaller batch size (currently ", batch_size, ") ",

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11

2-
# `Survinng`: Gradient-based Explanations for Deep Learning Survival Models
2+
# `survinng`: Gradient-based Explanations for Deep Learning Survival Models
33

44
<!-- badges: start -->
5-
<a href="https://bips-hb.github.io/Survinng/"><img src="man/figures/logo.jpeg" align="right" height="120" alt="Survinng website" /></a>
5+
<a href="https://bips-hb.github.io/survinng/"><img src="man/figures/logo.jpeg" align="right" height="120" alt="survinng website" /></a>
66
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
77
[![arXiv](https://img.shields.io/badge/arXiv-2502.04970-b31b1b.svg)](https://arxiv.org/abs/2502.04970)
8-
[![Website](https://img.shields.io/badge/docs-📘%20Survinng%20Site-blue)](https://bips-hb.github.io/Survinng/)
8+
[![Website](https://img.shields.io/badge/docs-📘%20survinng%20Site-blue)](https://bips-hb.github.io/survinng/)
99
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
10-
[![R-CMD-check](https://github.com/bips-hb/Survinng/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/bips-hb/Survinng/actions/workflows/R-CMD-check.yaml)
10+
[![R-CMD-check](https://github.com/bips-hb/survinng/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/bips-hb/survinng/actions/workflows/R-CMD-check.yaml)
1111
<!-- badges: end -->
1212

1313

14-
The package `Survinng` provides gradient-based feature attribution methods
14+
The package `survinng` provides gradient-based feature attribution methods
1515
for deep learning survival models. It implements novel adaptions of model-specific
1616
XAI methods for the survival analysis domain, like **Grad(t)**, **SG(t)**, **GxI(t)**,
1717
**IntGrad(t)**, and **GradSHAP(t)**. The whole package is designed to be compatible with the
@@ -21,9 +21,9 @@ However, it can also be used with models from `pycox` directly and other
2121
survival models loaded in `torch`. Currently, the package supports the models
2222
types `DeepSurv`/`CoxPH`, `DeepHit`, and `CoxTime`.
2323

24-
### 🚀 Why `Survinng`?
24+
### 🚀 Why `survinng`?
2525

26-
With `Survinng`, you get:
26+
With `survinng`, you get:
2727

2828
***Model-specific** and **time-resolved** feature attributions for individuals
2929
* ⚡️ **Fast and scalable** explanations using model gradients, especially for SHAP-like explanations
@@ -45,25 +45,25 @@ To install the latest development version directly from GitHub:
4545

4646
```r
4747
# install.packages("devtools")
48-
devtools::install_github("bips-hb/Survinng")
48+
devtools::install_github("bips-hb/survinng")
4949
```
5050

5151
## 📖 Usage
5252

5353
You have a trained survival neural network model from `survivalmodels` or
5454
`pycox` and your model input data data. Now you want to interpret individual
55-
data points by using the methods from the package `Survinng`, then stick to the
55+
data points by using the methods from the package `survinng`, then stick to the
5656
following pseudo code:
5757

5858
```r
59-
library(Survinng)
59+
library(survinng)
6060

6161
# Load a survival model and corresponding data
6262
model <- ... (e.g., from survivalmodels or pycox)
6363
data <- ... (e.g., the test set of the model)
6464

6565
# Create explainer object
66-
explainer <- Survinng::explain(model, data)
66+
explainer <- survinng::explain(model, data)
6767

6868
# Compute feature attributions
6969
idx <- 1 # index of the instance to explain
@@ -77,7 +77,7 @@ shap <- surv_gradSHAP(explainer, instance = idx) # GradSHAP(t)
7777
plot(shap)
7878
```
7979
👉 For full documentation and advanced use cases, visit the
80-
[📘 package website](https://bips-hb.github.io/Survinng/).
80+
[📘 package website](https://bips-hb.github.io/survinng/).
8181

8282
## 💻 Quick Example
8383

@@ -102,7 +102,7 @@ ext <- callr::r(function(train) {
102102
early_stopping = TRUE)
103103

104104
# Extract the model
105-
Survinng::extract_model(fit)
105+
survinng::extract_model(fit)
106106
}, args = list(train = train))
107107

108108

@@ -118,10 +118,10 @@ plot(shap)
118118

119119
## 🖥 Other Examples and Articles
120120

121-
- How to load my model? [→ article](https://bips-hb.github.io/Survinng/articles/how_to_load_model.html)
122-
- Simulation: Time-independent effects (`survivalmodels`) [→ article](https://bips-hb.github.io/Survinng/articles/Sim_time_independent.html)
123-
- Simulation: Time-dependent effects (`survivalmodels`) [→ article](https://bips-hb.github.io/Survinng/articles/Sim_time_dependent.html)
124-
- Example on real multi-modal medical data [→ article](https://bips-hb.github.io/Survinng/articles/multimodal.html)
121+
- How to load my model? [→ article](https://bips-hb.github.io/survinng/articles/how_to_load_model.html)
122+
- Simulation: Time-independent effects (`survivalmodels`) [→ article](https://bips-hb.github.io/survinng/articles/Sim_time_independent.html)
123+
- Simulation: Time-dependent effects (`survivalmodels`) [→ article](https://bips-hb.github.io/survinng/articles/Sim_time_dependent.html)
124+
- Example on real multi-modal medical data [→ article](https://bips-hb.github.io/survinng/articles/multimodal.html)
125125

126126

127127
## 📚 Citation

_pkgdown.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
url: https://bips-hb.github.io/Survinng/
1+
url: https://bips-hb.github.io/survinng/
22
template:
33
bootstrap: 5
44

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
# * https://testthat.r-lib.org/articles/special-files.html
88

99
library(testthat)
10-
library(Survinng)
10+
library(survinng)
1111

1212
if (Sys.getenv("TORCH_TEST", unset = 0) == 1) {
1313
set.seed(42)
1414
torch::torch_manual_seed(42)
1515

1616
library(torch)
1717

18-
test_check("Survinng")
18+
test_check("survinng")
1919
}

vignettes/articles/Sim_time_dependent.Rmd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ knitr::opts_chunk$set(
1717
Load the necessary libraries and source the utility functions.
1818

1919
```{r setup, message=FALSE, warning=FALSE}
20-
library(Survinng)
20+
library(survinng)
2121
library(ggplot2)
2222
library(cowplot)
2323
library(dplyr)
@@ -60,7 +60,7 @@ We consider a simulated dataset with the following characteristics:
6060

6161
## Load Models and Data
6262

63-
The models used in this vignette are the same as those used in the main paper. The models were trained using the `survivalmodels` package, and the training process is not shown here, but can be found in the `vignettes/articles/Sim_time_dependent` directory or on [GitHub](https://github.com/bips-hb/Survinng/tree/master/vignettes/articles/Sim_time_dependent).
63+
The models used in this vignette are the same as those used in the main paper. The models were trained using the `survivalmodels` package, and the training process is not shown here, but can be found in the `vignettes/articles/Sim_time_dependent` directory or on [GitHub](https://github.com/bips-hb/survinng/tree/master/vignettes/articles/Sim_time_dependent).
6464

6565
```{r td fit models, fig.width=10, fig.height=15}
6666
# Load data
@@ -97,9 +97,9 @@ knitr::include_graphics(here('vignettes/articles/Sim_time_dependent/sim_td_brier
9797
The `explain()` function creates an explainer object for the survival models. The `data` argument specifies the dataset used for explanation, and the `model` argument specifies the model to be explained. The `target` argument indicates the type of prediction to be explained (e.g., "survival", "risk", "cumulative hazard").
9898

9999
```{r td explainer}
100-
exp_deephit <- Survinng::explain(ext_deephit[[1]], data = test)
101-
exp_coxtime <- Survinng::explain(ext_coxtime[[1]], data = test)
102-
exp_deepsurv <- Survinng::explain(ext_deepsurv[[1]], data = test)
100+
exp_deephit <- survinng::explain(ext_deephit[[1]], data = test)
101+
exp_coxtime <- survinng::explain(ext_coxtime[[1]], data = test)
102+
exp_deepsurv <- survinng::explain(ext_deepsurv[[1]], data = test)
103103
```
104104

105105

vignettes/articles/Sim_time_independent.Rmd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ knitr::opts_chunk$set(
1616
Load the necessary libraries and source the utility functions.
1717

1818
```{r setup, message=FALSE, warning=FALSE}
19-
library(Survinng)
19+
library(survinng)
2020
library(ggplot2)
2121
library(cowplot)
2222
library(dplyr)
@@ -55,7 +55,7 @@ We consider a simulated dataset with the following characteristics:
5555

5656
## Load Models and Data
5757

58-
The models used in this vignette are the same as those used in the main paper. The models were trained using the `survivalmodels` package, and the training process is not shown here, but can be found in the `vignettes/articles/Sim_time_independent` directory or on [GitHub](https://github.com/bips-hb/Survinng/tree/master/vignettes/articles/Sim_time_independent).
58+
The models used in this vignette are the same as those used in the main paper. The models were trained using the `survivalmodels` package, and the training process is not shown here, but can be found in the `vignettes/articles/Sim_time_independent` directory or on [GitHub](https://github.com/bips-hb/survinng/tree/master/vignettes/articles/Sim_time_independent).
5959

6060
```{r td fit models, fig.width=10, fig.height=15}
6161
# Load data
@@ -93,9 +93,9 @@ The `explain()` function creates an explainer object for the survival models. Th
9393

9494

9595
```{r tid explainer}
96-
exp_deephit <- Survinng::explain(ext_deephit[[1]], data = test)
97-
exp_coxtime <- Survinng::explain(ext_coxtime[[1]], data = test)
98-
exp_deepsurv <- Survinng::explain(ext_deepsurv[[1]], data = test)
96+
exp_deephit <- survinng::explain(ext_deephit[[1]], data = test)
97+
exp_coxtime <- survinng::explain(ext_coxtime[[1]], data = test)
98+
exp_deepsurv <- survinng::explain(ext_deepsurv[[1]], data = test)
9999
```
100100

101101
## Survival Prediction

0 commit comments

Comments
 (0)