2.1.14.2.Decision trees and Random Forests with Python
1. 匯入基本的library
import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns%matplotlib inline
2.讀取資料並了解資料
df = pd.read_csv('kyphosis.csv') df.head()
df.info()sns.pairplot(data = df, hue='Kyphosis')
3.使用Skikit-learn library
4.使用Decision tree classifier
5.使用Random tree forest
6.視覺化決策樹
Last updated




