예제 #1
0
def test_run():
    x, y = get_iris(True)
    print_summary(x)

    x, y = get_boston()
    print_summary(x)

    x, y = get_titanic(True)
    print_summary(x)
예제 #2
0
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeClassifier
from sklearn.metrics import roc_auc_score
from sklearn.linear_model import LogisticRegression

from sklearn2.utils import model_name
from sklearn2.datasets import get_iris

# here we use the multi output format for multiclass classif
# this make it possible to use roc_auc_score

random.seed(0)

pd.options.display.width = 160

x, y = get_iris(True)

y2 = pd.get_dummies(y).values

x_train, x_test, y_train, y_test, y2_train, y2_test = train_test_split(
    x, y, y2, test_size=0.33, random_state=42)

rfc = RandomForestClassifier(n_estimators=100,
                             oob_score=True,
                             class_weight='balanced',
                             random_state=0)
dtc = DecisionTreeClassifier(criterion='entropy',
                             max_features=0.85,
                             min_samples_split=2,
                             random_state=0,
                             max_depth=14)