日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

【简明教程】windows下xgboost安装到python

發(fā)布時間:2025/4/16 python 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【简明教程】windows下xgboost安装到python 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

文章目錄

    • github clone
    • 下載xgboost.dll
    • 編譯
    • 檢測

github clone

電腦上使用github

git clone https://github.com/dmlc/xgboost.git

會在對應的目錄下,多出一個xgboost目錄。

下載xgboost.dll

  • 訪問 http://www.picnet.com.au/blogs/guido/2016/09/22/xgboost-windows-x64-binaries-for-download/
  • 在下面選一個,如果有cuda的話,就選GPU版本的,否則就選Not GPU

  • 將下載的xgboost.dll文件放到git clone下來的python-package\xgboost文件夾中

編譯

進入到git clone下來的python-package文件夾中,進入命令行
輸入:Python setup.py install

檢測

D:\>python Python 3.6.6 (v3.6.6:4cf1f54eb7, Jun 27 2018, 03:37:03) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import xgboost D:\SoftWare\Python\lib\site-packages\sklearn\externals\joblib\externals\cloudpickle\cloudpickle.py:47: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative usesimport imp >>> xr = xgboost.XGBRegressor() >>> import numpy as np >>> X = np.array([[1, 2, 3], [4, 5, 6]]) >>> y = np.array([1, 2]) >>> xr.fit(X, y) XGBRegressor(base_score=0.5, booster='gbtree', colsample_bylevel=1,colsample_bytree=1, gamma=0, importance_type='gain',learning_rate=0.1, max_delta_step=0, max_depth=3,min_child_weight=1, missing=None, n_estimators=100, n_jobs=1,nthread=None, objective='reg:linear', random_state=0, reg_alpha=0,reg_lambda=1, scale_pos_weight=1, seed=None, silent=True,subsample=1) >>> X_t = np.array([[1, 2, 3],]) >>> xr.predict(X_t) array([0.9978384], dtype=float32)

總結

以上是生活随笔為你收集整理的【简明教程】windows下xgboost安装到python的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。