Skip to content

ENH: predict_partial: prediction for subset of exog #5363

Open

Description

@josef-pkt

partial prediction of the linear predictor is used in GAM, #5296, so we can see the nonlinear function implied by a subset of exog (spline basis in the GAM case).

This should be useful in more general, e.g. when we have terms that include several columns.
The idea would be similar to wald_test_terms.

The main usecase is only for the linear predictor part, but we can extend it to the eform, e.g. exp(linpred_partial) for Poisson or Logit.

It will not make sense transforming to the endog space using inverse link function because that needs all exog, i.e. needs to be covered by predict, predict_at similar to margins.

I'm not sure what the API should look like, how does user specify which part to predict.
E.g. when a formula was used, then we could find categoricals and splines, or string/name matching.
The user still needs to provide the "appropriate" data if we want partial predict with new exog.

GAM is a special case because we create and have the information about the design in our model.

Activity

  1. josef-pkt commented on Nov 2, 2018

    @josef-pkt
    MemberAuthor

    extension to regression_plots

    We have plot functions that display the effect of a one-column regressor, e.g. plot_regress_exog and plot_ccpr

    GAM Results has a plot_partial

    related; we currently don't have a function for plots of categorical effects after regression.
    AFAIR, I have seen some blog post for that.
    The problem is always to get the model/design information from inside the results instance, e.g. do with have original dataframe with relevant variable names that are transformed to several columns in the exog.

    Also, Kerby has added already several additional plots plot_added_variable, plot_partial_residuals, plot_ceres_residuals with similar pattern and some more interface/names handling than just using exog_idx.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions