Coder Social home page Coder Social logo

tryangle's Introduction

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.8 and 3.9.

Reference

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

tryangle's People

Stargazers

 avatar

Forkers

arneschoch811

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.