训练决策树模型
话不多说,数据分析必备的三个包先导入
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
导入机器学习算法的决策树模块,数据使用jupyter自带的鸢尾花数据集
from sklearn import datasets
from sklearn.tree import DecisionTreeClassifier
from sklearn.model_selection import train_test_split
导入数据