Example submission data
Example submission data
Copy this Python and pandas setup to create the example submissions.
Rater.load("effective://example-ca-ppa") loads the rater of the running example program, with
its tables and its rules. Q-1 buys liability only, and Q-2 adds comprehensive and collision. The
program refuses rideshare use, so Q-3 stays unrated.
Other loading and download options
Other loading and download options
Load a rater
- To load the rater of a library program, pass its reference, such as
"effective://example-ca-ppa". - To load a local bundle, pass its path to
Rater.load, such as"raters/my-rater.zip". - To load a catalog rater, pass its ID, such as
"my-rater", withEFFECTIVE_API_KEYset.
bundle_id.
Bundles and exact rating describes the checks.Pin a revision
To load a numbered release, passrevision= a whole number. To rerun a rating exactly, pass
revision= the bundle_id.bundle_id loads offline with local_files_only=True.Download a rater to a folder
To keep a rater next to your work, callRater.download
with a path. Then load it from that path.- A path that ends in
.zipgets the bundle archive. Any other path gets a folder with the rater’s RSL source, its tables and, for a program, itsprogram/folder. - The bundle is verified first. Then it goes to a new path or an empty folder, and the call
raises
FileExistsErrorfor any other path. revision=pins the download, as it does forRater.load.
List the fields a rater accepts
rater.inputs lists each field a submission can give, one row per field. rater.outputs lists
the outcomes that rate returns. Both use the type names of a book’s Schema.
path names the field as explain does, with [] for each list. values gives the allowed
values or range, and the default when the rater has one. input_schema is the same contract as
JSON Schema.
Rate one submission or a list
- To rate one submission, pass a dict.
- To rate several submissions, pass a list. Each row ID is the list position.
Policy. Five years with the carrier earn
its loyalty discount.
Rate a table of submissions
To keep your own IDs on the results, rate a DataFrame and name its ID column askey, as the first example does.
- The
keycolumn stays on every result row. The rater receives the other columns. - A
NaN,NoneorNaTcell leaves its field out of the rater’s input. - A date becomes ISO 8601 text.
Read the results in pandas
Callto_pandas() for one row per submission, with exact Decimal outcomes.
refused with the rule’s code and message. Its premium is NaN, so the mean
skips it. drivers and vehicles hold each item’s nested outcomes, such as each vehicle’s
coverage premiums. Results lists every column and status.
Report the two successes and one refusal with that mean. The mean describes the rated submissions only.
Read individual result values
Read individual result values
Read exact values
To read one submission’s row, index the results by its ID.results.rows holds every row, in input order. Each row’s outputs holds the rater’s nested outcomes as exact values. To list the
calculations behind one premium, see Rate a book with a program.