-
Notifications
You must be signed in to change notification settings - Fork 12
/
README.Rmd
84 lines (61 loc) · 3.49 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# censored <a href='https://censored.tidymodels.org'><img src='man/figures/logo.png' align="right" height="139" alt="a pixelated version of the parsnip logo with a black censoring bar" /></a>
<!-- badges: start -->
[![R-CMD-check](https://github.com/tidymodels/censored/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/tidymodels/censored/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/tidymodels/censored/branch/main/graph/badge.svg)](https://app.codecov.io/gh/tidymodels/censored?branch=main)
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html)
[![R-CMD-check-hard](https://github.com/tidymodels/censored/actions/workflows/R-CMD-check-hard.yaml/badge.svg)](https://github.com/tidymodels/censored/actions/workflows/R-CMD-check-hard.yaml)
<!-- badges: end -->
`censored` is a [parsnip](https://parsnip.tidymodels.org) extension package which provides engines for various models for censored regression and survival analysis.
## Installation
You can install the released version of censored from [CRAN](https://CRAN.R-project.org) with:
``` r
install.packages("censored")
```
And the development version from [GitHub](https://github.com/) with:
``` r
# install.packages("pak")
pak::pak("tidymodels/censored")
```
## Available models, engines, and prediction types
censored provides engines for the models in the following table. For examples, please see [Fitting and Predicting with censored](https://censored.tidymodels.org/articles/articles/examples.html).
The time to event can be predicted with `type = "time"`, the
survival probability with `type = "survival"`, the linear predictor with `type = "linear_pred"`, the quantiles of the event time distribution with `type = "quantile"`, and the hazard with `type = "hazard"`.
```{r, echo=FALSE, message=FALSE}
library(censored)
library(dplyr)
library(purrr)
library(tidyr)
yep <- cli::symbol$tick
nope <- cli::symbol$cross
mod_names <- get_from_env("models")
model_info <-
map_dfr(mod_names, ~ get_from_env(paste0(.x, "_predict")) %>% mutate(model = .x))
model_info %>%
filter(mode == "censored regression") %>%
select(model, engine, mode, type) %>%
pivot_wider(
names_from = type,
values_from = mode,
values_fill = nope,
values_fn = function(x) yep
) %>%
knitr::kable()
```
## Contributing
This project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.
- For questions and discussions about tidymodels packages, modeling, and machine learning, please [post on Posit Community](https://forum.posit.co/new-topic?category_id=15&tags=tidymodels,question).
- If you think you have encountered a bug, please [submit an issue](https://github.com/tidymodels/censored/issues).
- Either way, learn how to create and share a [reprex](https://reprex.tidyverse.org/articles/articles/learn-reprex.html) (a minimal, reproducible example), to clearly communicate about your code.
- Check out further details on [contributing guidelines for tidymodels packages](https://www.tidymodels.org/contribute/) and [how to get help](https://www.tidymodels.org/help/).