drcxcruz / InvariantCausalPrediction.jl

Invariant Causal Prediction in pure Julia
MIT License
3 stars 2 forks source link

InvariantCausalPrediction run failed #43

Open JuergenKanz opened 3 years ago

JuergenKanz commented 3 years ago

Your project is very interesting to me. Unfortunately, I can not run it. I have installed all needed packages like MLJ, DataFrames, CSV, Queryverse, and finally InvariantCausalPrediction on Julia 1.5.3.

In your Jupyter notebook ICP_Salary.ipynb I have changed the "include ...jl" to "using InvariantCausalPrediction".

Currently, I get the following output: Screenshot 2021-01-28 182612 Screenshot 2021-01-28 182723

What can I do?

drcxcruz commented 3 years ago

Thanks for your interest in the module. I also had similar issue while testing. The module loads many library files in parallel. From your first screenshot, the library loading section is failing after line: using VegaLite; println("VegaLite")

Check that file GetPValue.jl is in a location that is found by the include Julia command. Google shows a number of posts about the "undefvarerror: include not defined" error. Apparently is not uncommon Julia issue. I believe you cannot simply change import and using.

Consider starting with new and blank Julia file. Then, add one line at time of the following to see which import is failing.

println("Loading Libraries... This can take a few minutes") using Distributed; using Hwloc; println("Hwloc") if length(workers()) == 1 addprocs(Hwloc.num_physical_cores()) # get ready for parallelism end println("Distributed with ", length(workers()), " workers") using DataFrames; println("DataFrames") using Distributions: Normal, quantile; println("Distributions") using Query: @rename, @orderby; println("Query") using VegaLite; println("VegaLite") include("GetPValue.jl"); println("GetPValue.jl") include("GetBlankets.jl"); println("GetBlankets.jl") using .GetBlankets: getBlanketAll, getBlanketBoosting, getBlanketRandomForest; include("InvariantEnvironmentPrediction.jl");
using .InvariantEnvironmentPredictionModule; println("InvariantEnvironmentPrediction.jl") include("ICPlibrary.jl"); println("ICPlibrary.jl") println("Libraries Loaded")

Cheers

JuergenKanz commented 3 years ago

I have made some tests with the code you gave me yesterday. The attached zip file includes two Jupyter files: "First Run" shows what happened without any corrections. "Second Run" includes a number of necessary corrections. It clearly shows that some packages were missing. For clarification: My Julia 1.5.3 is/was pretty new. I installed IJulia, MLJ, InvariantCausalPrediction, DataFrames, Queryverse, and CSV via the Pkg system of Julia. Other packages had to be installed during the "Second run". I think it would already help in the set-up part of an ICP notebook to apply "using" for all needed packages. A user could already add missing packages during this first step.

Furthermore, the procedures could not find the needed 'jl'-files alone, so I had to change directories (look at "Second Run"). I assume the entire installation process especially regarding the file system has problems. Other internal issues as visible in the "Second run" are unclear to me.

I hope this will help for improvement.

ICP-Tests.zip