Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CapeCod exposure on-level vector #66

Closed
jbogaardt opened this issue Mar 1, 2020 · 3 comments
Closed

CapeCod exposure on-level vector #66

jbogaardt opened this issue Mar 1, 2020 · 3 comments

Comments

@jbogaardt
Copy link
Collaborator

CapeCodneeds to support an exposure on-level (or trend) vector to make it useful in the real world.

@jbogaardt jbogaardt changed the title CapeCod exposureon-level vector CapeCod exposure on-level vector Mar 1, 2020
@jbogaardt
Copy link
Collaborator Author

jbogaardt commented Mar 4, 2020

Option 1 for API:

cl.CapeCod(on_level=on_level_vector).fit(X,sample_weight=sample_weight)

Pros: matches closer to sklearn api
Cons: puts "data" in as an "assumption".

Option 2 for API:

cl.CapeCod().fit(X,sample_weight=sample_weight, on_level=on_level)

Pros: puts "data" where it belongs
Cons: departure from sklearn

@jbogaardt
Copy link
Collaborator Author

jbogaardt commented Oct 24, 2020

Option 3 (Preferred):
Create a ParallelogramOLF transformer to transform sample_weight that creates an olf_ attribute on a Triangle. If sample_weight has the olf_ attribute, then CapeCod will use it.

# Assuming we have a rate history DataFrame with columns 'rate_change' and 'eff_date'
olf = cl.ParallelogramOLF(rate_history, change_col='rate_change', date_col='eff_date')
sample_weight = olf.fit_transform(sample_weight)
assert hasattr(sample_weight, 'olf_')  # sample_weight should have 'olf_' property
cl.CapeCod().fit(X,sample_weight=sample_weight) # cape cod will access 'olf_' property if available

@jbogaardt
Copy link
Collaborator Author

Refer to this example on how to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant