statsmodels / statsmodels/statsmodels
predict does not attempt to invert transformations to left hand side
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 11.6k
- Forks
- 3.6k
- Avg merge
- 7h 37m
- Merged PRs (30d)
- 96
Description
Let's say I have a model like this:
model = "log(y) ~ s"
fit = ols(model, data=data).fit()
Presumably I am trying to predict y from s. I am taking the log of the left hand side so that I believe that I now have a linear model. Ultimately though, I want the forecast value of y for a given value of s.
If I use fit.predict(s), what I am given are predictions for log(y) as opposed to y itself. Is there any way (for some subset of transformations for which the inverse is known) to tell the predict that I would like to predict y? Something like: fit.predict(s, 'y')
Contributor guide
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 at the fit.predict entry point and trace how the formula model="log(y) ~ s" is represented during prediction. Determine which left-hand-side transformations could have a known inverse, then define and test behavior for requesting predictions on the original y scale. Done means supported transformations return y-scale forecasts without changing the existing default behavior.
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
- Mostly clear
- Newbie friendliness
- 35/100