def test_termination_condition(self, data_set, max_depth, feature_index_list): """ Function that tests termination condition for a tree to expand. The termination is reached if max depth supplied is reached, or feature index list is exhausted, or the class is pure class. :param data_set: :param max_depth: :param feature_index_list: :return: """ termination = True d_util = DataUtils() class_label, is_pure_class = d_util.get_class_label(data_set) if max_depth > 0 and feature_index_list is not None and len(feature_index_list) > 0 and not is_pure_class: termination = False return termination, class_label