在R中安装lightgbm [英] Installing lightgbm in R

查看:165
本文介绍了在R中安装lightgbm的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了其他方法来安装lightgbm软件包,但无法完成.我在 github存储库中尝试了所有方法,但是它们不起作用. 我运行Windows 10和R 3.5(64位).有有人也有类似的问题.所以我尝试了他的解决方案:

I have tried different things to install the lightgbm package but I can´t get it done. I tried all methods at the github repository but they don't work. I run Windows 10 and R 3.5 (64 bit). There is someone with similar problems. So I tried his solution:

  1. 安装cmake(64位)

    1. 安装Visual Studio(2017)

    1. 安装Rtools(64位)

    1. 将系统变量中的路径更改为"C:\ Program" Files \ CMake \ bin \ cmake;"
    1. Changing Path in the System Variables to "C:\Program Files\CMake\bin\cmake;"

    1. 使用预编译的dll/lib安装lightgbm

  • ->

      devtools::install_github("Laurae2/lgbdl", force = TRUE)
      library(lgbdl)
      lgb.dl(commit = "master",
      compiler = "vs",
      repo = "https://github.com/Microsoft/LightGBM")
    
     *** arch - i386
    installing via 'install.libs.R' to C:/Users/X1/Documents/R/win- 
    library/3.5/lightgbm
    Error in eval(ei, envir) : Cannot find lib_lightgbm.dll
    * removing 'C:/Users/XXX/Documents/R/win-library/3.5/lightgbm'
    In R CMD INSTALL
    installation of package 
    �C:/Users/XXX/AppData/Local/Temp/RtmpczNLaN/LightGBM/R-package� had non- 
    zero exit status[1] FALSE
    

    有什么办法解决这个问题吗?

    Any idea how to fix this?

    推荐答案

    它对我有用,希望对您有所帮助.

    It works for me, hope it helps.

    1. 确保您安装了所有必需软件

    1. Make sure you install all mandatory software

    https://github.com/Microsoft/LightGBM下载预编译的.dll文件/版本 并将其放入.\ LightGBM \

    Download the precomplied .dll file from https://github.com/Microsoft/LightGBM/releases and put it in .\LightGBM\

    在install.libs.R中,设置use_precompile<-TRUE

    In install.libs.R, set use_precompile <- TRUE

    将CMakeLists.txt从根目录复制到.\ LightGBM \ R-package \ inst \ bin

    Copy CMakeLists.txt from root directory into .\LightGBM\R-package\inst\bin

    在R控制台中,输入: install.packages(file.path("C:\ yourdirectory \","LightGBM","R-package"),repos = NULL,类型="source")

    In R console type: install.packages(file.path("C:\yourdirectory\", "LightGBM", "R-package"), repos = NULL, type = "source")

    这篇关于在R中安装lightgbm的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆