This page is for key instructions of intalling, using and contributing to ThunderGBM. Everyone in the community can contribute to ThunderGBM to make it better.
First of all, you need to install the prerequisite libraries and tools. Then you can download and install ThunderGBM.
- cmake 2.8 or above
- gcc 4.8 or above for Linux | CUDA 8 or above
- Visual C++ for Windows | CUDA 10
git clone https://github.com/zeyiwen/thundergbm.git
cd thundergbm
#under the directory of thundergbm
git submodule init cub && git submodule update#under the directory of "thundergbm"
mkdir build && cd build && cmake .. && make -j./bin/thundergbm-train ../dataset/machine.conf
./bin/thundergbm-predict ../dataset/machine.confYou will see RMSE = 0.489562 after successful running.
You can build the ThunderGBM library as follows:
cd thundergbm
mkdir build
cd build
cmake .. -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE -DBUILD_SHARED_LIBS=TRUE -G "Visual Studio 15 2017 Win64"You need to change the Visual Studio version if you are using a different version of Visual Studio. Visual Studio can be downloaded from this link. The above commands generate some Visual Studio project files, open the Visual Studio project to build ThunderGBM. Please note that CMake should be 3.4 or above for Windows.
First of all, please refer to the above instruction for installing ThunderGBM. Then, you can run the demo by the following command.
./bin/thundergbm-train ../dataset/machine.conf
./bin/thundergbm-predict ../dataset/machine.confIf you like to know more about the detailed options of running the binary, please use the -help option as follows.
./bin/thundergbm-train -helpIn ThunderGBM, the command line options can be added in the machine.conf file under the dataset folder. All the options are listed in the Parameters page.
Most of the documents can be viewed on GitHub. The documents can also be viewed in Read the Doc. The HTML files of our documents are generated by Sphinx, and the source files of the documents are written using Markdown. In the following, we describe how to setup the Sphinx environment.
- Install sphinx
pip install sphinx- Install Makedown Parser
pip install recommonmarkNote that recommonmark has a bug when working with Sphinx in some platforms, so you may need to hack into transform.py to fix the problem by yourself. You can find the instruction of hacking in this link.
- Install Sphinx theme
pip install sphinx_rtd_theme-
Generate HTML
Go to the "docs" directory of ThunderGBM and run:
make htmlAt this point, make sure you have generated the documents of ThunderGBM. You can build the documents in your machine to see the outcome.
You need to fetch the latest version of ThunderGBM before submitting a pull request.
git remote add upstream https://github.com/Xtra-Computing/thundergbm.git
git fetch upstream
git rebase upstream/masterFor building test cases, you also need to obtain googletest using the following command.
#under the thundergbm directory
git submodule update --init src/test/googletestAfter obtaining the googletest submodule, you can build the test cases by the following commands.
cd thundergbm
mkdir build && cd build && cmake -DBUILD_TESTS=ON .. && make -jThere are two key steps to use ThunderGBM for ranking.
- First, you need to choose
rank:pairwiseorrank:ndcgto set theobjectiveof ThunderGBM. - Second, you need to have a file called
[train_file_name].groupto specify the number of instances in each query.
The remaining part is the same as classification and regression. Please refer to Parameters for more information about setting the parameters.
You have to ensure the repository is identical to the latest one.
- Clone ThunderGBM repository
git clone https://github.com/zeyiwen/thundergbm.git
cd thundergbm
#under the directory of thundergbm
git submodule init cub && git submodule update- Build the binary
mkdir build && cd build && cmake .. && make -j
- Build the python wheel file
- change directory to python by
cd ../python - update the version you are going to release in setup.py
- you may need to install the
wheeldependency bypip3 install wheel
- change directory to python by
python3 setup.py bdist_wheelYou have to ensure the repository is identical to the latest one.
- Requirements
- Visual Studio
- CUDA 10.0 or above
- python3.x
- Clone ThunderGBM repository
git clone https://github.com/zeyiwen/thundergbm.git
cd thundergbm
#under the directory of thundergbm
git submodule init && git submodule update- Cmake using Visual Studio Developer Command Prompt
mkdir build && cd build
cmake .. -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE -DBUILD_SHARED_LIBS=TRUE -G "Visual Studio 15 2017 Win64"
You may need to change the version of Visual Studio if you are using a different version of Visual Studio.
- Build binary file using Visual Studio
- Open the file in path 'thundergbm/build/thundergbm.sln' with Visual Studio
- Click 'Build all' in Visual Studio
- Build the python wheel file
- change directory to python by
cd ../python - update the version you are going to release in setup.py
- you may need to install the
wheeldependency bypip3 install wheel
- change directory to python by
python3 setup.py bdist_wheel- Upload the wheel file to Pypi.org
- you may need to install the
twinedependency bypip3 install twine - you need to use
python3 -m twine upload dist/*iftwineis not included inPATH
- you may need to install the
twine upload dist/* --verbose
- [Recommended] Draw a new release on Release
- state the bug fixed or new functions.