diff --git a/R-package/demo/boost_from_prediction.R b/R-package/demo/boost_from_prediction.R index 7372717f8..bbf45f4a0 100644 --- a/R-package/demo/boost_from_prediction.R +++ b/R-package/demo/boost_from_prediction.R @@ -11,7 +11,7 @@ watchlist <- list(eval = dtest, train = dtrain) # print('start running example to start from a initial prediction') # train xgboost for 1 round -param <- list(max_depth=2,eta=1,silent=1,objective='binary:logistic') +param <- list(max.depth=2,eta=1,silent=1,objective='binary:logistic') bst <- xgb.train( param, dtrain, 1, watchlist ) # Note: we need the margin value instead of transformed prediction in set_base_margin # do predict with output_margin=TRUE, will always give you margin values before logistic transformation diff --git a/R-package/demo/cross_validation.R b/R-package/demo/cross_validation.R index 7fa1f16b2..c7e7ba537 100644 --- a/R-package/demo/cross_validation.R +++ b/R-package/demo/cross_validation.R @@ -6,7 +6,7 @@ dtrain <- xgb.DMatrix(agaricus.train$data, label = agaricus.train$label) dtest <- xgb.DMatrix(agaricus.test$data, label = agaricus.test$label) nround <- 2 -param <- list(max_depth=2,eta=1,silent=1,objective='binary:logistic') +param <- list(max.depth=2,eta=1,silent=1,objective='binary:logistic') cat('running cross validation\n') # do cross validation, this will print result out as @@ -40,7 +40,7 @@ evalerror <- function(preds, dtrain) { return(list(metric = "error", value = err)) } -param <- list(max_depth=2,eta=1,silent=1) +param <- list(max.depth=2,eta=1,silent=1) # train with customized objective xgb.cv(param, dtrain, nround, nfold = 5, obj = logregobj, feval=evalerror) diff --git a/R-package/demo/custom_objective.R b/R-package/demo/custom_objective.R index 017961876..9b0d45465 100644 --- a/R-package/demo/custom_objective.R +++ b/R-package/demo/custom_objective.R @@ -8,7 +8,7 @@ dtest <- xgb.DMatrix(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 # you must know what you are doing -param <- list(max_depth=2,eta=1,silent=1) +param <- list(max.depth=2,eta=1,silent=1) watchlist <- list(eval = dtest, train = dtrain) num_round <- 2 diff --git a/R-package/demo/predict_first_ntree.R b/R-package/demo/predict_first_ntree.R index f8e45f2d8..964203e9f 100644 --- a/R-package/demo/predict_first_ntree.R +++ b/R-package/demo/predict_first_ntree.R @@ -5,7 +5,7 @@ data(agaricus.test, package='xgboost') dtrain <- xgb.DMatrix(agaricus.train$data, label = agaricus.train$label) dtest <- xgb.DMatrix(agaricus.test$data, label = agaricus.test$label) -param <- list(max_depth=2,eta=1,silent=1,objective='binary:logistic') +param <- list(max.depth=2,eta=1,silent=1,objective='binary:logistic') watchlist <- list(eval = dtest, train = dtrain) nround = 2 diff --git a/README.md b/README.md index a2dc4fee1..d69189824 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Features Build ===== -* Simply type make +* Run ```bash build.sh``` (you can also type make) * If your compiler does not come with OpenMP support, it will fire an warning telling you that the code will compile into single thread mode, and you will get single thread xgboost * You may get a error: -lgomp is not found - You can type ```make no_omp=1```, this will get you single thread xgboost diff --git a/build.sh b/build.sh new file mode 100755 index 000000000..35a566ccc --- /dev/null +++ b/build.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# this is a simple script to make xgboost in MAC nad Linux +# basically, it first try to make with OpenMP, if fails, disable OpenMP and make again +# This will automatically make xgboost for MAC users who do not have openmp support +# In most cases, type make will give what you want +if make; then + echo "Successfully build multi-thread xgboost" +else + echo "-----------------------------" + echo "Building multi-thread xgboost failed" + echo "Start to build single-thread xgboost" + make clean + make no_omp=1 + echo "Successfully build single-thread xgboost" +fi