コード例 #1
0
def log06(x_train, y_train, x_test, folds, max_round, n_splits=5):
    clf = LogisticRegression(
        penalty='l2',
        dual=False,
        tol=0.0001,
        C=0.005,
        fit_intercept=True,
        intercept_scaling=1,
        class_weight='balanced',
        random_state=None,
        solver='sag',
        max_iter=200,
        multi_class='ovr',
        verbose=0,
        warm_start=False,
        n_jobs=4,
    )
    # Additional processing of data
    x_train, x_test = feature_engineering_6(x_train, x_test, y_train)

    # Cross Validate
    cv = Cross_Validate(log06.__name__, n_splits, x_train.shape[0],
                        x_test.shape[0], clf, -1, -1)
    cv.cross_validate(x_train, y_train, x_test, folds, verbose_eval=True)

    return cv.trn_gini, cv.y_trn, cv.y_tst, cv.fscore
コード例 #2
0
ファイル: 04_rgf.py プロジェクト: Oreki47/kaggle_competitions
def rgf04(x_train, y_train, x_test, folds, max_round, n_splits=5):
    clf = RGFClassifier(
        max_leaf=1000,
        algorithm="RGF",
        loss="Log",
        l2=0.01,
        sl2=0.01,
        normalize=False,
        min_samples_leaf=7,  # 10,
        n_iter=None,
        opt_interval=100,
        learning_rate=.45,  # .3,
        calc_prob="sigmoid",
        n_jobs=-2,
        memory_policy="generous",
        verbose=0)

    # Additional processing of data
    x_train, x_test = feature_engineering_4(x_train, x_test, y_train)

    # Cross Validate
    cv = Cross_Validate(rgf04.__name__, n_splits, x_train.shape[0],
                        x_test.shape[0], clf, -1, -1)
    cv.cross_validate(x_train, y_train, x_test, folds, verbose_eval=True)

    return cv.trn_gini, cv.y_trn, cv.y_tst, cv.fscore
コード例 #3
0
ファイル: 07_etc.py プロジェクト: Oreki47/kaggle_competitions
def etc07(x_train, y_train, x_test, folds, max_round, n_splits=5):
    clf = ExtraTreesClassifier(
        n_estimators = 800,
        criterion = 'gini',
        max_depth = 5,
        min_samples_split = 100,
        min_samples_leaf = 100,
        max_features ='auto',
        min_impurity_decrease = 0.0,
        n_jobs = 4,
        verbose = 0,
    )
    # Additional processing of data
    x_train, x_test = feature_engineering_7(x_train, x_test, y_train)


    # Cross Validate
    cv = Cross_Validate(etc07.__name__, n_splits, x_train.shape[0], x_test.shape[0], clf, -1, -1)
    cv.cross_validate(x_train, y_train, x_test, folds, verbose_eval=True)

    return cv.trn_gini, cv.y_trn, cv.y_tst, cv.fscore
コード例 #4
0
ファイル: 05_cat.py プロジェクト: Oreki47/kaggle_competitions
def cat05(x_train, y_train, x_test, folds, max_round, n_splits=5):
    clf = CatBoostClassifier(
        iterations=900,
        learning_rate=0.057,
        depth=5,
        l2_leaf_reg=23,
        leaf_estimation_method='Newton',
        loss_function='Logloss',
        thread_count=7,
        random_seed=177,
        one_hot_max_size=10,
        allow_writing_files=False,
    )
    # Additional processing of data
    x_train, x_test = feature_engineering_5(x_train, x_test, y_train)

    # Cross Validate
    cv = Cross_Validate(cat05.__name__, n_splits, x_train.shape[0],
                        x_test.shape[0], clf, -1, -1)
    cv.cross_validate(x_train, y_train, x_test, folds, verbose_eval=True)

    return cv.trn_gini, cv.y_trn, cv.y_tst, cv.fscore