Beispiel #1
0
    X = scal.fit_transform(X)
    X, y = utils.shuffle(X, y, random_state=5)

    ###############
    method_name = 'GPR-set'
    # method_name = 'SVR-set'
    # method_name = 'KNR-set'
    # method_name = 'KRR-set'
    # method_name = 'PAR-set'
    # method_name = 'SGDR-set'
    # method_name = 'BRR-set'
    # method_name = 'LASSO-set'
    # method_name = 'AdaBR-em'
    # method_name = 'GBR-em'
    method_name = 'DTR-em'
    me1, cv1, scoring1, param_grid1 = method = dict_method_reg()[method_name]

    estimator = GridSearchCV(me1,
                             cv=cv1,
                             scoring=scoring1,
                             param_grid=param_grid1,
                             n_jobs=1)

    n_select = (2, 3)
    clf = Exhaustion(estimator,
                     n_select=n_select,
                     muti_grade=2,
                     muti_index=[2, X.shape[1]],
                     must_index=None,
                     n_jobs=4,
                     refit=True).fit(X, y)
Beispiel #2
0
    X_frame['destiny'] = x_rame
    """base_method"""
    # method_name = ['GPR-set', 'SVR-set', 'KRR-set']
    method_name = [
        'GPR-set', 'SVR-set', 'KRR-set', 'KNR-set', 'GBR-em', 'AdaBR-em',
        'RFR-em', "DTR-em"
    ]

    index_all = [
        data.pickle_pd.GPR_set23, data.pickle_pd.SVR_set23,
        data.pickle_pd.KRR_set23
    ]

    estimator_all = []
    for i in method_name:
        me1, cv1, scoring1, param_grid1 = dict_method_reg()[i]
        estimator_all.append(
            GridSearchCV(me1,
                         cv=cv1,
                         scoring=scoring1,
                         param_grid=param_grid1,
                         n_jobs=1))
    """union"""
    # [print(_[0]) for _ in index_all]
    index_slice = [
        tuple(index[0]) for _ in index_all for index in _[:round(len(_) / 3)]
    ]
    index_slice = list(set(index_slice))
    index_slice = [
        index_slice[i] for i in [100, 8, 6, 152, 81, 106, 129, 19, 73, 170]
    ]