Skip to main content

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 reserving package.

Key Features

Tryangle is flexible and modular in how it can be applied:

  • Optimising loss development factors
    • Use sklearn's 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

Basic Example

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_sample

X = 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.

pip install tryangle

Tryangle supports Python 3.9.

Reference

Caesar Balona, Ronald Richman. 2021. The Actuary and IBNR Techniques: A Machine Learning Approach (SSRN).

Metadata

Release files for tryangle 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tryangle 0.2.2
File Size Uploaded Provenance Actions
tryangle-0.2.2.tar.gz 36.0 kB Without provenance Details for tryangle-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tryangle 0.2.2
File Interpreter ABI Platform Actions
tryangle-0.2.2-py3-none-any.whl Python 3 none any Details for tryangle-0.2.2-py3-none-any.whl

Total release size: 72.7 kB

Release files / tryangle-0.2.2.tar.gz

Download URL tryangle-0.2.2.tar.gz
Size 36.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1af1bc0f2d0892d917584503475816d47f853d0e6bfcdb646f98efca6d0fc360
BLAKE2b-256 checksum
How to use checksums
cadddb76cedf62b9fca15a1c63b0559fb6af443621f24739aa41b4b03ef7fb81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Release files / tryangle-0.2.2-py3-none-any.whl

Download URL tryangle-0.2.2-py3-none-any.whl
Size 36.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
61bfc6096407affc0d156cb8928d837d72e0479c7c8ec6a715fd66953a83acc4
BLAKE2b-256 checksum
How to use checksums
506a3e9b3a6f5e47c10a31a42b65a4a324c95ba265e93a6b5a03b8cd81566109
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Security for tryangle 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page