-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
immutable feature changes when using #1022
Comments
Hi @Berlyli866, From what I can see in the code snippet above, you are not really following the conventions presented in the documentation. Please also have a look at the docs here, besides the Adult Census example we provide. Some issues that I can see in the code above are:
ranges = {
'num_image': [0.0, 1.0],
'num_alternative_image': [-1.0, 0.0],
'num_market_bullets': [-1.0, 1.0]
} This means that when generating the counterfactual for a given instance
You don't necessarily need to train an autoencoder. You can see an example here how to do that. Please read the final paragraph in this comment. You should provide a complete description of Although we didn't test explicitly for regression models, I think the implementation still supports it for a single target. It is really up to you how to design the reward function. You can give a sparse or continuous reward based on the distance from your target. The reward function can be specified through the parameter |
Hi Robert, For but if i use the indices key, it will run through. In my code the
which means I want the I actually have other features in
the
0,2,6,7 is the feature index. Now that I know if they are binary, we also need to specify. thanks. |
Hi team,
First of all, thanks to the team for working on building such a good package for us to use.
I follow the example Counterfactual with Reinforcement Learning (CFRL) on Adult Census to build my own CFL.
I have a data set that is a mix of numerical, binary, and category features.
I trained a random forest classification model as the predictor model and ran
counterfactualtabluer
to generate the counterfactual for features that I am interested in. Below is part of the code on how i specify the candidate features and immutable featureafter I get the counterfactual df I compared it with original df and got the difference columns below. The avg_delivery_days is immutable but also changes though very tiny change, for 'num_image', 'num_alternative_image' , 'num_market_bullets' the change is also minimal. Can I see the changed features play an important role in predicting the label (>0.4 or <=0.4) since a small change and flip the label ? Did i use the right counterfactual function for my use case? :
For tabluar data , do i always need encoder and decoder? if its already binary should i put binary feature in category_map in below function ?
heae_preprocessor, heae_inv_preprocessor = get_he_preprocessor(X=X_train, feature_names=model_attr, category_map=cate_map, feature_types=feature_types)
Another question I have is what function I can use for the environment models, such as boost regression or a regression type of black box model?
If I tried to use
but replace predictor as the boost regression model. What other changes do I need to make since the regression model, the prediction is continuous, how can i customize the reward function?
sorry for all these questions, as i am a starter in RL and is still learning everthing so forgive me if my questions sounds dump.
thanks for your time and help
The text was updated successfully, but these errors were encountered: