https://github.com/casact/tryangle
Tryangle is an automatic chainladder reserving framework. It provides scoring and optimisation methods based on machine learning techniques to automatically select optimal parameters to minimise reserve prediction error.
https://github.com/casact/tryangle
Last synced: 3 months ago
JSON representation
Tryangle is an automatic chainladder reserving framework. It provides scoring and optimisation methods based on machine learning techniques to automatically select optimal parameters to minimise reserve prediction error.
- Host: GitHub
- URL: https://github.com/casact/tryangle
- Owner: casact
- License: mpl-2.0
- Created: 2021-05-05T10:39:45.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-06-11T18:04:18.000Z (over 1 year ago)
- Last Synced: 2024-05-17T02:58:59.610Z (9 months ago)
- Language: Python
- Homepage:
- Size: 89.8 KB
- Stars: 17
- Watchers: 4
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - casact/tryangle - Tryangle is an automatic chainladder reserving framework. It provides scoring and optimisation methods based on machine learning techniques to automatically select optimal parameters to minimise reser (Python)
README
# Tryangle: Machine Learning Techniques for Chainladder Methods
*Tryangle* is an automatic chainladder reserving framework. It provides
scoring and optimisation methods based on machine learning techniques to
automatically select optimal parameters to minimise reserve prediction
error. Tryangle is built on top of the
[chainladder](https://chainladder-python.readthedocs.io/en/latest/index.html)
reserving package.## Key Features
Tryangle is flexible and modular in how it can be applied:
- Optimising loss development factors
- Use [sklearn's](https://scikit-learn.org/) GridSearchCV or RandomizedSearchCV to find the optimal
method to calculate loss development factors
- Choosing between multiple reserving methods
- Not sure if you should go with a basic chainladder,
Bornhuetter-Ferguson, or Cape-Cod method? Let Tryangle decide.
- Finding the optimal blend of reserving methods
- Or why not combine all three, and let Tryangle find the optimal
blend.
- Using advanced optimisation methods
- Not satisfied with an exhaustive grid search? Tryangle can be
used with any optimisation framework, but we recommend
[Optuna](https://optuna.org/)## Basic Example
``` python
from sklearn.model_selection import GridSearchCV
from sklearn.pipeline import Pipeline
from tryangle import Development, CapeCod
from tryangle.metrics import neg_cdr_scorer
from tryangle.model_selection import TriangleSplit
from tryangle.utils.datasets import load_sampleX = load_sample("swiss")
tscv = TriangleSplit(n_splits=5)param_grid = {
"dev__n_periods": range(15, 20),
"dev__drop_high": [True, False],
"dev__drop_low": [True, False],
"cc__decay": [0.25, 0.5, 0.75, 0.95],
}pipe = Pipeline([("dev", Development()), ("cc", CapeCod())])
model = GridSearchCV(
pipe, param_grid=param_grid, scoring=neg_cdr_scorer, cv=tscv, verbose=1, n_jobs=-1
)
model.fit(X, X)
```## Installation
Tryangle is available at [the Python Package
Index](https://pypi.org/project/tryangle/).``` console
pip install tryangle
```Tryangle supports Python 3.9.
## Reference
Caesar Balona, Ronald Richman. 2021. The Actuary and IBNR Techniques: A
Machine Learning Approach
([SSRN](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3697256)).