from sklearn.metrics import classification_report
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=0)
tree = DecisionTreeClassifier()
result = cross_val_score(tree, X_train, y_train, cv = 5)
print("모델성능 : {:.2f}".format(result.mean()))
tree.fit(X_train, y_train)
labels = y_test
guesses = tree.predict(X_test)
print(classification_report(labels, guesses))
'Programming > Machine Learning' 카테고리의 다른 글
Flask 기본사용법 (0) | 2020.03.15 |
---|---|
데이터 값의 치환 replace (0) | 2020.03.14 |
네이버 영화리뷰 감성분석 (0) | 2020.02.17 |
Sentiment Analysis(영화리뷰데이터) (0) | 2020.02.17 |
Titanic데이터활용_DecisionTree_Ensemble (0) | 2020.02.17 |