guitargeek / XGBoost-FastForest

Minimal library code to deploy XGBoost models in C++.
MIT License
89 stars 30 forks source link

Executing Test(s) Issue #18

Open taylorlanglopez opened 2 years ago

taylorlanglopez commented 2 years ago

So, I tried to clone this repo and set up the tests in order to see the recently closed issue of C++98 compatibility, and I ran into a lot of issues trying to get the script create_test_data.py to execute on my machine, mainly because of dependencies. I've made a virtualenv and attached the list of dependencies I had to retrieve and/or pip retrieved in order for me to perform the following sequence of commands

python3 create_test_data.py
python3 test_cppyy.py
-- this was all done to satisfy the test.cpp requirement for the model.txt
g++ -std=c++98 -pedantic test.cpp -lfastforest
./a.out

One last issue I had to resolve was the test scripts inability to find the module xgboos2tmva.py, my solution was to just copy it from the benchmark folder to the test folder. I also tried to do the export PYTHONPATH route but it didn't seem to work. Might want to update the documentation to let people know how to solve that issue, or some other solution.

I was met with a Tests PASSED which is a relief but this felt painful to initiate these tests, I'm going to attach a requirements.txt so that people can use the feature from pip pip install -r requirements.txt after cloning the repo so that the dependencies are resolved.

If you'd like me to submit a pull request with an update to the README.md I can also go that route, but I'd rather you have the opportunity/choice to solve this your own way if necessary. I'd just thought I would bring up this pain point I experienced. Either way, I really like this library, great work!

Raw Requirements.txt

cppyy==2.3.0
cppyy-backend==1.14.8
cppyy-cling==6.25.3
CPyCppyy==1.12.9
cycler==0.11.0
fonttools==4.31.2
joblib==1.1.0
kiwisolver==1.4.1
matplotlib==3.5.1
numpy==1.22.3
packaging==21.3
pandas==1.4.1
Pillow==9.0.1
pyparsing==3.0.7
python-dateutil==2.8.2
pytz==2022.1
scikit-learn==1.0.2
scipy==1.8.0
six==1.16.0
sklearn==0.0
threadpoolctl==3.1.0
xgboost==1.5.2

The only reason I had to execute the tests this way is because the README.md install process it creates a test target but the resource required for that executable do not exist (continous/model.txt, discrete/model.txt, etc.) so when you invoke the ./Test executable generated by cmake it just crashes near instantly.

guitargeek commented 2 years ago

Hi @taylorlanglopez, these are all fair points! I didn't spend any time to streamline the testing experience for now, because I though I was the only person running the tests. But now that I see that there are some users, I will work on these problems you highlighted when I have time.