Comments (4)
Alright one issue is that sklearn
uses the following format; model.fit(X, y)
while statsmodels uses model.predict(y, X)
. Since I want users to be able to use whatever model in TMLE (like homebrew SuPyLearner), this causes an issue.
Some potential solutions:
- have the user feed in a fitted model, with the prediction function, like
fitted.predict(...)
. This avoids any issues on my end. Essentially all models are run outside of TMLE in this case. Which might be preferable, since it allows users to run diagnostics and independently fit the models. If they are all inside TMLE class, the fit might be ignored (at least more likely) - Haven't thought of an alternative yet
from zepid.
Finalized solution; user feeds in a fitted Class with the predict()
function. This avoids the above issue and allows a wider variety of models.
Also note, patsy is now used in the background to do some data filtering as necessary. There is a try-except loop that captures whether the fed in model needs an intercept (potentially statsmodels) vs models that don't (sklearn)
This will be released in v0.3.1 (in the next few days as of this comment)
from zepid.
Going back to change this for v0.4.0. I need to use another way to operationalize this. The necessity is because I want LTMLE to match TMLE. For LTMLE and sequential regression, a model has to be fit EACH time point. Therefore, I need to have LTMLE do the fitting each time. The user needs to pass an unfitted model.
Users should pass some class object containing their predictive function of choice. That class should have a function with fit() and predict(). I will need to have a background process that looks to see what variable specifications exist in fit(). For sklearn and supylearner, X
and y
are used. statsmodels uses endog
and exog
. Those libraries should be a sufficient start. I can eventually add more possibilities as requested
from zepid.
v0.4.0 #35 supports sklearn
and supylearner
as input classes in custom_model
. Dropped statsmodels support now for TMLE, since they format is a little hard to use within the function. Also, the machine learning is the key reason for this feature. Targeting the ML libraries is my primary goal. I have added an error for users to open an issue if they have some class they would like to see implemented
from zepid.
Related Issues (20)
- IPTW handle PerfectSeparationErrors in the marginal structural model better
- AIPW for survival analysis ? HOT 1
- Dual treatments
- ValueError better pytest strategy
- Package compatibility? HOT 2
- Update documentation (and possibly re-organize) HOT 2
- MonteCarloGFormula
- Add Odds Ratio and other estimands for AIPTW and TMLE
- Addition of meta-analysis tools
- add p-value column in a forrest plot/ effectmeasureplot HOT 2
- Enhancement in graphics.py to change odds text size HOT 1
- Saving DAGs programatically HOT 11
- sklearn dependancy in setup.py should be scikit-learn HOT 1
- AIPW formula equivalent to what's in the literature? HOT 2
- Perfect separation error for using `SingleCrossfitTMLE` HOT 2
- Superlearn check weights HOT 2
- SingleCrossFit `invalid value encountered in log` HOT 8
- Unable to install latest 0.9.0 version through pip HOT 7
- Risk Ratio Summary HOT 1
- The default regression argument of zepid.base.interaction_contrast_ratio differs from the description in the documentation. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zepid.