Documentation and Examples

Contents

Documentation

  • Python and C documentation is built using Sphinx.

  • Each document is written in reStructuredText.

  • The documentation is the doc/ directory.

  • You can build it locally using make html command.

    make html
    

    Run make help to learn about the other commands.

The online document is hosted by Read the Docs where the imported project is managed by Hyunsu Cho and Jiaming Yuan.

Build the Python Docs using pip and Conda

  1. Create a conda environment.

    conda create -n xgboost-docs --yes python=3.10
    

    Note

    Python 3.10 is required by xgboost_ray package.

  2. Activate the environment

    conda activate xgboost-docs
    
  3. Install required packages (in the current environment) using pip command.

    pip install -r requirements.txt
    

    Note

    It is currently not possible to install the required packages using conda due to xgboost_ray being unavailable in conda channels.

    conda install --file requirements.txt --yes -c conda-forge
    
  4. (optional) Install graphviz

    conda install graphviz --yes
    
  5. Eventually, build the docs.

    make html
    

You should see the following messages in the console:

$ make html
sphinx-build -b html -d _build/doctrees   . _build/html
Running Sphinx v6.2.1
...
The HTML pages are in _build/html.

Build finished. The HTML pages are in _build/html.

Examples

  • Use cases and examples are in demo directory.

  • We are super excited to hear about your story. If you have blog posts, tutorials, or code solutions using XGBoost, please tell us, and we will add a link in the example pages.