Skip to content

Fit selected estimators to chain ladder #396

Answered by jbogaardt
paulinaKr asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @paulinaKr ,

Once you fit an estimator, you don't need to fit it again. I think you're implicitly doing that using fit_transform. Instead you call transform only if you've already fit it:

dev_est_t = cl.Development().fit(triangles['total_incurred']) # This is now fit
model = cl.Chainladder().fit(dev_est_t.transform(triangles['total_incurred'])) # Only calling Development.transform here

Alternatively, if you're planning on transforming the same triangle you are fitting, Pipeline estimators make the code a lot cleaner and not have to think about fit vs transform.

pipe = cl.Pipeline(
    [('dev', cl.Development()),
     ('model', cl.Chainladder())] # named this step as "model"
)
pipe.fit(t…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@paulinaKr
Comment options

@jbogaardt
Comment options

Answer selected by paulinaKr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants