You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`rtichoke` is a Python library for visualizing the performance of predictive models. It provides a flexible and intuitive way to create a variety of common evaluation plots, including:
4
+
5
+
***ROC Curves**
6
+
***Precision-Recall Curves**
7
+
***Gains and Lift Charts**
8
+
***Decision Curves**
9
+
10
+
The library is designed to be easy to use, while still offering a high degree of control over the final plots.
11
+
12
+
## Key Features
13
+
14
+
***Simple API**: Create complex visualizations with just a few lines of code.
15
+
***Time-to-Event Analysis**: Native support for models with time-dependent outcomes, including censoring and competing risks.
16
+
***Interactive Plots**: Built on Plotly for interactive, publication-quality figures.
17
+
***Flexible Data Handling**: Works seamlessly with NumPy and Polars.
18
+
19
+
## Documentation
20
+
21
+
For a complete guide to the library, including a "Getting Started" tutorial and a full API reference, please see the **[official documentation](https://your-documentation-url.com)**.
22
+
23
+
*(Note: The documentation URL will need to be updated once the website is deployed.)*
Welcome to the official documentation for `rtichoke`, a Python library for visualizing the performance of predictive models.
6
+
7
+
## Getting Started
8
+
9
+
If you're new to `rtichoke`, the best place to start is the **[Getting Started Tutorial](./tutorials/getting_started.qmd)**. It will walk you through the basics of installing the library, preparing your data, and creating your first plot.
10
+
11
+
## API Reference
12
+
13
+
For detailed information on the functions and classes provided by `rtichoke`, please refer to the **[API Reference](./reference/index.qmd)**.
This tutorial provides a basic introduction to the `rtichoke` library. We'll walk through the process of preparing data, creating a decision curve, and visualizing the results.
6
+
7
+
## 1. Import Libraries
8
+
9
+
First, let's import the necessary libraries. We'll need `numpy` for data manipulation and `rtichoke` for the core functionality.
10
+
11
+
```python
12
+
import numpy as np
13
+
import rtichoke as rk
14
+
```
15
+
16
+
## 2. Prepare Your Data
17
+
18
+
`rtichoke` expects data in a specific format. You'll need two main components:
19
+
20
+
***Probabilities (`probs`)**: A dictionary where keys are model names and values are NumPy arrays of predicted probabilities.
21
+
***Real Outcomes (`reals`)**: A NumPy array containing the true binary outcomes (0 or 1).
22
+
23
+
Let's create some sample data for two different models:
Now that we have our data, we can create a decision curve. This is a simple one-liner with `rtichoke`:
45
+
46
+
```python
47
+
fig = rk.create_decision_curve(
48
+
probs=probs_dict,
49
+
reals=reals,
50
+
)
51
+
```
52
+
53
+
## 4. Show the Plot
54
+
55
+
Finally, let's display the plot. Since `rtichoke` uses Plotly under the hood, you can show the figure just like any other Plotly object.
56
+
57
+
```python
58
+
# To display the plot in an interactive environment (like a Jupyter notebook)
59
+
fig.show()
60
+
```
61
+
62
+
And that's it! You've created your first decision curve with `rtichoke`. From here, you can explore the other curve types and options that the library has to offer.
0 commit comments