[FIX] fix plugin system

This commit is contained in:
tqchen
2016-01-12 17:54:09 -08:00
parent 96f4542a67
commit 31d8e93ef3
6 changed files with 11 additions and 11 deletions

View File

@@ -8,7 +8,7 @@ To include a certain plugin, say ```plugin_a```, you only need to add the follow
```makefile
# Add plugin by include the plugin in config
include plugin/plugin_a/plugin.mk
XGB_PLUGINS += plugin/plugin_a/plugin.mk
```
Then rebuild libxgboost by typing make, you can get a new library with the plugin enabled.

View File

@@ -12,7 +12,7 @@ There are three steps you need to to do to add plugin to xgboost
To add this plugin, add the following line to ```config.mk```(template in make/config.mk).
```makefile
# Add plugin by include the plugin in config
include plugin/example/plugin.mk
XGB_PLUGINS += plugin/plugin_a/plugin.mk
```
Then you can test this plugin by using ```objective=mylogistic``` parameter.

View File

@@ -104,7 +104,8 @@ inline void CompressArray<DType>::InitCompressChunks(size_t chunk_size, size_t m
chunk_size = std::max(min_chunk_size, chunk_size);
size_t nstep = data.size() / chunk_size;
for (size_t i = 0; i < nstep; ++i) {
raw_chunks_.push_back(raw_chunks_.back() + chunk_size * i);
raw_chunks_.push_back(raw_chunks_.back() + chunk_size);
CHECK_LE(raw_chunks_.back(), data.size());
}
if (nstep == 0) raw_chunks_.push_back(0);
raw_chunks_.back() = data.size();