title: R gbm package: Training Error and Adaboost exponential loss function
body: <p>I am using gbm package in R for <strong>binary classification</strong>. I am using adaboost exponential loss function for the algorithm. I have two questions:</p>
  
  <ol>
  <li><p>If I want to see the training error, should I just look at this? (Suppose my model object is called fit, and I used 3-fold CV.)</p>
  
  <p><code>best.iter &lt;- gbm.perf(fit,method="cv")</code></p>
  
  <p><code>fit$train.error[best.iter]</code></p></li>
  <li><p>If I want to do prediction on my training dataset, say "train", with response variable removed, by this line of code: <code>pred &lt;- predict(object=fit,newdata=train,n.trees=best.iter)</code>. It is only giving me the exponential loss values of adaboost. How could I transform this back to the probability of the binary class? I tried <code>plogis</code> and <code>log</code>. The results are just not making sense. For instance, <code>plogis</code> gave me 0.99*** for everything, <code>log</code> gave me the interval [0.52,0.56]. What kind of transformation should I do?</p></li>
  </ol>
  
  <p>FYI, I grew 100 trees and the fitting process seems OK. For instance,</p>
  
  <pre><code>&gt; fit$oobag.improve
  [1] 0.1431295103 0.1093538334 0.0852480128 0.0678520088 0.0549712390 0.0452351232 0.0378058484 0.0319409903
  [9] 0.0275396129 0.0237185758 0.0208696658 0.0182786535 0.0163750200 0.0146381260 0.0132728128 0.0119435448
  [17] 0.0108959138 0.0099211566 0.0091093166 0.0084316036 0.0078037047 0.0071945142 0.0066821670 0.0061718044
  [25] 0.0058103999 0.0054534710 0.0051276913 0.0047975274 0.0044901763 0.0042387273 0.0039702177 0.0037345627
  [33] 0.0035337545 0.0033370776 0.0031656407 0.0029688111 0.0028016085 0.0026640768 0.0025268873 0.0023897908
  [41] 0.0022594735 0.0021612521 0.0020255227 0.0019376223 0.0018393318 0.0017481065 0.0016463413 0.0015561673
  [49] 0.0014813435 0.0014237926 0.0013459092 0.0012719409 0.0012116881 0.0011572038 0.0010948941 0.0010420570
  [57] 0.0009843288 0.0009398356 0.0008938670 0.0008542828 0.0008063698 0.0007637763 0.0007325414 0.0006917561
  [65] 0.0006582027 0.0006313925 0.0005979843 0.0005645791 0.0005410957 0.0005159002 0.0004869797 0.0004643209
  [73] 0.0004464032 0.0004213901 0.0004010297 0.0003815199 0.0003623747 0.0003445184 0.0003269569 0.0003105762
  [81] 0.0002960856 0.0002802715 0.0002679399 0.0002541207 0.0002425242 0.0002294759 0.0002200414 0.0002093278
  [89] 0.0001974315 0.0001893624 0.0001788743 0.0001709422 0.0001624860 0.0001538988 0.0001479532 0.0001403145
  [97] 0.0001338089 0.0001256208 0.0001206701 0.0001142448
  </code></pre>
  
  <p>Thanks!</p>