Skip to content

Commit 13c102b

Browse files
committed
Pushing the docs to dev/ for branch: main, commit e883b4b8c0b2ca858e6d7ddff52f6fa76981411f
1 parent 1c9a42e commit 13c102b

File tree

1,318 files changed

+7164
-7161
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,318 files changed

+7164
-7161
lines changed

dev/.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: b8552c1840e582d8069bb272f008b1c5
3+
config: a8992306144a58818a4d64d1a9e413cf
44
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file not shown.
Binary file not shown.

dev/_downloads/86c888008757148890daaf43d664fa71/plot_tweedie_regression_insurance_claims.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,15 +222,16 @@ def score_estimator(
222222

223223
df = load_mtpl2()
224224

225-
# Note: filter out claims with zero amount, as the severity model
226-
# requires strictly positive target values.
227-
df.loc[(df["ClaimAmount"] == 0) & (df["ClaimNb"] >= 1), "ClaimNb"] = 0
228225

229226
# Correct for unreasonable observations (that might be data error)
230227
# and a few exceptionally large claim amounts
231228
df["ClaimNb"] = df["ClaimNb"].clip(upper=4)
232229
df["Exposure"] = df["Exposure"].clip(upper=1)
233230
df["ClaimAmount"] = df["ClaimAmount"].clip(upper=200000)
231+
# If the claim amount is 0, then we do not count it as a claim. The loss function
232+
# used by the severity model needs strictly positive claim amounts. This way
233+
# frequency and severity are more consistent with each other.
234+
df.loc[(df["ClaimAmount"] == 0) & (df["ClaimNb"] >= 1), "ClaimNb"] = 0
234235

235236
log_scale_transformer = make_pipeline(
236237
FunctionTransformer(func=np.log), StandardScaler()

0 commit comments

Comments
 (0)