for in range ( )iftrain_pred [ ]!= [ ])err_b err_b + [ierr_b err_b /np sum(walpha_b np log (( err_b )err_b alpha_b_arr append alpha_b for in range ( ) [iw[ ]np exp(- [ ]alpha_b train_pred [ ]yhat_boost np zeros (len( )for in range boostingrounds )yhat_boost yhat_boost alpha_b_arr [ ]learner [jpredict (xyhat np zeros (nyhatyhat_boost >= yhatyhat_boost < - print (adaboost classifier exponential loss "exponentialloss (yyhat_boost )print (adaboost classifier zero --one loss ",zero_one_loss ( ,yhat)adaboost classifier exponential loss adaboost classifier zero --one loss exponential loss zero-one loss loss , figure exponential and zero-one training loss as function of the number of boosting rounds for binary classification problem