Comments (6)
Hi,
Thanks for the question. The goal of policy optimization is to find the specific treatment that maximizes the causal effect among all possible treatment values, thus
As for the fit()
function, first you need to provide a data, then:
-
$\mathcal{Y}$ can be given in 3 different ways by specifyingeffect
(string, name of the causal effects in your data), oreffect_array
(an additional array of causal effect) if your data does not include causal effects directly, or, if you don't have the calculated causal effects, providing anest_model
(must be trained), which will then be used to calculate the causal effects. -
$\mathcal{X}$ needs not be given since the information has already included in the causal effects when specifying$\mathcal{Y}$ . -
$\mathcal{S}$ should include all the other relevant variables in your data and is given bycovariate
(names of these relevant variables in your data)
from ylearn.
Hi,
Thanks for the question. The goal of policy optimization is to find the specific treatment that maximizes the causal effect among all possible treatment values, thus Y should be the causal effects and X should include possible treatments.
As for the
fit()
function, first you need to provide a data, then:* Y can be given in 3 different ways by specifying `effect` (string, name of the causal effects in your data), or `effect_array` (an additional array of causal effect) if your data does not include causal effects directly, or, if you don't have the calculated causal effects, providing an `est_model` (must be trained), which will then be used to calculate the causal effects. * X needs not be given since the information has already included in the causal effects when specifying Y. * S should include all the other relevant variables in your data and is given by `covariate` (names of these relevant variables in your data)
Thanks for your reply!
In the example given in the doc, the array
from ylearn.
The shape of an allowed effect_array
(usually a numpy array) should be effect_array
indicates that the causal effect of taking the effect_array[n, j]
.
Specifically, for the example provided in the doc,
-
Does the first column stands for
$\mathcal{X}$ while the second column stands for$\mathcal{Y}$ ?No. As stated in the early reply, there is no need to provide
$\mathcal{X}$ . The first column indicates the causal effect of taking treatment 0 while the second column for treatment 1, i.e., both columns correspond to$\mathcal{Y}$ . -
And if effect_array takes an array which contains more than two columns, how does...
Please see the comment above.
-
... meaning of the return value which is ...
The returned array, say a numpy array
R
, means that which value of the treatment should be taken on each example to obtain the best causal effect for it, thus the shape$(N, )$ , e.g,R[n,] = 1
means that taking treatment 1 would lead to the best causal effect for the$n$ -th example.
from ylearn.
Thanks, I can understand what it means by specifying effect_array.
In the case where I don't have all the treatment effects, for example, for
from ylearn.
The important thing is that you need the full set of treatment effects to apply an optimization of the policy, since you are actually selecting the suitable treatment values when optimizing the policy. That said, if you only have the treatment effect for treatment 1 then there is no information on how to make the selection, thus the training of the policy tree is not feasible.
If you don't have the calculated effect_array
, then you can simply use a trained est_model
(any kinds of estimator_model provided by YLearn) and pass it as an argument to the fit
method of the policy_tree
(the fit
method will automatically calculate the effect).
from ylearn.
Okay, your explanation is quite clear! Thanks!
from ylearn.
Related Issues (20)
- Call for Contributors - 2022 July
- Discussions for YLearn Release Conference
- Process finished with exit code 139 (interrupted by signal 11: SIGSEGV) HOT 4
- run case_study_bank.py plotting issue on Mac HOT 8
- Problem about build a class "Why" HOT 1
- Problem about plotting causal graph HOT 13
- Problem about plotting policy tree HOT 7
- Problem about calling Why.fit() HOT 3
- How to use customed causal graph when calling Why.fit() ? HOT 3
- a problem return 'CausalTree' object has no attribute 'criterion' in causal_tree.py about def plot_causal_tree HOT 3
- File "data/marketing_promotion.csv.zip" missed in example_usages HOT 1
- decide attributeis not found HOT 6
- Cannot use CausalTree as estimator HOT 4
- 推荐您的项目参加-2022年**开源创新大赛
- How to compute CATE for continous treatment? HOT 2
- Dependency on turtle HOT 1
- 模型保存
- fit不指定treatment时,进程闪退
- 为什么我的因果图是缺失的 HOT 1
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 ylearn.