前言
深度学习涉及很多向量或多矩阵运算,如矩阵相乘、矩阵相加、矩阵-向量乘法等。深层模型的算法,如BP,Auto-Encoder,CNN等,都可以写成矩阵运算的形式,无须写成循环运算。然而,在单核CPU上执行时,矩阵运算会被展开成循环的形式,本质上还是串行执行。GPU(Graphic Process Units,图形处理器)的众核体系结构包含几千个流处理器,可将矩阵运算并行化执行,大幅缩短计算时间。随着NVIDIA、AMD等公司不断推进其GPU的大规模并行架构,面向通用计算的GPU已成为加速可并行应用程序的重要手段。得益于GPU众核(many-core)体系结构,程序在GPU系统上的运行速度相
Installing the Python Wrapper
Please follow these instructions to prepare XGBoost for use with Python. I am placing xgboost in a directory called xgboost_install_dir but this can be anything.
1. git clone https://github.com/dmlc/xgboost.git xgboost_install_dir
2. copy libxgboost.dll into the xgboost_install_dir\python-package\xgboost\ directory
3. cd xgboost_install_dir\python-package\
4. python setup.py install
下面是使用举例
import xgboost
xr = xgboost.XGBRegressor()
xr.fit(X, y)
xr.predict(X_test)