def stump_train(self, optional):
        X = self.X
        Y = self.Y
        w = self.weights

        # train the decision stump 
        feature_index, stump, best_threshold  = train_decision_stump(X, Y, w)
    
        # print optional for the homework
        if optional:
           print('Best Feature: ', feature_index)
	   print('Threshold: ', best_threshold )
 
        self.feature_index = feature_index
        self.stump = stump
decision stump training method
dataset/ETHPy150Open bt3gl/Advanced-Machine-Learning/adaboost/decision_stump.py/DecisionStump.stump_train