Question: Programmatically creating splines and applying knots to new data
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 990
- Forks
- 106
- Avg merge
- 7d 34m
- Merged PRs (30d)
- 1
Description
I have found that I can create a spline on training data and then apply to test data like this:
#create
x1= dmatrix("cr(x, df=3) - 1", {"x":TRAIN_DATA.VARIABLE.values})
#apply
xx1=build_design_matrices([x1.design_info], {"x":TEST_DATA.VARIABLE.values })
This works but of course requires manually creating variables or trying to programatically creating strings.
Is there anyway to do something like this
patsy.cr(x, df=5)
and grab the knots to apply to new data using the same function cr()?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the dmatrix and build_design_matrices workflow described in the issue, along with the cr() transformation behavior. Determine whether a public API for creating a spline and reusing its knots is specified or supported; the issue is done only when the intended reuse workflow and its scope are defined.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100