ihmeuw-msca / mrtool Goto Github PK
View Code? Open in Web Editor NEWFeatured Nonlinear Mixed effects Models
Home Page: https://mrtool.readthedocs.io/en/latest
License: BSD 2-Clause "Simplified" License
Featured Nonlinear Mixed effects Models
Home Page: https://mrtool.readthedocs.io/en/latest
License: BSD 2-Clause "Simplified" License
For function
extract_data_info(signal_model,
linear_model,
ref_covs,
alt_covs,
exp_quantiles = c(0.15, 0.85),
exp_bounds = NULL,
num_points = 100L,
normalize_to = NULL)
signal_model to extract weights from get_w_soln()
However, get_w_soln() has not been defined by MRBeRT module
I want to know whether the followed code can replace the role of get_w_soln()
w <- t(do.call(rbind,
lapply(1:length(signal_model$sub_models),
function(i){signal_model$sub_models[[i]]$w_soln}))
) %*% signal_model$weights
Or what can I do to make extract_data_info() run correctly?
In https://github.com/ihmeuw-msca/mrtool/blob/main/src/mrtool/core/utils.py#L318-L319, the first and last knots set to be the very smallest and largest number in the list. This will lead to the knots not begin with 0 and end with 1 if the smallest bound is not 0 and largest bound is not 1. We should hard set to 0 and 1.
_**Dear MRTool Developers,
Recently I'm trying to use this tool to predict the exposure-response curves, but I have encountered some issues regarding the codes.
I have tested a sample you give in this website: https://mrtool.readthedocs.io/en/latest/examples/example_linear.html
Here shows my codes:**_
#-----------------------------------------------------------------
df,
col_obs='y',
col_covs=['x'],
col_obs_se='y_se',
col_study_id='study_id'
data,
[cov_intercept, cov_x]
#-----------------------------------------------------------------
Then error occurs:
#-----------------------------------------------------------------
Traceback (most recent call last):
File "/raven/u/nirj/Python/Health_Impact/pro/Asthma_updated/dataset/../pro/data_test_MRData_t.py", line 39, in
model.fit_model()
File "/u/nirj/.local/lib/python3.9/site-packages/mrtool-0.0.1-py3.9.egg/mrtool/core/model.py", line 272, in fit_model
self.lt = LimeTr(n, k_beta, k_gamma,
TypeError: init() got an unexpected keyword argument 'S'
#-----------------------------------------------------------------
I have checked the function library 'LimeTr' called here,
#-----------------------------------------------------------------
def fit_model(self, **fit_options):
"""Fitting the model through limetr.
...
**# create limetr object
self.lt = LimeTr(n, k_beta, k_gamma,
y, x_fun, x_fun_jac, z_mat, S=s,
C=c_fun, JC=c_fun_jac, c=c_vec,
H=h_fun, JH=h_fun_jac, h=h_vec,
uprior=uprior, gprior=gprior, lprior=lprior,
inlier_percentage=self.inlier_pct)**
...
#-----------------------------------------------------
As the text shown in bold, a lot of variables are passing to LimeTr. But I found that, in the lastest version of LimeTr (v0.1.1), variables are not defined and passed in this way (shown below). While in the earliest version, it does (shown below).
#----lastest version 0.1.1 LimeTr--------------------
def init(self,
data: Data,
fevar: FeVariable,
revar: ReVariable,
inlier_pct: float = 1.0):
"""
#----lastest version 0.0.1 LimeTr--------------------
class LimeTr:
def init(self, n, k_beta, k_gamma, Y, F, JF, Z,
S=None, share_obs_std=False,
C=None, JC=None, c=None,
H=None, JH=None, h=None,
uprior=None, gprior=None, lprior=None,
certain_inlier_id=None,
inlier_percentage=1.0):
"""
#-----------------------------------------------------
_**So I guess the error occurs due to the version update or version compatibility issues. It seems that, MRTool has not been updated to adapt to the updates of LimeTr. I have tried to install the earliest version of LimeTr (v0.0.1), but it always failed.
Do you have any idea or advice on this? How can I successfully use MRTool? I'm looking forward to your replies.
Many thanks,
Ruijing Ni**_
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.