Builds classifier hierarchy, implments the classify function. Sets up work for training function.