Rate the book
Load the example program and rate its synthetic book:rate returns one row per submission, in book order. For this example, premium is the annual policy premium, stored as an exact Decimal.
Rating runs on your machine. Your book and results stay local.
Check rating results
Count submissions by status and reason:NaN as their premium. Retain them in your analysis alongside the rated submissions.
Rating statuses
Rating statuses
rate checks the preparation function’s columns against the rater’s inputs (program.rater.inputs). Each column must name an input, and each required input must have a column. Each column’s type must also fit its input. A mismatch, such as text for an int, raises TypeError, which lists each column to fix in the preparation function. A bad value, such as a blank or an out-of-range number, fails only its own submission, as invalid_inputs.
The Results reference describes the result columns and statuses.
Find missing inputs for a quote
To find which unanswered inputs still affect a price or carrier decision, passallow_missing=True:
mapping_failed rows with reason_code == "NEEDS_INPUT", read needs for the book columns the mapper requests.
For invalid_inputs, read reason to correct a supplied value. Update the source facts and rate the book again.
Explain a premium
Inspect the calculations behind one submission’s premium:Analyze the results
Summarize by your own segments
Summarize by your own segments
Join the results to the book by
submission_id, then summarize in pandas:count counts premiums with a value. mean excludes NaN, so each mean describes the rated policies in that region.Rate by vehicle
Rate by vehicle
Pass
by="vehicles" to return vehicle rows with their coverage premiums: