def test_determine_split_uniform(self, dis_level=3): ests = [ RandomForestConfig(n_estimators=500).get_est_args(), RandomForestConfig(n_estimators=500).get_est_args(), ExtraRandomForestConfig(n_estimators=500).get_est_args(), ExtraRandomForestConfig(n_estimators=500).get_est_args() ] should_split, split_scheme = determine_split(50, 3, ests) print(should_split, split_scheme)
def determine_split1(self, dis_level=3): ests = [ RandomForestConfig(n_estimators=200).get_est_args(), ExtraRandomForestConfig(n_estimators=200).get_est_args() ] should_split, split_scheme = determine_split(dis_level, 3, ests) if dis_level == 3: assert should_split is True assert split_scheme == [[67, 67, 66], [67, 67, 66]] elif dis_level == 2: assert should_split is True # print(split_scheme) assert split_scheme == [[100, 100], [100, 100]]
def determine_split5(self, dis_level=3): ests = [ RandomForestConfig(n_estimators=200).get_est_args(), ] should_split, split_scheme = determine_split(dis_level, 8, ests) if dis_level == 3: assert should_split is True assert split_scheme == [[ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 5 ]] elif dis_level == 2: assert should_split is True # print(split_scheme) assert split_scheme == [[100, 100]]
def determine_split8(self, dis_level=3): ests = [ RandomForestConfig(n_estimators=200).get_est_args(), BinClassXGBConfig().get_est_args(), BinClassXGBConfig().get_est_args(), BinClassXGBConfig().get_est_args() ] should_split, split_scheme = determine_split(dis_level, 1, ests) if dis_level == 3: assert should_split is False assert split_scheme == [[200], [-1], [-1], [-1]] elif dis_level == 2: assert should_split is True # print(split_scheme) assert split_scheme == [[100, 100], [-1], [-1], [-1]]