Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream updates + data set merging + cost effective gradient boosting #2

Merged
merged 69 commits into from
Feb 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
843c838
[ci] removed temp brew hotfix and deprecated sudo option (#1951)
StrikerRUS Jan 17, 2019
99f8e3e
updated Boost docs (#1955)
StrikerRUS Jan 18, 2019
e220f8a
removed warnings about types in comparison ([-Wsign-compare]) (#1953)
StrikerRUS Jan 18, 2019
e6a32c8
[docs] ask to provide LightGBM version for issue (#1958)
StrikerRUS Jan 18, 2019
ace9c99
[R] Fix multiclass demo (#1940)
maximilianeber Jan 19, 2019
d169ac8
[R] Correcting lgb.prepare output comment (#1831)
dah33 Jan 20, 2019
e665dfd
[docs] bump xcode version in docs (#1952)
StrikerRUS Jan 20, 2019
48a4c8a
fix typo
guolinke Jan 20, 2019
e7aba20
[docs] Added the links to the libraries used (#1962)
StrikerRUS Jan 21, 2019
f308096
[docs] fixed minor typos in documentation (#1959)
jameslamb Jan 22, 2019
b37065d
support to override some parameters in Dataset (#1876)
guolinke Jan 23, 2019
b968499
Fix build on macOS Mojave (#1923)
henry0312 Jan 26, 2019
f9a1465
[tests][python] added tests for metrics' behavior and fixed case for …
StrikerRUS Jan 27, 2019
c306c7b
[python][R][docs] added possibility to install with Visual Studio 201…
StrikerRUS Jan 27, 2019
b7e772b
Found error from #1939 (#1974)
Laurae2 Jan 28, 2019
a2f5c50
fix more edge cases in mape (#1977)
guolinke Jan 29, 2019
5c39984
fix R's overflow (#1960)
guolinke Jan 30, 2019
fe77eac
[tests][python] added test for huge string model (#1964)
StrikerRUS Jan 30, 2019
feeaf38
fix nan in eval results (#1973)
guolinke Jan 30, 2019
5530f28
fix #1981
guolinke Jan 31, 2019
40486b6
[python] added OpenMP options for python-package installation (#1975)
StrikerRUS Feb 2, 2019
861de1c
improved model loading routines (#1979)
StrikerRUS Feb 2, 2019
6f548ad
[ci] refined command status check (#1980)
StrikerRUS Feb 2, 2019
90127b5
cpplint whitespaces and new lines (#1986)
StrikerRUS Feb 2, 2019
b7a61c3
fix #1994
guolinke Feb 3, 2019
107b50b
[docs] Fixed OpenCL Debian package name typo (#1995)
washcycle Feb 3, 2019
2c9d332
[python] convert datatable to numpy directly (#1970)
guolinke Feb 4, 2019
62bae24
[R-package] Fix demos not using lgb.Dataset.create.valid (#1993)
Laurae2 Feb 4, 2019
0d0e793
2.2.3 release (#1987)
guolinke Feb 5, 2019
8e286b3
update version number at master branch (#1996)
guolinke Feb 5, 2019
9fe4934
Initial attempt to implement appending features in-memory to another …
Feb 6, 2019
f1b0576
Implement Dataset.dump_text, and fix small bug in appending of group …
Feb 6, 2019
7fb10a8
Add basic tests for validation logic for add_features_from.
Feb 6, 2019
3ebea80
Remove various internal mapping items from dataset text dumps
Feb 6, 2019
530edff
Add test that add_features_from results in identical data sets accord…
Feb 6, 2019
97705a8
Add test that booster behaviour after using add_features_from matches…
Feb 6, 2019
777356b
Expose feature_penalty and monotone_types/constraints via get_field
Feb 6, 2019
ecd6ace
Add tests that add_features correctly handles feature_penalty and mon…
Feb 6, 2019
4b47007
Ensure add_features_from properly frees the added dataset and add uni…
Feb 6, 2019
88b0440
Remove some obsolete TODOs
Feb 6, 2019
b868d36
Tidy up DumpTextFile by using a single iterator for each feature
Feb 6, 2019
5ad2760
Factor out offsetting logic in AddFeaturesFrom
Feb 6, 2019
b08498e
Remove obsolete TODO
Feb 6, 2019
dcd8ef3
Remove another TODO
Feb 6, 2019
2c19ba9
Add documentation for newly-added methods.
Feb 6, 2019
546655a
Initial work towards add_data_from
Feb 8, 2019
0b214ea
Fix bug where dense bin copy of num_data_ wasn't updated
Feb 8, 2019
29b0e13
Small bug fix in dense_bin.hpp, initial implementation of Merge for 4…
Feb 8, 2019
f3cc1b5
Add unit test for dense bin case of add_data_from, and refactor tests…
Feb 8, 2019
aaeb3d8
Initial implementation of Merge for sparse bins and unit tests for it.
Feb 8, 2019
ca126d5
Ensure we test merging sparse data sets after loading them from binary
Feb 8, 2019
1e9a78c
Add labels to text dumps.
Feb 8, 2019
acd2c3a
Add weights to text dumps.
Feb 8, 2019
7644d4d
Ensure add_data_from properly merges labels.
Feb 8, 2019
0de4af6
Ensure metadata appends weights correctly, and unit test for it.
Feb 8, 2019
9cffada
Implement metadata merging for query bits
Feb 8, 2019
d7c8f90
Check datasets are aligned before merging.
Feb 8, 2019
aac74f0
Add test that booster behaviour is preserved by add_data_from.
Feb 8, 2019
f29ff01
Add configuration parameters for CEGB.
Feb 12, 2019
3b6a3d0
Add skeleton CEGB tree learner
Feb 12, 2019
e62ab37
Track features used in CEGB tree learner.
Feb 12, 2019
1867d8f
Pull CEGB tradeoff and coupled feature penalty from config.
Feb 12, 2019
70f926a
Implement finding best splits for CEGB
Feb 12, 2019
914e6d5
Set proper defaults for cegb parameters.
Feb 12, 2019
1ab55c4
Ensure sanity checks don't switch off CEGB.
Feb 12, 2019
03e58f1
Implement per-data-point feature penalties in CEGB.
Feb 12, 2019
aa47dc2
Implement split penalty and remove unused parameters.
Feb 12, 2019
7008d6f
Merge changes from CEGB tree learner into serial tree learner
Feb 12, 2019
04bf9a6
Represent features_used_in_data by a bitset, to reduce the memory ove…
Feb 12, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 2.2.3.{build}
version: 2.2.4.{build}

image: Visual Studio 2015
platform: x64
Expand Down Expand Up @@ -30,7 +30,7 @@ install:
- ps: $env:LGB_VER = (Get-Content VERSION.txt).trim()
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda create -q -n test-env python=%PYTHON_VERSION% matplotlib nose numpy pandas pytest python-graphviz scikit-learn scipy
- conda create -q -n test-env python=%PYTHON_VERSION% matplotlib nose numpy pandas psutil pytest python-graphviz scikit-learn scipy
- activate test-env

build_script:
Expand All @@ -48,8 +48,9 @@ test_script:
(Get-Content "plot_example.py").replace('graph.render(view=True)', 'graph.render(view=False)') | Set-Content "plot_example.py"
- ps: >-
foreach ($file in @(Get-ChildItem *.py)) {
@("import sys, warnings", "warnings.showwarning = lambda message, category, filename, lineno, file=None, line=None: sys.stdout.write(warnings.formatwarning(message, category, filename, lineno, line))") + (Get-Content $file) | Set-Content $file
python $file
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
if (!$?) { $host.SetShouldExit(-1) }
} # run all examples
- cd %APPVEYOR_BUILD_FOLDER%\examples\python-guide\notebooks
- conda install -y -n test-env ipywidgets notebook
Expand Down
2 changes: 1 addition & 1 deletion .ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ if [[ $TASK == "if-else" ]]; then
exit 0
fi

conda install -q -y -n $CONDA_ENV matplotlib nose numpy pandas pytest python-graphviz scikit-learn scipy
conda install -q -y -n $CONDA_ENV matplotlib nose numpy pandas psutil pytest python-graphviz scikit-learn scipy

if [[ $OS_NAME == "macos" ]] && [[ $COMPILER == "clang" ]]; then
sudo ln -sf `ls -d "$(brew --cellar libomp)"/*/lib`/* $CONDA_PREFIX/lib || exit -1 # fix "OMP: Error #15: Initializing libiomp5.dylib, but found libomp.dylib already initialized." (OpenMP library conflict due to conda's MKL)
Expand Down
25 changes: 13 additions & 12 deletions .ci/test_windows.ps1
Original file line number Diff line number Diff line change
@@ -1,42 +1,43 @@
function Check-Output {
param( [int]$ExitCode )
if ($ExitCode -ne 0) {
$host.SetShouldExit($ExitCode)
param( [bool]$success )
if (!$success) {
$host.SetShouldExit(-1)
Exit -1
}
}

if ($env:TASK -eq "regular") {
mkdir $env:BUILD_SOURCESDIRECTORY/build; cd $env:BUILD_SOURCESDIRECTORY/build
cmake -DCMAKE_GENERATOR_PLATFORM=x64 .. ; cmake --build . --target ALL_BUILD --config Release ; Check-Output $LastExitCode
cmake -DCMAKE_GENERATOR_PLATFORM=x64 .. ; cmake --build . --target ALL_BUILD --config Release ; Check-Output $?
cd $env:BUILD_SOURCESDIRECTORY/python-package
python setup.py install --precompile ; Check-Output $LastExitCode
python setup.py install --precompile ; Check-Output $?
cp $env:BUILD_SOURCESDIRECTORY/Release/lib_lightgbm.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY
cp $env:BUILD_SOURCESDIRECTORY/Release/lightgbm.exe $env:BUILD_ARTIFACTSTAGINGDIRECTORY
}
elseif ($env:TASK -eq "sdist") {
cd $env:BUILD_SOURCESDIRECTORY/python-package
python setup.py sdist --formats gztar ; Check-Output $LastExitCode
cd dist; pip install @(Get-ChildItem *.gz) -v ; Check-Output $LastExitCode
python setup.py sdist --formats gztar ; Check-Output $?
cd dist; pip install @(Get-ChildItem *.gz) -v ; Check-Output $?
}
elseif ($env:TASK -eq "bdist") {
cd $env:BUILD_SOURCESDIRECTORY/python-package
python setup.py bdist_wheel --plat-name=win-amd64 --universal ; Check-Output $LastExitCode
cd dist; pip install @(Get-ChildItem *.whl) ; Check-Output $LastExitCode
python setup.py bdist_wheel --plat-name=win-amd64 --universal ; Check-Output $?
cd dist; pip install @(Get-ChildItem *.whl) ; Check-Output $?
cp @(Get-ChildItem *.whl) $env:BUILD_ARTIFACTSTAGINGDIRECTORY
}

$tests = $env:BUILD_SOURCESDIRECTORY + $(If ($env:TASK -eq "sdist") {"/tests/python_package_test"} Else {"/tests"}) # cannot test C API with "sdist" task
pytest $tests ; Check-Output $LastExitCode
pytest $tests ; Check-Output $?

if ($env:TASK -eq "regular") {
cd $env:BUILD_SOURCESDIRECTORY/examples/python-guide
@("import matplotlib", "matplotlib.use('Agg')") + (Get-Content "plot_example.py") | Set-Content "plot_example.py"
(Get-Content "plot_example.py").replace('graph.render(view=True)', 'graph.render(view=False)') | Set-Content "plot_example.py"
foreach ($file in @(Get-ChildItem *.py)) {
python $file ; Check-Output $LastExitCode
@("import sys, warnings", "warnings.showwarning = lambda message, category, filename, lineno, file=None, line=None: sys.stdout.write(warnings.formatwarning(message, category, filename, lineno, line))") + (Get-Content $file) | Set-Content $file
python $file ; Check-Output $?
} # run all examples
cd $env:BUILD_SOURCESDIRECTORY/examples/python-guide/notebooks
conda install -y -n $env:CONDA_ENV ipywidgets notebook
jupyter nbconvert --ExecutePreprocessor.timeout=180 --to notebook --execute --inplace *.ipynb ; Check-Output $LastExitCode # run all notebooks
jupyter nbconvert --ExecutePreprocessor.timeout=180 --to notebook --execute --inplace *.ipynb ; Check-Output $? # run all notebooks
}
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ CPU/GPU model:

C++/Python/R version:

LightGBM version or commit hash:

## Error message

<!-- Paste error log here -->
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -390,3 +390,6 @@ R-package/src/src/
lightgbm_r/*
lightgbm*.tar.gz
lightgbm.Rcheck/

# Files generated by aspell
**/*.bak
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
language: cpp
sudo: required
dist: trusty

git:
Expand Down Expand Up @@ -38,7 +37,6 @@ matrix:
before_install:
- test -n $CC && unset CC
- test -n $CXX && unset CXX
- export HOMEBREW_LOGS="$HOME/brew_logs" # brew hotfix
- export HOME_DIRECTORY="$HOME"
- export BUILD_DIRECTORY="$TRAVIS_BUILD_DIR"
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then
Expand Down
3 changes: 1 addition & 2 deletions .vsts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ jobs:
inputs:
updateConda: false
- script: |
echo "##vso[task.setvariable variable=HOMEBREW_LOGS]$AGENT_HOMEDIRECTORY/brew_logs"
echo "##vso[task.setvariable variable=HOME_DIRECTORY]$AGENT_HOMEDIRECTORY"
echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY"
echo "##vso[task.setvariable variable=OS_NAME]macos"
Expand Down Expand Up @@ -147,7 +146,7 @@ jobs:
createCustomEnvironment: true
updateConda: true
environmentName: $(CONDA_ENV)
packageSpecs: 'python=$(PYTHON_VERSION) matplotlib nose numpy pandas pytest python-graphviz scikit-learn scipy'
packageSpecs: 'python=$(PYTHON_VERSION) matplotlib nose numpy pandas psutil pytest python-graphviz scikit-learn scipy'
createOptions: '-q'
- powershell: $(Build.SourcesDirectory)/.ci/test_windows.ps1
displayName: Test
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ endif(USE_MPI)

if(USE_OPENMP)
if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
TARGET_LINK_LIBRARIES(lightgbm ${OpenMP_libomp_LIBRARY})
TARGET_LINK_LIBRARIES(_lightgbm ${OpenMP_libomp_LIBRARY})
TARGET_LINK_LIBRARIES(lightgbm OpenMP::OpenMP_CXX)
TARGET_LINK_LIBRARIES(_lightgbm OpenMP::OpenMP_CXX)
endif()
endif(USE_OPENMP)

Expand Down
4 changes: 2 additions & 2 deletions R-package/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: lightgbm
Type: Package
Title: Light Gradient Boosting Machine
Version: 2.2.3
Date: 2018-11-6
Version: 2.2.4
Date: 2019-02-05
Authors@R: c(
person("Guolin", "Ke", email = "[email protected]", role = c("aut", "cre")),
person("Damien", "Soukhavong", email = "[email protected]", role = c("ctb")),
Expand Down
4 changes: 4 additions & 0 deletions R-package/R/lgb.Dataset.R
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,10 @@ Dataset <- R6::R6Class(
update_params = function(params) {

# Parameter updating
if (!lgb.is.null.handle(private$handle)) {
lgb.call("LGBM_DatasetUpdateParam_R", ret = NULL, private$handle, lgb.params2str(params))
return(invisible(self))
}
private$params <- modifyList(private$params, params)
return(invisible(self))

Expand Down
2 changes: 1 addition & 1 deletion R-package/demo/basic_walkthrough.R
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ print(paste("sum(abs(pred2-pred))=", sum(abs(pred2 - pred))))
#--------------------Advanced features ---------------------------
# To use advanced features, we need to put data in lgb.Dataset
dtrain <- lgb.Dataset(data = train$data, label = train$label, free_raw_data = FALSE)
dtest <- lgb.Dataset(data = test$data, label = test$label, free_raw_data = FALSE)
dtest <- lgb.Dataset.create.valid(dtrain, data = test$data, label = test$label)

#--------------------Using validation set-------------------------
# valids is a list of lgb.Dataset, each of them is tagged with name
Expand Down
2 changes: 1 addition & 1 deletion R-package/demo/boost_from_prediction.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ require(methods)
data(agaricus.train, package = "lightgbm")
data(agaricus.test, package = "lightgbm")
dtrain <- lgb.Dataset(agaricus.train$data, label = agaricus.train$label)
dtest <- lgb.Dataset(agaricus.test$data, label = agaricus.test$label)
dtest <- lgb.Dataset.create.valid(dtrain, data = agaricus.test$data, label = agaricus.test$label)

valids <- list(eval = dtest, train = dtrain)
#--------------------Advanced features ---------------------------
Expand Down
22 changes: 11 additions & 11 deletions R-package/demo/categorical_features_prepare.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,24 @@ str(bank)
# For this task, we use lgb.prepare
# The function transforms the data into a fittable data
#
# Classes 'data.table' and 'data.frame': 4521 obs. of 17 variables:
# Classes data.table and 'data.frame': 4521 obs. of 17 variables:
# $ age : int 30 33 35 30 59 35 36 39 41 43 ...
# $ job : chr "unemployed" "services" "management" "management" ...
# $ marital : chr "married" "married" "single" "married" ...
# $ education: chr "primary" "secondary" "tertiary" "tertiary" ...
# $ default : chr "no" "no" "no" "no" ...
# $ job : num 11 8 5 5 2 5 7 10 3 8 ...
# $ marital : num 2 2 3 2 2 3 2 2 2 2 ...
# $ education: num 1 2 3 3 2 3 3 2 3 1 ...
# $ default : num 1 1 1 1 1 1 1 1 1 1 ...
# $ balance : int 1787 4789 1350 1476 0 747 307 147 221 -88 ...
# $ housing : chr "no" "yes" "yes" "yes" ...
# $ loan : chr "no" "yes" "no" "yes" ...
# $ contact : chr "cellular" "cellular" "cellular" "unknown" ...
# $ housing : num 1 2 2 2 2 1 2 2 2 2 ...
# $ loan : num 1 2 1 2 1 1 1 1 1 2 ...
# $ contact : num 1 1 1 3 3 1 1 1 3 1 ...
# $ day : int 19 11 16 3 5 23 14 6 14 17 ...
# $ month : chr "oct" "may" "apr" "jun" ...
# $ month : num 11 9 1 7 9 4 9 9 9 1 ...
# $ duration : int 79 220 185 199 226 141 341 151 57 313 ...
# $ campaign : int 1 1 1 4 1 2 1 2 2 1 ...
# $ pdays : int -1 339 330 -1 -1 176 330 -1 -1 147 ...
# $ previous : int 0 4 1 0 0 3 2 0 0 2 ...
# $ poutcome : chr "unknown" "failure" "failure" "unknown" ...
# $ y : chr "no" "no" "no" "no" ...
# $ poutcome : num 4 1 1 4 4 1 2 4 4 1 ...
# $ y : num 1 1 1 1 1 1 1 1 1 1 ...
bank <- lgb.prepare(data = bank)
str(bank)

Expand Down
5 changes: 3 additions & 2 deletions R-package/demo/categorical_features_rules.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ my_data_test <- as.matrix(bank_test[, 1:16, with = FALSE])
# The categorical features can be passed to lgb.train to not copy and paste a lot
dtrain <- lgb.Dataset(data = my_data_train,
label = bank_train$y)
dtest <- lgb.Dataset(data = my_data_test,
label = bank_test$y)
dtest <- lgb.Dataset.create.valid(dtrain,
data = my_data_test,
label = bank_test$y)

# We can now train a model
model <- lgb.train(list(objective = "binary",
Expand Down
2 changes: 1 addition & 1 deletion R-package/demo/cross_validation.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require(lightgbm)
data(agaricus.train, package = "lightgbm")
data(agaricus.test, package = "lightgbm")
dtrain <- lgb.Dataset(agaricus.train$data, label = agaricus.train$label)
dtest <- lgb.Dataset(agaricus.test$data, label = agaricus.test$label)
dtest <- lgb.Dataset.create.valid(dtrain, data = agaricus.test$data, label = agaricus.test$label)

nrounds <- 2
param <- list(num_leaves = 4,
Expand Down
2 changes: 1 addition & 1 deletion R-package/demo/early_stopping.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ data(agaricus.train, package = "lightgbm")
data(agaricus.test, package = "lightgbm")

dtrain <- lgb.Dataset(agaricus.train$data, label = agaricus.train$label)
dtest <- lgb.Dataset(agaricus.test$data, label = agaricus.test$label)
dtest <- lgb.Dataset.create.valid(dtrain, data = agaricus.test$data, label = agaricus.test$label)

# Note: for customized objective function, we leave objective as default
# Note: what we are getting is margin value in prediction
Expand Down
21 changes: 13 additions & 8 deletions R-package/demo/multiclass_custom_objective.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,21 @@ data(iris)
# For instance: 0, 1, 2, 3, 4, 5...
iris$Species <- as.numeric(as.factor(iris$Species)) - 1

# We cut the data set into 80% train and 20% validation
# Create imbalanced training data (20, 30, 40 examples for classes 0, 1, 2)
train <- as.matrix(iris[c(1:20, 51:80, 101:140), ])
# The 10 last samples of each class are for validation

train <- as.matrix(iris[c(1:40, 51:90, 101:140), ])
test <- as.matrix(iris[c(41:50, 91:100, 141:150), ])

dtrain <- lgb.Dataset(data = train[, 1:4], label = train[, 5])
dtest <- lgb.Dataset.create.valid(dtrain, data = test[, 1:4], label = test[, 5])
valids <- list(test = dtest)
valids <- list(train = dtrain, test = dtest)

# Method 1 of training with built-in multiclass objective
# Note: need to turn off boost from average to match custom objective
# (https://github.com/Microsoft/LightGBM/issues/1846)
model_builtin <- lgb.train(list(),
dtrain,
boost_from_average = FALSE,
100,
valids,
min_data = 1,
Expand All @@ -29,7 +32,8 @@ model_builtin <- lgb.train(list(),
metric = "multi_logloss",
num_class = 3)

preds_builtin <- predict(model_builtin, test[, 1:4], rawscore = TRUE)
preds_builtin <- predict(model_builtin, test[, 1:4], rawscore = TRUE, reshape = TRUE)
probs_builtin <- exp(preds_builtin) / rowSums(exp(preds_builtin))

# Method 2 of training with custom objective function

Expand Down Expand Up @@ -64,7 +68,6 @@ custom_multiclass_metric = function(preds, dtrain) {
return(list(name = "error",
value = -mean(log(prob[cbind(1:length(labels), labels + 1)])),
higher_better = FALSE))

}

model_custom <- lgb.train(list(),
Expand All @@ -78,8 +81,10 @@ model_custom <- lgb.train(list(),
eval = custom_multiclass_metric,
num_class = 3)

preds_custom <- predict(model_custom, test[, 1:4], rawscore = TRUE)
preds_custom <- predict(model_custom, test[, 1:4], rawscore = TRUE, reshape = TRUE)
probs_custom <- exp(preds_custom) / rowSums(exp(preds_custom))

# compare predictions
identical(preds_builtin, preds_custom)
stopifnot(identical(probs_builtin, probs_custom))
stopifnot(identical(preds_builtin, preds_custom))

3 changes: 2 additions & 1 deletion R-package/man/lgb.Dataset.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions R-package/man/lgb.cv.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions R-package/man/lgb.train.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion R-package/src/install.libs.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ if (!use_precompile) {
} else {
try_vs <- 0
local_vs_def <- ""
vs_versions <- c("Visual Studio 15 2017 Win64", "Visual Studio 14 2015 Win64")
vs_versions <- c("Visual Studio 15 2017 Win64", "Visual Studio 14 2015 Win64", "Visual Studio 16 2019")
for(vs in vs_versions){
vs_def <- paste0(" -G \"", vs, "\"")
tmp_cmake_cmd <- paste0(cmake_cmd, vs_def)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,4 @@ Huan Zhang, Si Si and Cho-Jui Hsieh. "[GPU Acceleration for Large-scale Tree Boo
License
-------

This project is licensed under the terms of the MIT license. See [LICENSE](https://github.com/Microsoft/LightGBM/blob/master/LICENSE) for addtional details.
This project is licensed under the terms of the MIT license. See [LICENSE](https://github.com/Microsoft/LightGBM/blob/master/LICENSE) for additional details.
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.3
2.2.4
2 changes: 1 addition & 1 deletion docs/Development-Guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Refer to `docs README <./README.rst>`__.
C API
-----

Refere to the comments in `c\_api.h <https://github.com/Microsoft/LightGBM/blob/master/include/LightGBM/c_api.h>`__.
Refer to the comments in `c\_api.h <https://github.com/Microsoft/LightGBM/blob/master/include/LightGBM/c_api.h>`__.

High Level Language Package
---------------------------
Expand Down
Loading