{"id":14065711,"url":"https://github.com/casact/tryangle","last_synced_at":"2025-10-09T12:03:43.464Z","repository":{"id":62585360,"uuid":"364542183","full_name":"casact/tryangle","owner":"casact","description":"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. ","archived":false,"fork":false,"pushed_at":"2023-06-11T18:04:18.000Z","size":92,"stargazers_count":21,"open_issues_count":1,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-06T10:38:07.695Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/casact.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-05-05T10:39:45.000Z","updated_at":"2025-04-04T21:06:10.000Z","dependencies_parsed_at":"2024-02-19T18:30:08.837Z","dependency_job_id":null,"html_url":"https://github.com/casact/tryangle","commit_stats":{"total_commits":24,"total_committers":3,"mean_commits":8.0,"dds":0.375,"last_synced_commit":"32845906b74105cf667df28392f49654509cd946"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casact%2Ftryangle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casact%2Ftryangle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casact%2Ftryangle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casact%2Ftryangle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/casact","download_url":"https://codeload.github.com/casact/tryangle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248182009,"owners_count":21060891,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-13T07:04:39.054Z","updated_at":"2025-10-09T12:03:38.426Z","avatar_url":"https://github.com/casact.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Tryangle: Machine Learning Techniques for Chainladder Methods\n\n*Tryangle* is an automatic chainladder reserving framework. It provides\nscoring and optimisation methods based on machine learning techniques to\nautomatically select optimal parameters to minimise reserve prediction\nerror. Tryangle is built on top of the\n[chainladder](https://chainladder-python.readthedocs.io/en/latest/index.html)\nreserving package.\n\n## Key Features\n\nTryangle is flexible and modular in how it can be applied:\n\n-   Optimising loss development factors\n    -   Use [sklearn's](https://scikit-learn.org/) \u003cspan\n        class=\"title-ref\"\u003eGridSearchCV\u003c/span\u003e or \u003cspan\n        class=\"title-ref\"\u003eRandomizedSearchCV\u003c/span\u003e to find the optimal\n        method to calculate loss development factors\n-   Choosing between multiple reserving methods\n    -   Not sure if you should go with a basic chainladder,\n        Bornhuetter-Ferguson, or Cape-Cod method? Let Tryangle decide.\n-   Finding the optimal blend of reserving methods\n    -   Or why not combine all three, and let Tryangle find the optimal\n        blend.\n-   Using advanced optimisation methods\n    -   Not satisfied with an exhaustive grid search? Tryangle can be\n        used with any optimisation framework, but we recommend\n        [Optuna](https://optuna.org/)\n\n## Basic Example\n\n``` python\nfrom sklearn.model_selection import GridSearchCV\nfrom sklearn.pipeline import Pipeline\nfrom tryangle import Development, CapeCod\nfrom tryangle.metrics import neg_cdr_scorer\nfrom tryangle.model_selection import TriangleSplit\nfrom tryangle.utils.datasets import load_sample\n\nX = load_sample(\"swiss\")\ntscv = TriangleSplit(n_splits=5)\n\nparam_grid = {\n    \"dev__n_periods\": range(15, 20),\n    \"dev__drop_high\": [True, False],\n    \"dev__drop_low\": [True, False],\n    \"cc__decay\": [0.25, 0.5, 0.75, 0.95],\n}\n\npipe = Pipeline([(\"dev\", Development()), (\"cc\", CapeCod())])\n\nmodel = GridSearchCV(\n    pipe, param_grid=param_grid, scoring=neg_cdr_scorer, cv=tscv, verbose=1, n_jobs=-1\n)\nmodel.fit(X, X)\n```\n\n## Installation\n\nTryangle is available at [the Python Package\nIndex](https://pypi.org/project/tryangle/).\n\n``` console\npip install tryangle\n```\n\nTryangle supports Python 3.9.\n\n## Reference\n\nCaesar Balona, Ronald Richman. 2021. The Actuary and IBNR Techniques: A\nMachine Learning Approach\n([SSRN](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3697256)).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasact%2Ftryangle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcasact%2Ftryangle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasact%2Ftryangle/lists"}