forked from microsoft/LightGBM
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
85 changed files
with
838 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
# Download a file and retry upon failure. This looks like | ||
# an infinite loop but CI-level timeouts will kill it | ||
function Download-File-With-Retries { | ||
param( | ||
[string]$url, | ||
[string]$destfile | ||
) | ||
do { | ||
Write-Output "Downloading ${url}" | ||
sleep 5; | ||
(New-Object System.Net.WebClient).DownloadFile($url, $destfile) | ||
} while(!$?); | ||
} | ||
|
||
$env:R_WINDOWS_VERSION = "3.6.3" | ||
$env:R_LIB_PATH = "$env:BUILD_SOURCESDIRECTORY/RLibrary" -replace '[\\]', '/' | ||
$env:PATH = "$env:R_LIB_PATH/Rtools/bin;" + "$env:R_LIB_PATH/R/bin/x64;" + "$env:R_LIB_PATH/miktex/texmfs/install/miktex/bin/x64;" + $env:PATH | ||
$env:CRAN_MIRROR = "https://cloud.r-project.org/" | ||
$env:CTAN_MIRROR = "https://ctan.math.illinois.edu/systems/win32/miktex/tm/packages/" | ||
|
||
if ($env:COMPILER -eq "MINGW") { | ||
$env:CXX = "$env:R_LIB_PATH/Rtools/mingw_64/bin/g++.exe" | ||
$env:CC = "$env:R_LIB_PATH/Rtools/mingw_64/bin/gcc.exe" | ||
} | ||
|
||
cd $env:BUILD_SOURCESDIRECTORY | ||
tzutil /s "GMT Standard Time" | ||
[Void][System.IO.Directory]::CreateDirectory($env:R_LIB_PATH) | ||
|
||
if ($env:COMPILER -eq "MINGW") { | ||
Write-Output "Telling R to use MinGW" | ||
$install_libs = "$env:BUILD_SOURCESDIRECTORY/R-package/src/install.libs.R" | ||
((Get-Content -path $install_libs -Raw) -replace 'use_mingw <- FALSE','use_mingw <- TRUE') | Set-Content -Path $install_libs | ||
} | ||
|
||
# download R and RTools | ||
Write-Output "Downloading R and Rtools" | ||
Download-File-With-Retries -url "https://cloud.r-project.org/bin/windows/base/old/$env:R_WINDOWS_VERSION/R-$env:R_WINDOWS_VERSION-win.exe" -destfile "R-win.exe" | ||
Download-File-With-Retries -url "https://cloud.r-project.org/bin/windows/Rtools/Rtools35.exe" -destfile "Rtools.exe" | ||
|
||
# Install R | ||
Write-Output "Installing R" | ||
Start-Process -FilePath R-win.exe -NoNewWindow -Wait -ArgumentList "/VERYSILENT /DIR=$env:R_LIB_PATH/R /COMPONENTS=main,x64" ; Check-Output $? | ||
Write-Output "Done installing R" | ||
|
||
Write-Output "Installing Rtools" | ||
Start-Process -FilePath Rtools.exe -NoNewWindow -Wait -ArgumentList "/VERYSILENT /DIR=$env:R_LIB_PATH/Rtools" ; Check-Output $? | ||
Write-Output "Done installing Rtools" | ||
|
||
# MiKTeX and pandoc can be skipped on non-MINGW builds, since we don't | ||
# build the package documentation for those | ||
if ($env:COMPILER -eq "MINGW") { | ||
Write-Output "Downloading MiKTeX" | ||
Download-File-With-Retries -url "https://miktex.org/download/win/miktexsetup-x64.zip" -destfile "miktexsetup-x64.zip" | ||
Add-Type -AssemblyName System.IO.Compression.FileSystem | ||
[System.IO.Compression.ZipFile]::ExtractToDirectory("miktexsetup-x64.zip", "miktex") | ||
Write-Output "Setting up MiKTeX" | ||
.\miktex\miktexsetup.exe --remote-package-repository="$env:CTAN_MIRROR" --local-package-repository=./miktex/download --package-set=essential --quiet download ; Check-Output $? | ||
Write-Output "Installing MiKTeX" | ||
.\miktex\download\miktexsetup.exe --remote-package-repository="$env:CTAN_MIRROR" --portable="$env:R_LIB_PATH/miktex" --quiet install ; Check-Output $? | ||
Write-Output "Done installing MiKTeX" | ||
|
||
initexmf --set-config-value [MPM]AutoInstall=1 | ||
conda install -q -y --no-deps pandoc | ||
} | ||
|
||
Add-Content .Renviron "R_LIBS=$env:R_LIB_PATH" | ||
|
||
Write-Output "Installing dependencies" | ||
$packages = "c('data.table', 'jsonlite', 'Matrix', 'R6', 'testthat'), dependencies = c('Imports', 'Depends', 'LinkingTo')" | ||
Rscript --vanilla -e "options(install.packages.check.source = 'no'); install.packages($packages, repos = '$env:CRAN_MIRROR', type = 'binary', lib = '$env:R_LIB_PATH')" ; Check-Output $? | ||
|
||
Write-Output "Building R package" | ||
Rscript build_r.R --skip-install ; Check-Output $? | ||
|
||
$PKG_FILE_NAME = Get-Item *.tar.gz | ||
$LOG_FILE_NAME = "lightgbm.Rcheck/00check.log" | ||
|
||
$env:_R_CHECK_FORCE_SUGGESTS_ = 0 | ||
if ($env:COMPILER -ne "MINGW") { | ||
Write-Output "Running R CMD check without checking documentation" | ||
R.exe CMD check --no-multiarch --no-examples --no-manual --ignore-vignettes ${PKG_FILE_NAME} ; $check_succeeded = $? | ||
} else { | ||
Write-Output "Running R CMD check as CRAN" | ||
R.exe CMD check --no-multiarch --as-cran ${PKG_FILE_NAME} ; $check_succeeded = $? | ||
} | ||
|
||
Write-Output "R CMD check build logs:" | ||
Get-Content -Path $env:BUILD_SOURCESDIRECTORY\lightgbm.Rcheck\00install.out | ||
|
||
Check-Output $check_succeeded | ||
|
||
Write-Output "Looking for issues with R CMD check results" | ||
if (Get-Content "$LOG_FILE_NAME" | Select-String -Pattern "WARNING" -Quiet) { | ||
echo "WARNINGS have been found by R CMD check!" | ||
Check-Output $False | ||
} | ||
|
||
$note_str = Get-Content "${LOG_FILE_NAME}" | Select-String -Pattern ' NOTE' | Out-String ; Check-Output $? | ||
$relevant_line = $note_str -match '.*Status: (\d+) NOTE.*' | ||
$NUM_CHECK_NOTES = $matches[1] | ||
$ALLOWED_CHECK_NOTES = 3 | ||
if ([int]$NUM_CHECK_NOTES -gt $ALLOWED_CHECK_NOTES) { | ||
Write-Output "Found ${NUM_CHECK_NOTES} NOTEs from R CMD check. Only ${ALLOWED_CHECK_NOTES} are allowed" | ||
Check-Output $False | ||
} | ||
|
||
Write-Output "No issues were found checking the R package" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,24 +4,26 @@ Title: Light Gradient Boosting Machine | |
Version: 2.3.2 | ||
Date: 2019-11-26 | ||
Authors@R: c( | ||
person("Guolin", "Ke", email = "[email protected]", role = c("aut", "cre")), | ||
person("Damien", "Soukhavong", email = "[email protected]", role = c("ctb")), | ||
person("Yachen", "Yan", role = c("ctb")), | ||
person("James", "Lamb", email="[email protected]", role = c("ctb")) | ||
) | ||
person("Guolin", "Ke", email = "[email protected]", role = c("aut", "cre")), | ||
person("Damien", "Soukhavong", email = "[email protected]", role = c("ctb")), | ||
person("Yachen", "Yan", role = c("ctb")), | ||
person("James", "Lamb", email="[email protected]", role = c("ctb")) | ||
) | ||
Description: Tree based algorithms can be improved by introducing boosting frameworks. LightGBM is one such framework, and this package offers an R interface to work with it. | ||
It is designed to be distributed and efficient with the following advantages: | ||
1. Faster training speed and higher efficiency. | ||
2. Lower memory usage. | ||
3. Better accuracy. | ||
4. Parallel learning supported. | ||
5. Capable of handling large-scale data. | ||
In recognition of these advantages, LightGBM has being widely-used in many winning solutions of machine learning competitions. | ||
In recognition of these advantages, LightGBM has been widely-used in many winning solutions of machine learning competitions. | ||
Comparison experiments on public datasets suggest that LightGBM can outperform existing boosting frameworks on both efficiency and accuracy, with significantly lower memory consumption. In addition, parallel experiments suggest that in certain circumstances, LightGBM can achieve a linear speed-up in training time by using multiple machines. | ||
Encoding: UTF-8 | ||
License: MIT + file LICENSE | ||
URL: https://github.com/Microsoft/LightGBM | ||
BugReports: https://github.com/Microsoft/LightGBM/issues | ||
NeedsCompilation: yes | ||
Biarch: false | ||
Suggests: | ||
ggplot2 (>= 1.0.1), | ||
knitr, | ||
|
@@ -37,4 +39,6 @@ Imports: | |
Matrix (>= 1.1-0), | ||
methods, | ||
utils | ||
RoxygenNote: 7.0.2 | ||
SystemRequirements: | ||
C++11 | ||
RoxygenNote: 7.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.