added train overload

added new overload to the train function to more easaly menipulate
complexity