Matrix formatting in boosting