NIEHS / PrestoGP

Penalized Regression on Spatiotemporal Outcomes using Gaussian Processes a.k.a. PrestoGP
https://niehs.github.io/PrestoGP/
0 stars 0 forks source link

Show/accessor methods need to be updated (or created) #48

Open ericbair-sciome opened 5 months ago

ericbair-sciome commented 5 months ago

At the moment, there is no way to show or access the regression coefficients or Matern covariance parameters for a PrestoGP model other than examining the "beta" and "covparams" slots directly. (Some "show" methods exist, but they have not been updated since I started working on this project.) That is confusing and not user friendly. Aside from "show" methods, I thought it would be useful to create some accessor methods such as "prestogp_get_beta", "prestogp_get_sigma", "prestogp_get_smoothness", etc. to allow users to easily extract any parameters of interest after fitting a model.

kyle-messier commented 5 months ago

@ericbair-sciome Accessing beta and theta parameters is pretty important - beta especially. One may want to even see the last iteration betas as a function of the penalty, so you can make plots like this

image

BTW: Are the objects S4 or S3?

ericbair-sciome commented 5 months ago

These are S4 objects. Currently, one can access the betas by referencing the slots directly: PrestoGP_object@beta or PrestoGP_object@covparams, but that's not very user friendly. That's especially true for the Matern parameters, since it is just a long vector, and it's not immediately obvious which elements are sigma, scale, smoothness, etc. So I will add some methods to make that easier. And the final glmnet object is stored in the PrestoGP class, so it would easy to add a method to create that type of plot as well.

We can do all of this without creating new methods, to be clear, so it's not a show stopper in terms of analyzing your data. But I wanted to put it on my to do list.