Generate submission code and output file for regression tree