diff --git a/doc/build.rst b/doc/build.rst
index a80d99b56..d9b5bab08 100644
--- a/doc/build.rst
+++ b/doc/build.rst
@@ -161,23 +161,7 @@ To build with MinGW, type:
cp make/mingw64.mk config.mk; make -j4
-Building XGBoost library for python for Windows with MinGW-w64
---------------------------------------------------------------
-
-Windows versions of python are built with Microsoft Visual Studio. Usually python binary modules are built with the same compiler the interpreter is built with, raising several potential concerns.
-
-1. VS is proprietary and commercial software. Microsoft provides a freeware "Community" edition, but its licensing terms are unsuitable for many organizations.
-2. Visual Studio contains telemetry, as documented in `Microsoft Visual Studio Licensing Terms `_. It `has been inserting telemetry `_ into apps for some time. In order to download VS distribution from MS servers one has to run the application containing telemetry. These facts have raised privacy and security concerns among some users and system administrators. Running software with telemetry may be against the policy of your organization.
-3. g++ usually generates faster code on ``-O3``.
-
-So you may want to build XGBoost with g++ own your own risk. This opens a can of worms, because MSVC uses Microsoft runtime and MinGW-w64 uses own runtime, and the runtimes have different incompatible memory allocators. But in fact this setup is usable if you know how to deal with it. Here is some experience.
-
-1. The python interpreter will crash on exit if XGBoost was used. This is usually not a big issue.
-2. ``-O3`` is OK.
-3. ``-mtune=native`` is also OK.
-4. Don't use ``-march=native`` gcc flag. Using it causes the python interpreter to crash if the dll was actually used.
-5. You may need to provide the lib with the runtime libs. If ``mingw32/bin`` is not in ``PATH``, build a wheel (``python setup.py bdist_wheel``), open it with an archiver and put the needed dlls to the directory where ``xgboost.dll`` is situated. Then you can install the wheel with ``pip``.
-
+See :ref:`_mingw_python` for buildilng XGBoost for Python.
Compile XGBoost with Microsoft Visual Studio
--------------------------------------------
@@ -269,7 +253,7 @@ Alternatively, use CMake.
Python Package Installation
===========================
-The python package is located at ``python-package/``.
+The Python package is located at ``python-package/``.
There are several ways to install the package:
1. Install system-wide, which requires root permission:
@@ -279,7 +263,7 @@ There are several ways to install the package:
cd python-package; sudo python setup.py install
You will however need Python ``distutils`` module for this to
-work. It is often part of the core python package or it can be installed using your
+work. It is often part of the core Python package or it can be installed using your
package manager, e.g. in Debian use
.. code-block:: bash
@@ -290,7 +274,7 @@ package manager, e.g. in Debian use
If you recompiled XGBoost, then you need to reinstall it again to make the new library take effect.
-2. Only set the environment variable ``PYTHONPATH`` to tell python where to find
+2. Only set the environment variable ``PYTHONPATH`` to tell Python where to find
the library. For example, assume we cloned `xgboost` on the home directory
`~`. then we can added the following line in `~/.bashrc`.
This option is **recommended for developers** who change the code frequently. The changes will be immediately reflected once you pulled the code and rebuild the project (no need to call ``setup`` again)
@@ -312,6 +296,25 @@ package manager, e.g. in Debian use
import os
os.environ['PATH'] = os.environ['PATH'] + ';C:\\Program Files\\mingw-w64\\x86_64-5.3.0-posix-seh-rt_v4-rev0\\mingw64\\bin'
+.. _mingw_python:
+
+Building XGBoost library for Python for Windows with MinGW-w64
+--------------------------------------------------------------
+
+Windows versions of Python are built with Microsoft Visual Studio. Usually Python binary modules are built with the same compiler the interpreter is built with, raising several potential concerns.
+
+1. VS is proprietary and commercial software. Microsoft provides a freeware "Community" edition, but its licensing terms are unsuitable for many organizations.
+2. Visual Studio contains telemetry, as documented in `Microsoft Visual Studio Licensing Terms `_. It `has been inserting telemetry `_ into apps for some time. In order to download VS distribution from MS servers one has to run the application containing telemetry. These facts have raised privacy and security concerns among some users and system administrators. Running software with telemetry may be against the policy of your organization.
+3. g++ usually generates faster code on ``-O3``.
+
+So you may want to build XGBoost with g++ own your own risk. This opens a can of worms, because MSVC uses Microsoft runtime and MinGW-w64 uses own runtime, and the runtimes have different incompatible memory allocators. But in fact this setup is usable if you know how to deal with it. Here is some experience.
+
+1. The Python interpreter will crash on exit if XGBoost was used. This is usually not a big issue.
+2. ``-O3`` is OK.
+3. ``-mtune=native`` is also OK.
+4. Don't use ``-march=native`` gcc flag. Using it causes the Python interpreter to crash if the dll was actually used.
+5. You may need to provide the lib with the runtime libs. If ``mingw32/bin`` is not in ``PATH``, build a wheel (``python setup.py bdist_wheel``), open it with an archiver and put the needed dlls to the directory where ``xgboost.dll`` is situated. Then you can install the wheel with ``pip``.
+
R Package Installation
======================