title: xgboost always predict 1 level with imbalance dataset
body: <p>I'm using xgboost to build a model. The dataset only has 200 rows and 10000 cols.</p>
  
  <p>I tried chi-2 to get 100 cols, but my confusion matrix looks like this:</p>
  
  <pre><code>    1 0
  1 190 0
  0  10 0
  </code></pre>
  
  <p>I tried to use 10000 attributes, randomly select 100 attributes, select 100 attributes according to chi-2, but I never get 0 case predicted. Is it because of the dataset, or because the way I use xgboost?</p>
  
  <p>My factor(pred.cv) is always showing only 1 level, while factor(y+1) has 1 or 2 as levels.</p>
  
  <pre><code>param &lt;- list("objective" = "binary:logistic",
            "eval_metric" = "error",
            "nthread" = 2,
            "max_depth" = 5,
            "eta" = 0.3,
            "gamma" = 0,
            "subsample" = 0.8,
            "colsample_bytree" = 0.8,
            "min_child_weight" = 1,
            "max_delta_step"= 5,
            "learning_rate" =0.1,
            "n_estimators" = 1000,
            "seed"=27,
            "scale_pos_weight" = 1
            )
  nfold=3
  nrounds=200
  pred.cv = matrix(bst.cv$pred, nrow=length(bst.cv$pred)/1, ncol=1)
  pred.cv = max.col(pred.cv, "last")
  factor(y+1) # this is the target in train, level 1 and 2
  factor(pred.cv) # this is the issue, it is always only 1 level
  </code></pre>