Alien-XGBoost
view release on metacpan or search on metacpan
xgboost/R-package/tests/testthat/test_helpers.R view on Meta::CPAN
imp2plot <- xgb.plot.importance(importance.GLM)
expect_equal(colnames(imp2plot), c("Feature", "Weight", "Importance"))
xgb.ggplot.importance(importance.GLM)
# for multiclass
imp.GLM <- xgb.importance(model = mbst.GLM)
expect_equal(dim(imp.GLM), c(12, 3))
expect_equal(imp.GLM$Class, rep(0:2, each=4))
})
test_that("xgb.model.dt.tree and xgb.importance work with a single split model", {
bst1 <- xgboost(data = sparse_matrix, label = label, max_depth = 1,
eta = 1, nthread = 2, nrounds = 1, verbose = 0,
objective = "binary:logistic")
expect_error(dt <- xgb.model.dt.tree(model = bst1), regexp = NA) # no error
expect_equal(nrow(dt), 3)
expect_error(imp <- xgb.importance(model = bst1), regexp = NA) # no error
expect_equal(nrow(imp), 1)
expect_equal(imp$Gain, 1)
})
xgboost/dmlc-core/src/io/input_split_base.h view on Meta::CPAN
: fs_(NULL),
align_bytes_(8),
tmp_chunk_(kBufferSize),
buffer_size_(kBufferSize) {}
/*!
* \brief intialize the base before doing anything
* \param fs the filesystem ptr
* \param uri the uri of the files
* \param rank the rank of the split
* \param nsplit number of splits
* \param align_bytes the head split must be multiple of align_bytes
* this also checks if file size are multiple of align_bytes
*/
void Init(FileSystem *fs,
const char *uri,
size_t align_bytes);
// to be implemented by child class
/*!
* \brief seek to the beginning of the first record
* in current file pointer
* \return how many bytes we read past
xgboost/src/cli_main.cc view on Meta::CPAN
/*! \brief path of test dataset */
std::string test_path;
/*! \brief the path of test model file, or file to restart training */
std::string model_in;
/*! \brief the path of final model file, to be saved */
std::string model_out;
/*! \brief the path of directory containing the saved models */
std::string model_dir;
/*! \brief name of predict file */
std::string name_pred;
/*! \brief data split mode */
int dsplit;
/*!\brief limit number of trees in prediction */
int ntree_limit;
/*!\brief whether to directly output margin value */
bool pred_margin;
/*! \brief whether dump statistics along with model */
int dump_stats;
/*! \brief what format to dump the model in */
std::string dump_format;
/*! \brief name of feature map */
xgboost/src/cli_main.cc view on Meta::CPAN
DMLC_DECLARE_FIELD(model_out).set_default("NULL")
.describe("Output model path, if any.");
DMLC_DECLARE_FIELD(model_dir).set_default("./")
.describe("Output directory of period checkpoint.");
DMLC_DECLARE_FIELD(name_pred).set_default("pred.txt")
.describe("Name of the prediction file.");
DMLC_DECLARE_FIELD(dsplit).set_default(0)
.add_enum("auto", 0)
.add_enum("col", 1)
.add_enum("row", 2)
.describe("Data split mode.");
DMLC_DECLARE_FIELD(ntree_limit).set_default(0).set_lower_bound(0)
.describe("Number of trees used for prediction, 0 means use all trees.");
DMLC_DECLARE_FIELD(pred_margin).set_default(false)
.describe("Whether to predict margin value instead of probability.");
DMLC_DECLARE_FIELD(dump_stats).set_default(false)
.describe("Whether dump the model statistics.");
DMLC_DECLARE_FIELD(dump_format).set_default("text")
.describe("What format to dump the model in.");
DMLC_DECLARE_FIELD(name_fmap).set_default("NULL")
.describe("Name of the feature map file.");
xgboost/src/learner.cc view on Meta::CPAN
"Number of class option for multi-class classifier. "
" By default equals 0 and corresponds to binary classifier.");
}
};
struct LearnerTrainParam : public dmlc::Parameter<LearnerTrainParam> {
// stored random seed
int seed;
// whether seed the PRNG each iteration
bool seed_per_iteration;
// data split mode, can be row, col, or none.
int dsplit;
// tree construction method
int tree_method;
// internal test flag
std::string test_flag;
// maximum buffered row value
float prob_buffer_row;
// maximum row per batch.
size_t max_row_perbatch;
// number of threads to use if OpenMP is enabled
xgboost/src/learner.cc view on Meta::CPAN
.set_default(false)
.describe(
"Seed PRNG determnisticly via iterator number, "
"this option will be switched on automatically on distributed "
"mode.");
DMLC_DECLARE_FIELD(dsplit)
.set_default(0)
.add_enum("auto", 0)
.add_enum("col", 1)
.add_enum("row", 2)
.describe("Data split mode for distributed training.");
DMLC_DECLARE_FIELD(tree_method)
.set_default(0)
.add_enum("auto", 0)
.add_enum("approx", 1)
.add_enum("exact", 2)
.add_enum("hist", 3)
.add_enum("gpu_exact", 4)
.add_enum("gpu_hist", 5)
.describe("Choice of tree construction method.");
DMLC_DECLARE_FIELD(test_flag).set_default("").describe(
( run in 1.400 second using v1.01-cache-2.11-cpan-9bca49b1385 )