Skip to main content

RISC, an open-source Python package data generator. RISC generates look-alike automobile insurance contracts based on the Quebec regulatory insurance form in French and English.

Project description

PyPI - Python Version PyPI Status PyPI Status Downloads

Formatting Linting Tests

codecov Codacy Badge Code style: black

pr welcome License: LGPL v3

Here is RISC.

RISC is an open-source Python package data generator. It generates look-alike automobile insurance contracts based on the Quebec regulatory insurance form in French and English.

Use RISC to generate look-a-like Quebec Car insurance forms (FPQ1) both in French and English. RISC simulation is deterministic; thus, it can generate an aligned insurance contract (i.e. same driver data) using an initial seed. RISC uses a pretrained TVAE model on a private dataset to generate look-a-like car protections. See our article here for more detail about RISC implementation and generated the RSICBAC dataset specification.

RISC was written in Python 3.9 and is compatible with the latest version of PyTorch and Python >= 3.8 (SciPy seems difficult to build on Python 3.11. Thus, we don't support Python 3.11 for now).

Getting Started:

from risc_generator import TVAEFPQ1ContractFaker

seed = 42
n = 10

# Let's sample 10 insurance English insurance contracts (default configuration).
en_fpq1_synthetic_dataset = TVAEFPQ1ContractFaker(seed=seed).sample_contracts(number_sample=n)

# Now, let's do it for French contracts.
fr_fpq1_synthetic_dataset = TVAEFPQ1ContractFaker(language="fr", seed=seed).sample_contracts(number_sample=n)

# Since we have used the same seed, both datasets share the same insuree information.

# Use our own TVAE model:
fpq1_synthetic_dataset = TVAEFPQ1ContractFaker(tvae_synthetic_data_faker_model_path="a_path_to_a_tvae_.pkl",
                                               language="fr", seed=seed).sample_contracts(number_sample=n)

# You can also create a new FPQ1ContractFaker using another type of model using our interface.

from risc_generator import FPQ1ContractFaker, ProtectionsFaker


class RuleBaseFPQ1ContractFaker(FPQ1ContractFaker):
    def __init__(self, language: str = "en", seed: int = 42):
        protection_faker = ProtectionsFaker(
            model=ARuleBaseProtectionFaker()
        )
        super().__init__(protection_faker, language, seed=seed)

Installation

Before installing RISC, you must have your environment's latest version of PyTorch.

  • Install the stable version of RISC:
pip install risc_generator
  • Install the latest development version of RISC:
pip install -U git+https://github.com/GRAAL-Research/risc.git@dev

Cite

Use the following for the article or dataset;


@article{Beauchemin2023RISC,
	author = {Beauchemin, David and Khoury, Richard},
	journal = {Proceedings of the Canadian Conference on Artificial Intelligence},
	year = {2023},
	month = {jun 5},
	note = {https://caiac.pubpub.org/pub/k18zu6c9},
	publisher = {Canadian Artificial Intelligence Association (CAIAC)},
	title = {RISC: Generating {Realistic} {Synthetic} {Bilingual} {Insurance} {Contract}},
}

and this one for the package;

@misc{risc,
    author = {David Beauchemin},
    title  = {{RISC: an open-source Python package data generator to generate look-alike automobile insurance contracts based on the Quebec regulatory insurance form in French and English}},
    year   = {2023},
    note   = {\url{https://github.com/GRAAL-Research/risc}}
}

Contributing to RISC

We welcome user input, whether it regards bugs found in the library or feature propositions! Make sure to have a look at our contributing guidelines for more details on this matter.

License

RISC is LGPLv3 licensed, as found in the LICENSE file.


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

risc_generator-0.0.3.tar.gz (709.7 kB view details)

Uploaded Source

Built Distribution

risc_generator-0.0.3-py3-none-any.whl (1.2 MB view details)

Uploaded Python 3

File details

Details for the file risc_generator-0.0.3.tar.gz.

File metadata

  • Download URL: risc_generator-0.0.3.tar.gz
  • Upload date:
  • Size: 709.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for risc_generator-0.0.3.tar.gz
Algorithm Hash digest
SHA256 5f1c1bf18f357095c98a31f6af03f35b40f07e6f675238fc6befea27b437a807
MD5 461c0ee70d823e2b1e9fd771bdde84ce
BLAKE2b-256 7f7e23803765ae9d00563e64050d30e2a1e93bfa3a54601431c694f5c644f738

See more details on using hashes here.

File details

Details for the file risc_generator-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for risc_generator-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6944e8cd009f4ff646ef7e198c36ff325b1b6092a5f4ee746764605b3ea6a6fb
MD5 8fb4db16d94b1c49c9b48329941640c1
BLAKE2b-256 2d92b0991b12a6fc69e30cffb44ab18ca91a5687382e2689cc4880c6da6ba03b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page