Comments (6)
This indicates that none of the models for your features were successfully trained when you were fitting the CausalAnalysis class. I don't think that this logic should succeed, but we could consider providing a more informative error message.
Looking at your logs, you can see that the models for the features are all failing to train, with the message
Exception caught when training model for feature Population: cannot set WRITEABLE flag to True of this array
which is the real issue that you're running into. It's not immediately clear to me whether this is an issue with EconML or with your code.
from econml.
Thank you for the prompt response @kbattocchi . The error is starting from the CausalAnalysis call in our code https://github.com/microsoft/responsible-ai-toolbox/blob/d665107a9512a3934c7f2e9d44f58fd2b15f4fb6/responsibleai/responsibleai/managers/causal_manager.py#L407, and we're mostly dealing with pandas dataframes and using EconML's methods to fit our model. Looks like the code in
has several np operations; I wonder if any of those np calls may be returning unwriteable arrays.Someone hit the same error when metainfo is changed - open-mmlab/mmdetection#3628
If there's a casting/metadata issue while invoking any of those np methods, I wonder if resolving the ValueError statement may pass our unit tests even if the model is untrained/spurious, or dk if no model prediction is a possible scenario with using CausalAnalysis.
from econml.
@kbattocchi, we haven't changed anything in our code for causal for sometime now. Any case there was change that was introduced in the release of 2/14 that is causing this error now?
from econml.
@gaugup @Advitya17 although it's possible that something has changed on our end I think it's pretty unlikely - CausalAnalysis is basically in maintenance mode and so we only make minor changes (e.g. to support sklearn API breaking changes), although changes to other components of the EconML library that CausalAnalysis depends on could theoretically cause a break, but again I'm not aware of any changes that should result in this behavior.
It seems more likely that you're picking up some mutually incompatible versions of other libraries - for instance see pandas-dev/pandas#24839 for an incompatibility between certain pandas and numpy versions that causes the underlying error.
Do you have a local repro? And if so, can you output the results of pip list
?
from econml.
seems it occurs only with scikit-learn==1.4.1.post1 which was just released in Feb
from econml.
apparently the error above was an issue with scikit-learn and numpy which was conveniently fixed with 1.5.1, see:
scikit-learn/scikit-learn#29018
using this write flag was added and then subsequently removed in newer versions of scikit-learn, so if using latest scikit-learn 1.5.1 the issue should go away
from econml.
Related Issues (20)
- DML discrete outcome HOT 1
- High memory footprint for big dataframes in CausalForest model HOT 3
- Questions about econml and CausalForestDML
- Reduce residual confounding in time series
- How can I calculate the treatment effect function in a double machine learning model? HOT 1
- Why Shape of Y in Causal Forest notebook is 1000*1000 HOT 2
- Migrate DeepIV to new TensorFlow API or PyTorch HOT 2
- Support numpy 2.0 HOT 1
- Support scikit-learn 1.5.0
- Causal Forest DML has very wide confidence interval HOT 1
- V0.15.0 runs hours longer than V0.14.0 HOT 3
- oob_predict_interval: request to add functionality for prediction of out-of-bag confidence intervals
- DeepIV.fit with Inference='bootstrap' throws error
- ModuleNotFoundError: No module named 'econml.dynamic' HOT 1
- Error of crossfit folds splits with DynamicDML HOT 2
- Inquiry About Confidence Interval Type in .effect_inference Method HOT 2
- criterion in grf.CausalForest HOT 1
- Bug when passing featurizer that requires more than 1 row in SparseLinearDrLearner HOT 1
- XgBoost as nuisance model in DML learners (categorical features) HOT 2
- ForestDRLearner : outcome binary and treatement is discret ( 3 values) HOT 2
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 econml.