Граф коммитов

43 Коммитов

Автор SHA1 Сообщение Дата
James Lamb da9bb5fd72
[R-package] always name the shared library 'lightgbm', not 'lib_lightgbm' (#6432) 2024-05-01 12:55:33 -05:00
James Lamb 98c1db7794
[R-package] use C++17 in the CRAN package (#5690) 2023-03-06 21:57:18 -06:00
James Lamb 9954bc4231
[R-package] discourage use of regex for fixed string comparisons (#5685) 2023-01-30 23:33:48 -06:00
James Lamb 51efd90152
[R-package] correctly quote paths on Windows for CMake-based builds (#5607) 2022-11-28 21:26:26 -06:00
CuriousCorrelation 1b43214f72
[ci] [R-package] Add string_boundary_linter (#5324) 2022-06-23 18:13:14 -05:00
CuriousCorrelation 4b64b173c1
[ci] [R-package] Add paste_linter (#5320)
[ci] [R-package] Add paste_linter (#5303)
2022-06-22 16:46:48 -05:00
Nikita Titov e08cffba40
[R-package] Specify concrete linting rule that is being ignored via `nolint` mark (#5300)
* Update make-r-def.R

* Update make-r-def.R

* Update build_r.R

* Update utils.R

* Update install.libs.R
2022-06-18 21:15:48 -05:00
James Lamb 688f73d14a
[ci] [R-package] upgrade to lintr v3.0 (fixes #5228) (#5294) 2022-06-16 10:17:22 -05:00
James Lamb 5fa887bb79
[R-package] [docs] add intro vignette (#3946) (#4775)
* [R-package] [docs] add intro vignette (#3946)

* add 10 test vignettes

* Revert "add 10 test vignettes"

This reverts commit 40fb2e2f19.

* Apply suggestions from code review

Co-authored-by: Nikita Titov <nekit94-08@mail.ru>

Co-authored-by: Michael Mayer <mayermichael79@gmail.com>
Co-authored-by: Nikita Titov <nekit94-08@mail.ru>
2021-11-17 22:15:32 -06:00
James Lamb 7152c49a76
[R-package] parallelize compilation in CMake-based builds (#4525)
* [R-package] parallelize compilation in CMake-based builds

* Apply suggestions from code review

Co-authored-by: Nikita Titov <nekit94-08@mail.ru>

* working on adding -j

* pass -j through to install.libs.R

* add docs on -j

* use -j4

* Update R-package/README.md

Co-authored-by: Nikita Titov <nekit94-08@mail.ru>

Co-authored-by: Nikita Titov <nekit94-08@mail.ru>
2021-11-10 09:39:59 +08:00
James Lamb 441f38bb81
[R-package] remove lgb.last_error() and LGBM_GetLastError_R() (#4344) 2021-06-05 07:51:48 -05:00
James Lamb 676c95fb27
[R-package] manage Dataset and Booster handles as R external pointers (fixes #3016) (#4265)
* started converting handles

* more changes

* sort of working for Dataset

* yay all the tests are passing for Dataset handle changes

* working for other handle types

* remove debugging logging

* remove unnecessary spaces

* fix null logic

* more NULL

* updates

* Apply suggestions from code review

Co-authored-by: Nikita Titov <nekit94-08@mail.ru>

* consolidate steps

Co-authored-by: Nikita Titov <nekit94-08@mail.ru>
2021-05-13 00:42:39 +03:00
James Lamb 66ee29192a
[R-package] Convert LGBM_GetLastError_R to use R built-in types (#4242)
* [R-package] move some functions over to SEXP objects

* clarify comment

* remove paste0()

* fix registration table

* fix cmake builds
2021-05-02 16:23:18 -05:00
James Lamb 26cde5f513
[R-package] remove pre-allocated call_state in C++ calls (#4244) 2021-05-01 14:49:08 -05:00
James Lamb b27dcfa48f
[R-package] prevent symbol lookup conflicts (fixes #4045) (#4155)
* [R-package] prevent symbol lookup conflicts

* add unit tests

* only run test on Windows

* move to .Call() calls

* fix references

* testing registration for CMake builds

* revert NAMESPACE changes

* revert testing changes
2021-04-30 16:29:38 -05:00
Nikita Titov a9d9b1199c
store all CMake files in one place (#4087) 2021-03-21 16:36:03 +03:00
Nikita Titov 6bb6164e3c
Move compute and eigen libraries to external_libs folder (#3809)
* move all submodules to external_libs folder

* Update .Rbuildignore

* Update MANIFEST.in

* Update .appveyor.yml

* Update CMakeLists.txt

* Update build_r.R

* Update test.sh

* Update setup.py

* Update CMakeLists.txt

* Update test.sh

* Update setup.py

* Update conf.py

* Update MANIFEST.in

* Update LightGBM.vcxproj

* continue

* test

* test

* Update setup.py

* hotfix

* revert CI tests
2021-01-22 17:45:43 +03:00
James Lamb 8593f8503c
[R-package] Add GPU install options (fixes #3765) (#3779)
* [R-package] Add GPU install options (fixes #3765)

* whitespace

* linting

* Update build_r.R

Co-authored-by: Nikita Titov <nekit94-08@mail.ru>

Co-authored-by: Nikita Titov <nekit94-08@mail.ru>
2021-01-18 20:08:20 -06:00
James Lamb ed651e8672
[R-package] enable use of trees with linear models at leaves (fixes #3319) (#3699)
* [R-package] enable use of trees with linear models at leaves (fixes #3319)

* remove problematic pragmas

* fix tests

* try to fix build scripts

* try fixing pragma check

* more pragma checks

* ok fix pragma stuff for real

* empty commit

* regenerate documentation

* try skipping test

* uncomment CI

* add note on missing value types for R

* add tests on saving and re-loading booster
2021-01-18 15:44:38 +03:00
Guangyu Zeng 3fd48864da
[R-package] Add explicit return statement to R functions. (#3703)
* add explicit return statement to functions in callback.R

* add explicit return statement to functions in lgb.Booster.R

* add explicit return statement to functions in lgb.Dataset.R

* add explicit return statement to functions in lgb.Predictor.R

* add explicit return statement to functions in lgb.cv.R

* add explicit return statement to functions in lgb.interprete.R

* add explicit return statement to functions in lgb.plot.importance.R

* add explicit return statement to functions in saveRDS.lgb.Booster.R

* add explicit return statement to functions in utils.R

* add explicit return statement to functions in lgb.plot.interpretation.R

* add explicit return statement to functions in build_r.R

* fix typo

* return(self) -> return(invisible(self))

* fix some inconsistent indention

* fix test failure

* add another return() statement

* fix linting errors
2021-01-04 20:54:52 -06:00
Alberto Ferreira 792c930305
Fix model locale issue and improve model R/W performance. (#3405)
* Fix LightGBM models locale sensitivity and improve R/W performance.

When Java is used, the default C++ locale is broken. This is true for
Java providers that use the C API or even Python models that require JEP.

This patch solves that issue making the model reads/writes insensitive
to such settings.
To achieve it, within the model read/write codebase:
 - C++ streams are imbued with the classic locale
 - Calls to functions that are dependent on the locale are replaced
 - The default locale is not changed!

This approach means:
 - The user's locale is never tampered with, avoiding issues such as
    https://github.com/microsoft/LightGBM/issues/2979 with the previous
    approach https://github.com/microsoft/LightGBM/pull/2891
 - Datasets can still be read according the user's locale
 - The model file has a single format independent of locale

Changes:
 - Add CommonC namespace which provides faster locale-independent versions of Common's methods
 - Model code makes conversions through CommonC
 - Cleanup unused Common methods
 - Performance improvements. Use fast libraries for locale-agnostic conversion:
   - value->string: https://github.com/fmtlib/fmt
   - string->double: https://github.com/lemire/fast_double_parser (10x
      faster double parsing according to their benchmark)

Bugfixes:
 - https://github.com/microsoft/LightGBM/issues/2500
 - https://github.com/microsoft/LightGBM/issues/2890
 - https://github.com/ninia/jep/issues/205 (as it is related to LGBM as well)

* Align CommonC namespace

* Add new external_libs/ to python setup

* Try fast_double_parser fix #1

Testing commit e09e5aad828bcb16bea7ed0ed8322e019112fdbe

If it works it should fix more LGBM builds

* CMake: Attempt to link fmt without explicit PUBLIC tag

* Exclude external_libs from linting

* Add exernal_libs to MANIFEST.in

* Set dynamic linking option for fmt.

* linting issues

* Try to fix lint includes

* Try to pass fPIC with static fmt lib

* Try CMake P_I_C option with fmt library

* [R-package] Add CMake support for R and CRAN

* Cleanup CMakeLists

* Try fmt hack to remove stdout

* Switch to header-only mode

* Add PRIVATE argument to target_link_libraries

* use fmt in header-only mode

* Remove CMakeLists comment

* Change OpenMP to PUBLIC linking in Mac

* Update fmt submodule to 7.1.2

* Use fmt in header-only-mode

* Remove fmt from CMakeLists.txt

* Upgrade fast_double_parser to v0.2.0

* Revert "Add PRIVATE argument to target_link_libraries"

This reverts commit 3dd45dde7b92531b2530ab54522bb843c56227a7.

* Address James Lamb's comments

* Update R-package/.Rbuildignore

Co-authored-by: James Lamb <jaylamb20@gmail.com>

* Upgrade to fast_double_parser v0.3.0 - Solaris support

* Use legacy code only in Solaris

* Fix lint issues

* Fix comment

* Address StrikerRUS's comments (solaris ifdef).

* Change header guards

Co-authored-by: James Lamb <jaylamb20@gmail.com>
2020-12-08 21:36:24 +08:00
James Lamb 1b8cf2d2dc
[R-package] Use command-line args to customize CMake builds (fixes #2441) (#3574)
* [R-package] Use command-line args to customize CMake builds (fixes #2441)

* Apply suggestions from code review

Co-authored-by: Nikita Titov <nekit94-08@mail.ru>

Co-authored-by: Nikita Titov <nekit94-08@mail.ru>
2020-11-29 18:29:20 +03:00
James Lamb 199fb23663
[R-package] fix install warning (#3552) 2020-11-10 09:51:46 -06:00
James Lamb 5538eb8d81
[R-package] [ci] Reduce manual effort for version updates (#3335)
* [R-package] [ci] Reduce manual effort for version updates

* fix configure

* remove useless comment

* Update build_r.R

Co-authored-by: Guolin Ke <guolin.ke@outlook.com>

* fix recreate-configure check in CI

Co-authored-by: Guolin Ke <guolin.ke@outlook.com>
2020-08-25 14:36:37 -05:00
James Lamb 7be57d77f5
[ci][R-package][python] suppress warning about empty 'compute' director, fix Rtools installation and temporary pin Sphinx version (#3277)
* [R-package] suppress warning about empty 'compute' directory

* get more logs from Rtools install

* empty commit

* add a timeout

* trying Invoke-WebRequest instead

* switch to CRAN link

* do not use Start-Process

* relative paths

* trying suppressmessageboxes

* switch strategy for running Rtools

* Update requirements_rtd.txt

* Update requirements_base.txt

Co-authored-by: Nikita Titov <nekit94-08@mail.ru>
2020-08-10 02:44:38 +03:00
James Lamb aa933eb427
[R-package] make package installable with CRAN toolchain (fixes #2960) (#3188)
* [R-package] make package installable with CRAN toolchain (fixes #2960)

* Apply suggestions from code review

Co-authored-by: Nikita Titov <nekit94-08@mail.ru>

* remove GPU stuff

* use wildcard to find objects to build

* use -lomp

* build configure before moving files

* using wildcard for objects

* Update .github/workflows/main.yml

Co-authored-by: Nikita Titov <nekit94-08@mail.ru>

* add explicit objects back

* reduce allowed R CMD check NOTEs and catch stderr from build-cran-package on Windows

* fixing things

* pin autoconf version

* show diff

* add automake back

* run less checks

* command was in the wrong place

* fix autoconf version

* change strategy for handling configure

* fix Rbuildignore

* fix NOTEs

* fix notes about unrecognized files

* fixing extra files

* remove USE_R35

* add OpenMP check for Mac CRAN build

* run all checks

* Apply suggestions from code review

Co-authored-by: Nikita Titov <nekit94-08@mail.ru>

* suggestions from code review

* undo indenting

* remove 03 from Makevars.win.in

* update language about OpenMP in configure script

* checking if configure.ac check works

* add autoconf back

* remove testing code in configure.ac

* more fixes for CI on configure script

* print git diff

* add VERSION.txt when checking configure

* fix relative paths

* remove git diff

Co-authored-by: Nikita Titov <nekit94-08@mail.ru>
2020-07-28 21:05:59 -05:00
James Lamb e83042f206
[R-package] Add support for R 4.0 (fixes #3064, fixes #3024) (#3065)
* [R-package] replaced gendef.exe with R code to create R.def (fixes #3064)

* fix broken things

* trying to add R4.0 docs

* changed make

* fixing make paths

* update notes on environment variables

* fix linting

* fixes to CI

* fixing build_cmd and other stuff

* fix bad substitution

* fix Azure Linux builds

* I am bad at bash

* simplifying

* only testing R

* getting better logs

* mingw32

* docs

* toolchain

* using msys

* fix visual studio condition

* toolchain test

* full CI

* fix if-elses

* bump allowed NOTEs

* search for Rscript

* updates to docs

* use processx

* fix mismatched arguments

* move CI to GitHub Actions

* minor changes

* fix workflow file

* fix templating

* fix Azure DevOps

* debugging windows builds

* dont shQuote file name

* all GitHub Actions jobs

* Apply suggestions from code review

Co-authored-by: Nikita Titov <nekit94-08@mail.ru>

* minor cleanup

* remove objdump printing

* make file.remove() invisible

* Apply suggestions from code review

Co-authored-by: Nikita Titov <nekit94-08@mail.ru>

* reduce duplicated paths in docs

Co-authored-by: Nikita Titov <nekit94-08@mail.ru>
2020-06-14 08:56:34 +08:00
James Lamb 4d43e96bbc
[R-package] move R source files into R-package, reduce duplication in build_r.R (#3087)
* [R-package] move R source files into R-package

* fix linting warning

* stuff
2020-05-24 21:23:38 -05:00
James Lamb 9085f4e23a
[R-package] [docs] remove devtools dependency for docs builds (fixes #3036) (#3072)
* [R-package] [docs] remove devtools dependency for docs builds

* linting

* updating docs conda env

* empty roxygenize()

* env for R libraries

* get logs

* remove comment

* added pkgdown URLs

* more paths

* fix incorrect YAML keys

* update DESCRIPTION URL link

* more URL changes

* revert DESCRIPTION changes

* remove ca-certificates

* empty commit

* Update docs/conf.py

Co-authored-by: Nikita Titov <nekit94-08@mail.ru>

* empty commit

* remove outdated line in build_r.R

Co-authored-by: Nikita Titov <nekit94-08@mail.ru>
2020-05-14 21:14:34 +03:00
James Lamb 3caf359a79
[R-package] speed up installation with Visual Studio (#2965)
* fix conflicts

* Update R-package/src/install.libs.R

* empty commit
2020-05-14 19:31:13 +03:00
James Lamb dbc3d05c9c
[R-package] [ci] Add option to skip installation in build_r.R (#2957)
Co-authored-by: Nikita Titov <nekit94-08@mail.ru>
2020-03-30 23:01:29 -05:00
James Lamb 86ca484508
[R-package][ci] added CI stage for R package (fixes #2335, fixes #2569) (#2530) 2019-12-15 12:01:01 -06:00
James Lamb 1f7b06b983 [R-package][ci] Added more R linters (fixes #2477) (#2533)
* Added more linters on R code

* started working on implicit integers

* finished style changes to handle implicit integers

* regenned documentation and added concatenation linter

* changed channel for r-lintr

* try building stringi before lintr

* trying to get libicui18n

* trying another thing

* trying conda-forge again

* added re-install of stringi

* uncommented other stages

* Update .ci/test.sh

Co-Authored-By: Nikita Titov <nekit94-08@mail.ru>

* removed apt update and changed lintr version floor

* get lintr from CRAN

* R needs to come before C++ linting

* testing lintr install from CRAN

* trying one more thing

* more verbose

* order might matter

* removed commented code

* cleaned up linting block in test.sh

* grouped conda install calls and fixed a few integer array things
2019-11-17 00:12:38 +03:00
Nikita Titov faba6cafb7
[docs][R] added R-package docs generation routines (#2176)
* added R-package docs generation routines

* change theme to be more consistent with sphinx_rtd_theme on main site in terms of color scheme

* placed man folder with old Rd files back

* specify full path to conda and make script more readable by one line - one pkg

* removed commented lines from build_r_site script

* made one line - one argument in build_reference() call

* pin R package versions

* fixed conflict
2019-09-01 19:47:04 +03:00
James Lamb c0883f174c
Fixed keep-empty-dirs flag in build_r.R (fixes #2332) (#2333) 2019-08-18 21:20:02 -05:00
James Lamb 1c27a15e42 removed external dependenciesin build_r.R (fixes #2122) (#2123) 2019-05-08 10:57:01 +02:00
Gao Tao fb28070e1d Update build_r.R (#1918)
add boost header files compute/ into build_r.R to enable GPU compilation
2018-12-23 23:05:29 -06:00
Laurae eb06c74bc9 Does not need to fix doc. Fixes #1852 (#1868) 2018-11-23 17:24:42 -06:00
Khoa Nguyen 87c39dec83 Multiarch cmd flag in build_r.R (#1704) 2018-09-30 12:03:13 -05:00
Zach Kurtz 09e651f3b9 Enforce R-package dependencies in build_r.R before compilation begins (#1672)
* Enforce R-package dependencies in build_r.R before compilation begins

* Greatly simplify the previous commit
2018-09-23 10:49:44 -05:00
Laurae 2a39b70acb [R-package] Fix build_r.R failing in Windows (#1694)
* Fix #1693

* Fix spacing

* Fr -> For

* Recursive causes error on strict R environments
2018-09-23 10:48:49 -05:00
Nikita Titov 677716d3f6 [docs] updated comment about gcc in build R script 2018-09-02 10:30:30 +09:00
James Lamb eded794efb [R-package] CRAN fixes (#1499)
* Fixed typos in docs

* Fixed inconsistencies in documentation

* Updated strategy for registering routines

* Fixed issues caused by smashing multiple functions into one Rd

* Fixed issues with documentation

* Removed VignetteBuilder and updated Rbuildignore

* Added R build artefacts to gitignore

* Added namespacing on data.table set function. Updated handling of CMakeLists file to get around CRAN check.

* Updated build instructions

* Added R build script

* Removed build_r.sh script and updated R-package install instructions
2018-08-29 13:31:42 +09:00