Last active
November 5, 2020 21:01
-
-
Save 3catz/b883b5bb1f9433d51e8abca23d1e4e7f to your computer and use it in GitHub Desktop.
Using Pycaret library for autoML
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pycaret.datasets import get_data | |
from pycaret.classification import * | |
report["Scores"] = np.round(report["Scores"], 3) | |
report.sort_values(by = "Scores", ascending = False, inplace = True) | |
#report.index | |
ga_feats = report.iloc[0]["Chosen Feats"] | |
ename = setup(data = D[used_feats], target = "DEATH_EVENT", | |
test_data = None, | |
fold_strategy = "stratifiedkfold", | |
fold_shuffle = True, | |
use_gpu = True, | |
normalize = True, | |
categorical_features = None, | |
#pca = True, | |
#pca_method = "kernel", | |
#pca_components = 5, | |
preprocess = False, | |
html = True, | |
#POLYNOMIAL | |
#polynomial_features = True, | |
#polynomial_degree = 2, | |
#transformation | |
#transformation = True, | |
#feature_selection = True, | |
feature_interaction = True, | |
fix_imbalance = True, | |
#fix_imbalance_method = imblearn.over_sampling.SMOTE(), | |
imputation_type='simple', | |
verbose = True, | |
) | |
rskf = RepeatedStratifiedKFold(n_splits = 5, n_repeats = 20) | |
best_model = compare_models(sort = "MCC", round = 2, | |
fold = rskf, | |
#include = ["rf","catboost"], | |
#n_select = 1 | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment